DEADSOFTWARE

render: remove from render some common types
[d2df-sdl.git] / src / game / g_textures.pas
index 87893c2a9cc22089e60ac02798d1bbbdf2e097a2..6417fa9363e9c9de5458dd57564c0017090fe997 100644 (file)
@@ -20,7 +20,7 @@ interface
 uses
   SysUtils, Classes,
   {$IFDEF USE_MEMPOOL}mempool,{$ENDIF}
-  e_graphics, MAPDEF, ImagingTypes, Imaging, ImagingUtility;
+  g_base, r_graphics, MAPDEF, ImagingTypes, Imaging, ImagingUtility;
 
 type
   TLevelTexture = record
@@ -737,7 +737,13 @@ end;
 
 constructor TAnimation.Create (aframesID: LongWord; aloop: Boolean; aspeed: Byte);
 begin
-  if (aframesID >= Length(framesArray)) then raise Exception.Create('trying to create inexisting frame: something is very wrong here');
+  if (aframesID >= Length(framesArray)) then
+  begin
+    //raise Exception.Create('trying to create inexisting frame: something is very wrong here');
+    e_LogWritefln('trying to create inexisting frame %u of %u: something is very wrong here', [aframesID, LongWord(Length(framesArray))], TMsgType.Warning);
+    aframesID := 0;
+    if (Length(framesArray) = 0) then raise Exception.Create('trying to create inexisting frame: something is very wrong here');
+  end;
   mId := aframesID;
   mMinLength := 0;
   mLoop := aloop;