@@ -29,6 +29,8 @@ along with LiveCode. If not see <http://www.gnu.org/licenses/>. */
29
29
#include " packed.h"
30
30
#include " mbldc.h"
31
31
32
+ #include < pthread.h>
33
+
32
34
#if defined(_IOS_MOBILE)
33
35
#include < CoreGraphics/CoreGraphics.h>
34
36
#import < OpenGLES/ES1/gl.h>
@@ -187,6 +189,7 @@ static bool MCTileCacheOpenGLCompositorCreateTile(MCTileCacheOpenGLCompositorCon
187
189
super_tile *t_super_tile;
188
190
if (!MCMemoryAllocate (8 + self -> super_tile_arity, t_super_tile))
189
191
return false ;
192
+
190
193
191
194
// Generate a texture id, and bind an empty texture.
192
195
glGenTextures (1 , &t_super_tile -> texture);
@@ -214,7 +217,7 @@ static bool MCTileCacheOpenGLCompositorCreateTile(MCTileCacheOpenGLCompositorCon
214
217
215
218
// Make sure we don't make redundent bind calls.
216
219
self -> current_texture = t_super_tile -> texture;
217
-
220
+
218
221
// And compute the id (note the subtile index is 0!).
219
222
MCTileCacheOpenGLCompositorEncodeTile (self, t_super_tile_index, 0 , r_tile);
220
223
@@ -254,6 +257,7 @@ static void MCTileCacheOpenGLCompositorFlushSuperTiles(MCTileCacheOpenGLComposit
254
257
glDeleteTextures (1 , &self -> super_tiles[i] -> texture);
255
258
MCMemoryDelete (self -> super_tiles[i]);
256
259
self -> super_tiles[i] = nil;
260
+
257
261
}
258
262
}
259
263
}
@@ -278,7 +282,9 @@ bool MCTileCacheOpenGLCompositor_BeginTiling(void *p_context)
278
282
if (t_super_tile_arity != self -> super_tile_arity ||
279
283
self -> needs_flush)
280
284
{
281
- MCTileCacheOpenGLCompositorFlushSuperTiles (self, true );
285
+ // MW-2013-06-26: [[ Bug 10991 ]] Don't force flushing of the tilecache, otherwise
286
+ // we end up discarding tiles that are still needed after a 'compact()' operation.
287
+ MCTileCacheOpenGLCompositorFlushSuperTiles (self, false );
282
288
283
289
self -> super_tile_arity = t_super_tile_arity;
284
290
self -> needs_flush = false ;
0 commit comments