index 26a06f9a2a89067c31cd9df5574ea03481ed446d..7d8ad75283212881d9f40d4963ab75de5ef27b1c 100644 (file)
--- a/src/game/g_textures.pas
+++ b/src/game/g_textures.pas
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
+ * the Free Software Foundation, version 3 of the License ONLY.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
implementation
uses
implementation
uses
+ {$INCLUDE ../nogl/noGLuses.inc}
g_game, e_log, g_basic, g_console, wadreader,
g_game, e_log, g_basic, g_console, wadreader,
- g_language, GL, utils, xstreams;
+ g_language, utils, xstreams;
type
_TTexture = record
type
_TTexture = record
if WAD.GetResource(g_ExtractFilePathName(Resource), TextureData, ResourceLength) then
begin
if e_CreateTextureMem(TextureData, ResourceLength, ID) then
if WAD.GetResource(g_ExtractFilePathName(Resource), TextureData, ResourceLength) then
begin
if e_CreateTextureMem(TextureData, ResourceLength, ID) then
- begin
result := true;
result := true;
- end
- else
- begin
- FreeMem(TextureData);
- end;
+ FreeMem(TextureData)
end
else
begin
end
else
begin
e_GetTextureSize(texturesArray[find_id].ID, @texturesArray[find_id].width, @texturesArray[find_id].height);
texturesArray[find_id].used := true;
texturesArray[find_id].Name := textureName;
e_GetTextureSize(texturesArray[find_id].ID, @texturesArray[find_id].width, @texturesArray[find_id].height);
texturesArray[find_id].used := true;
texturesArray[find_id].Name := textureName;
- end
- else
- begin
- FreeMem(TextureData);
end;
end;
+ FreeMem(TextureData)
end
else
begin
end
else
begin
if not CreateFramesMem(TextureData, ResourceLength, ID, Name, mWidth, mHeight, mCount, BackAnimation) then
begin
if not CreateFramesMem(TextureData, ResourceLength, ID, Name, mWidth, mHeight, mCount, BackAnimation) then
begin
+ FreeMem(TextureData);
WAD.Free();
exit;
end;
WAD.Free();
exit;
end;
+ FreeMem(TextureData);
WAD.Free();
result := true;
WAD.Free();
result := true;
constructor TAnimation.Create (aframesID: LongWord; aloop: Boolean; aspeed: Byte);
begin
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;
mId := aframesID;
mMinLength := 0;
mLoop := aloop;