index fbbbf9270f4cbb82dfc64726ec1b948a434f496d..16b0655a01dbcd0f81117770a592c9104fa1d027 100644 (file)
--- a/src/game/g_textures.pas
+++ b/src/game/g_textures.pas
public
constructor Create (aloop: Boolean; aspeed: Byte; len: Integer);
- procedure Destroy;
+ procedure Invalidate;
procedure reset ();
procedure update ();
procedure loadState (st: TStream; out mAlpha: Byte; out mBlending: Boolean);
function totalFrames (): Integer; inline;
+ function IsInvalid (): Boolean;
+ function IsValid (): Boolean;
public
property played: Boolean read mPlayed;
constructor TAnimState.Create (aloop: Boolean; aspeed: Byte; len: Integer);
begin
+ Self := Default(TAnimState);
+
assert(len >= 0);
mLength := len;
mPlayed := false;
end;
-procedure TAnimState.Destroy;
+procedure TAnimState.Invalidate;
begin
Self := Default(TAnimState);
end;
result := mLength
end;
+function TAnimState.IsInvalid (): Boolean;
+begin
+ result := mLength <= 0
+end;
+
+function TAnimState.IsValid (): Boolean;
+begin
+ result := mLength > 0
+end;
+
procedure TAnimState.saveState (st: TStream; mAlpha: Byte; mBlending: Boolean);
begin
if (st = nil) then exit;