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: <<A HREF="mailto:robert@paradox.got.net">robert@paradox.got.net</A>>
To: <<A HREF="mailto:nel@nevrax.org">nel@nevrax.org</A>>
Sent: Wednesday, March 07, 2001 10:33 AM
Subject: [Nel] here's the landscape.cpp patch I used
><i> Thanks to Leighton's advice I was able to get running. Here's the
</I>><i> patch I used:
</I>><i>
</I>><i> $ cvs diff landscape.cpp
</I>><i> Index: landscape.cpp
</I>><i> ===================================================================
</I>><i> RCS file: /home/cvsroot/code/nel/src/3d/landscape.cpp,v
</I>><i> retrieving revision 1.48
</I>><i> diff -u -r1.48 landscape.cpp
</I>><i> --- landscape.cpp 2001/02/28 14:28:57 1.48
</I>><i> +++ landscape.cpp 2001/03/07 09:35:52
</I>><i> @@ -741,16 +741,21 @@
</I>><i> // Fill rdrpass.
</I>><i> CPatchRdrPass pass;
</I>><i> // The diffuse part for a tile is inevitable.
</I>><i> - if(tile)
</I>><i> - pass.TextureDiffuse=
</I>findTileTexture(TileBank.getAbsPath()+tile->getRelativeFileName(CTile::diffu
se));
><i> - else
</I>><i> + if(tile) {
</I>><i> + textName= tile->getRelativeFileName (CTile::diffuse);
</I>><i> + if(textName!="")
</I>><i> + pass.TextureDiffuse=
</I>findTileTexture(TileBank.getAbsPath()+textName);
><i> + } else {
</I>><i> pass.TextureDiffuse= new CTextureCross;
</I>><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 "data/" (a
directory) which may crash on linux ??
><i> if(tile)
</I>><i> {
</I>><i> textName= tile->getRelativeFileName (CTile::alpha);
</I>><i> if(textName!="")
</I>><i> pass.TextureAlpha=
</I>findTileTexture(TileBank.getAbsPath()+textName);
><i> - }
</I>><i> + } else {
</I>><i> + pass.TextureAlpha= new CTextureCross;
</I>><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>
|