… | |
… | |
16 | static void tc_clear (void); |
16 | static void tc_clear (void); |
17 | static void tc_backup (void); |
17 | static void tc_backup (void); |
18 | static void tc_restore (void); |
18 | static void tc_restore (void); |
19 | |
19 | |
20 | ///////////////////////////////////////////////////////////////////////////// |
20 | ///////////////////////////////////////////////////////////////////////////// |
|
|
21 | |
|
|
22 | // required as bug-workaround for apple/ati/... |
|
|
23 | static unsigned char tc_temptile [TC_WIDTH * TC_HEIGHT]; |
21 | |
24 | |
22 | #include <glib.h> |
25 | #include <glib.h> |
23 | |
26 | |
24 | int tc_generation; |
27 | int 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; |