]> git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
cleaned up behavior when an invalid replacement sky texture is found - now it will...
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Wed, 31 Jul 2002 11:45:17 +0000 (11:45 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Wed, 31 Jul 2002 11:45:17 +0000 (11:45 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@2142 d7cf8633-e32d-0410-b094-e92efae38249

model_brush.c

index c0c7fac937843d12862934b9c0feb2c9701c7bf1..feab7d7e0e7817821874eb211da7e09e99047b46 100644 (file)
@@ -224,23 +224,27 @@ static void Mod_LoadTextures (lump_t *l)
                // LordHavoc: HL sky textures are entirely different than quake
                if (!loadmodel->ishlbsp && !strncmp(tx->name, "sky", 3) && mtwidth == 256 && mtheight == 128)
                {
-                       data = loadimagepixels(tx->name, false, 0, 0);
-                       if (data)
+                       if (loadmodel->isworldmodel)
                        {
-                               if (image_width == 256 && image_height == 128)
+                               data = loadimagepixels(tx->name, false, 0, 0);
+                               if (data)
                                {
-                                       if (loadmodel->isworldmodel)
-                                               R_InitSky (data, 4);
-                                       Mem_Free(data);
-                               }
-                               else
-                               {
-                                       Mem_Free(data);
-                                       Con_Printf ("Invalid replacement texture for sky \"%s\" in %\"%s\", must be 256x128 pixels\n", tx->name, loadmodel->name);
+                                       if (image_width == 256 && image_height == 128)
+                                       {
+                                               R_InitSky (data, 4);
+                                               Mem_Free(data);
+                                       }
+                                       else
+                                       {
+                                               Mem_Free(data);
+                                               Con_Printf ("Invalid replacement texture for sky \"%s\" in %\"%s\", must be 256x128 pixels\n", tx->name, loadmodel->name);
+                                               if (mtdata != NULL)
+                                                       R_InitSky (mtdata, 1);
+                                       }
                                }
+                               else if (mtdata != NULL)
+                                       R_InitSky (mtdata, 1);
                        }
-                       else if (loadmodel->isworldmodel)
-                               R_InitSky (mtdata, 1);
                }
                else if ((tx->texture = loadtextureimagewithmask(loadmodel->texturepool, tx->name, 0, 0, false, true, true)))
                {