avoid loading OpenGL textures before they have been paged in, bug found by loading...
authorChris Taylor <chris@icculus.org>
Thu, 30 Nov 2006 13:42:20 +0000 (13:42 +0000)
committerChris Taylor <chris@icculus.org>
Thu, 30 Nov 2006 13:42:20 +0000 (13:42 +0000)
ChangeLog
arch/ogl/ogl.c

index fa5fbe8..c3f7283 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2006-11-30  Chris Taylor  <chris@icculus.org>
+
+       * arch/ogl/ogl.c: avoid loading OpenGL textures before they have
+       been paged in, bug found by loading Abalyon 5
+
 2006-11-26  Chris Taylor  <chris@icculus.org>
 
        * main/game.c, main/gamerend.c: small brace tidy up to allow
index 4677373..450acae 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: ogl.c,v 1.38 2005-11-07 15:36:46 chris Exp $ */
+/* $Id: ogl.c,v 1.39 2006-11-30 13:42:20 chris Exp $ */
 /*
  *
  * Graphics support functions for OpenGL.
@@ -523,10 +523,16 @@ void ogl_cache_level_textures(void)
                        }
                        else if(Objects[i].render_type==RT_POLYOBJ){
                                //printf("robot %i model %i rmodel %i\n", Objects[i].id, Objects[i].rtype.pobj_info.model_num, Robot_info[Objects[i].id].model_num);
-                               ogl_cache_vclipn_textures(Robot_info[Objects[i].id].exp1_vclip_num);
-                               ogl_cache_vclipn_textures(Robot_info[Objects[i].id].exp2_vclip_num);
-                               ogl_cache_weapon_textures(Robot_info[Objects[i].id].weapon_type);
-                               ogl_cache_polymodel_textures(Objects[i].rtype.pobj_info.model_num);
+                               if (Objects[i].type == OBJ_ROBOT)
+                               {
+                                       ogl_cache_vclipn_textures(Robot_info[Objects[i].id].exp1_vclip_num);
+                                       ogl_cache_vclipn_textures(Robot_info[Objects[i].id].exp2_vclip_num);
+                                       ogl_cache_weapon_textures(Robot_info[Objects[i].id].weapon_type);
+                               }
+                               if (Objects[i].rtype.pobj_info.tmap_override != -1)
+                                       ogl_loadbmtexture(&GameBitmaps[Textures[Objects[i].rtype.pobj_info.tmap_override].index]);
+                               else
+                                       ogl_cache_polymodel_textures(Objects[i].rtype.pobj_info.model_num);
                        }
                }
        }