DEADSOFTWARE

render: use TAnimationState instead of TAnimation
[d2df-sdl.git] / src / game / g_map.pas
index a6e1dabcd1e197b05ed9b19e2a1f867dae033410..026ef9bfc35760de0b8ae1fcf6d202b471429967 100644 (file)
@@ -242,14 +242,15 @@ type
 var
   mapGrid: TPanelGrid = nil; // DO NOT USE! public for debugging only!
 
+var (* private state *)
+  Textures: TLevelTextureArray = nil;
 
 implementation
 
 uses
-  {$INCLUDE ../nogl/noGLuses.inc}
-  e_input, g_main, e_log, e_texture, e_res, g_items, g_gfx, g_console,
+  e_input, e_log, e_res, g_items, g_gfx, g_console,
   g_weapons, g_game, g_sound, e_sound, CONFIG,
-  g_options, g_triggers, g_player,
+  g_options, g_triggers, g_player, r_textures, r_animations,
   Math, g_monsters, g_saveload, g_language, g_netmsg,
   sfs, xstreams, hashtable, wadreader,
   ImagingTypes, Imaging, ImagingUtility,
@@ -524,7 +525,6 @@ begin
 end;
 
 var
-  Textures: TLevelTextureArray = nil;
   TextNameHash: THashStrInt = nil; // key: texture name; value: index in `Textures`
   BadTextNameHash: THashStrInt = nil; // set; so we won't spam with non-existing texture messages
   RespawnPoints: array of TRespawnPoint;
@@ -2203,16 +2203,11 @@ begin
     begin
       e_WriteLog('  Loading sky: ' + gMapInfo.SkyName, TMsgType.Notify);
       g_Game_SetLoadingText(_lc[I_LOAD_SKY], 0, False);
-      if gTextureFilter then TEXTUREFILTER := GL_LINEAR else TEXTUREFILTER := GL_NEAREST;
-      try
-        s := e_GetResourcePath(WadDirs, gMapInfo.SkyName, g_ExtractWadName(Res));
-        if g_Texture_CreateWAD(BackID, s) then
-          g_Game_SetupScreenSize
-        else
-          g_FatalError(Format(_lc[I_GAME_ERROR_SKY], [s]))
-      finally
-        TEXTUREFILTER := GL_NEAREST;
-      end;
+      s := e_GetResourcePath(WadDirs, gMapInfo.SkyName, g_ExtractWadName(Res));
+      if g_Texture_CreateWAD(BackID, s, gTextureFilter) then
+        g_Game_SetupScreenSize
+      else
+        g_FatalError(Format(_lc[I_GAME_ERROR_SKY], [s]))
     end;
 
     // Çàãðóçêà ìóçûêè