aboutsummaryrefslogtreecommitdiff
path: root/pipermail/nel/2001-March/000363.html
blob: ab35c98b83b29ed4454c56bdd2e999c41a70eeb5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
 <HEAD>
   <TITLE> [Nel] here's the landscape.cpp patch I used</TITLE>
   <LINK REL="Index" HREF="index.html" >
   <LINK REL="made" HREF="mailto:berenguier%40nevrax.com">
   <LINK REL="Previous"  HREF="000362.html">
   <LINK REL="Next" HREF="000365.html">
 </HEAD>
 <BODY BGCOLOR="#ffffff">
   <H1>[Nel] here's the landscape.cpp patch I used</H1>
    <B>Lionel Berenguier</B> 
    <A HREF="mailto:berenguier%40nevrax.com"
       TITLE="[Nel] here's the landscape.cpp patch I used">berenguier@nevrax.com</A><BR>
    <I>Wed, 7 Mar 2001 11:59:21 +0100</I>
    <P><UL>
        <LI> Previous message: <A HREF="000362.html">[Nel] here's the landscape.cpp patch I used</A></li>
        <LI> Next message: <A HREF="000365.html">[Nel] 'data/' bug</A></li>
         <LI> <B>Messages sorted by:</B> 
              <a href="date.html#363">[ date ]</a>
              <a href="thread.html#363">[ thread ]</a>
              <a href="subject.html#363">[ subject ]</a>
              <a href="author.html#363">[ author ]</a>
         </LI>
       </UL>
    <HR>  
<!--beginarticle-->
<PRE>----- Original Message -----
From: &lt;<A HREF="mailto:robert@paradox.got.net">robert@paradox.got.net</A>&gt;
To: &lt;<A HREF="mailto:nel@nevrax.org">nel@nevrax.org</A>&gt;
Sent: Wednesday, March 07, 2001 10:33 AM
Subject: [Nel] here's the landscape.cpp patch I used


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

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 &quot;data/&quot; (a
directory) which may crash on linux ??


&gt;<i>         if(tile)
</I>&gt;<i>         {
</I>&gt;<i>                 textName= tile-&gt;getRelativeFileName (CTile::alpha);
</I>&gt;<i>                 if(textName!=&quot;&quot;)
</I>&gt;<i>                         pass.TextureAlpha=
</I>findTileTexture(TileBank.getAbsPath()+textName);
&gt;<i> -       }
</I>&gt;<i> +       } else {
</I>&gt;<i> +                pass.TextureAlpha= new CTextureCross;
</I>&gt;<i> +        }
</I>

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


I'll correct this.



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



</pre>



<!--endarticle-->
    <HR>
    <P><UL>
        <!--threads-->
	<LI> Previous message: <A HREF="000362.html">[Nel] here's the landscape.cpp patch I used</A></li>
	<LI> Next message: <A HREF="000365.html">[Nel] 'data/' bug</A></li>
         <LI> <B>Messages sorted by:</B> 
              <a href="date.html#363">[ date ]</a>
              <a href="thread.html#363">[ thread ]</a>
              <a href="subject.html#363">[ subject ]</a>
              <a href="author.html#363">[ author ]</a>
         </LI>
       </UL>
</body></html>