[Nel] here's the landscape.cpp patch I used

Lionel Berenguier berenguier@nevrax.com
Wed, 7 Mar 2001 11:59:21 +0100


----- Original Message -----
From: <robert@paradox.got.net>
To: <nel@nevrax.org>
Sent: Wednesday, March 07, 2001 10:33 AM
Subject: [Nel] here's the landscape.cpp patch I used


> Thanks to Leighton's advice I was able to get running.  Here's the
> patch I used:
>
> $ cvs diff landscape.cpp
> Index: landscape.cpp
> ===================================================================
> RCS file: /home/cvsroot/code/nel/src/3d/landscape.cpp,v
> retrieving revision 1.48
> diff -u -r1.48 landscape.cpp
> --- landscape.cpp       2001/02/28 14:28:57     1.48
> +++ landscape.cpp       2001/03/07 09:35:52
> @@ -741,16 +741,21 @@
>         // Fill rdrpass.
>         CPatchRdrPass   pass;
>         // The diffuse part for a tile is inevitable.
> -       if(tile)
> -               pass.TextureDiffuse=
findTileTexture(TileBank.getAbsPath()+tile->getRelativeFileName(CTile::diffu
se));
> -       else
> +       if(tile) {
> +               textName= tile->getRelativeFileName (CTile::diffuse);
> +               if(textName!="")
> +                       pass.TextureDiffuse=
findTileTexture(TileBank.getAbsPath()+textName);
> +       } else {
>                 pass.TextureDiffuse= new CTextureCross;
> +        }


Actually, If CTextureFile::generate() do not find the file, it should do the
work of creating a dummy texture for you.

I think, the bug is CTextureFile::generate() try to load a "data/" (a
directory) which may crash on linux ??


>         if(tile)
>         {
>                 textName= tile->getRelativeFileName (CTile::alpha);
>                 if(textName!="")
>                         pass.TextureAlpha=
findTileTexture(TileBank.getAbsPath()+textName);
> -       }
> +       } else {
> +                pass.TextureAlpha= new CTextureCross;
> +        }


This patch is wrong, because a NULL TextureAlpha is possible, and should not
crash.


I'll correct this.



Lionel Berenguier.
---
3d programmer / nevrax.com