ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/cf.schmorp.de/Deliantra-Client/texcache.c
(Generate patch)

Comparing cf.schmorp.de/Deliantra-Client/texcache.c (file contents):
Revision 1.7 by root, Thu Nov 26 07:19:11 2009 UTC vs.
Revision 1.8 by root, Sun Nov 29 14:45:12 2009 UTC

16static void tc_clear (void); 16static void tc_clear (void);
17static void tc_backup (void); 17static void tc_backup (void);
18static void tc_restore (void); 18static void tc_restore (void);
19 19
20///////////////////////////////////////////////////////////////////////////// 20/////////////////////////////////////////////////////////////////////////////
21
22// required as bug-workaround for apple/ati/...
23static unsigned char tc_temptile [TC_WIDTH * TC_HEIGHT];
21 24
22#include <glib.h> 25#include <glib.h>
23 26
24int tc_generation; 27int tc_generation;
25 28
127 match->saved = 0; 130 match->saved = 0;
128 131
129 glBindTexture (GL_TEXTURE_2D, match->name); 132 glBindTexture (GL_TEXTURE_2D, match->name);
130 glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); 133 glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
131 glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); 134 glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
132 glTexImage2D (GL_TEXTURE_2D, 0, GL_ALPHA, TC_WIDTH, TC_HEIGHT, 0, GL_ALPHA, GL_UNSIGNED_BYTE, 0); 135
136 // the last parameter should be NULL, but way too amny drivers (ATI, Mesa) crash,
137 // so we better provide some random garbage data for them.
138 glTexImage2D (GL_TEXTURE_2D,
139 0, GL_ALPHA,
140 TC_WIDTH, TC_HEIGHT,
141 0, GL_ALPHA,
142 GL_UNSIGNED_BYTE, tc_temptile);
133 } 143 }
134 144
135 match->avail -= slice_height; 145 match->avail -= slice_height;
136 146
137 slice->name = match->name; 147 slice->name = match->name;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines