index 773260fb19102e687447ceac187ff7a9f25595e5..e95fc6d73312eea7fac07bfe042d510896fd9ded 100644 (file)
--- a/src/game/g_textures.pas
+++ b/src/game/g_textures.pas
constructor Create (aframesID: LongWord; aloop: Boolean; aspeed: Byte);
destructor Destroy (); override;
constructor Create (aframesID: LongWord; aloop: Boolean; aspeed: Byte);
destructor Destroy (); override;
- procedure draw (x, y: Integer; mirror: TMirrorType);
- procedure drawEx (x, y: Integer; mirror: TMirrorType; rpoint: TDFPoint; angle: SmallInt);
-
procedure reset ();
procedure update ();
procedure enable ();
procedure reset ();
procedure update ();
procedure enable ();
property framesId: LongWord read mId;
property width: Word read mWidth;
property height: Word read mHeight;
property framesId: LongWord read mId;
property width: Word read mWidth;
property height: Word read mHeight;
+
+ property id: LongWord read mId;
end;
end;
procedure DumpTextureNames ();
procedure DumpTextureNames ();
+ type (* private state *)
+ TFrames = record
+ texturesID: array of LongWord;
+ name: AnsiString;
+ frameWidth, frameHeight: Word;
+ used: Boolean;
+ end;
+
+ var (* private state *)
+ framesArray: array of TFrames = nil;
implementation
implementation
used: Boolean;
end;
used: Boolean;
end;
- TFrames = record
- texturesID: array of LongWord;
- name: AnsiString;
- frameWidth, frameHeight: Word;
- used: Boolean;
- end;
-
var
texturesArray: array of _TTexture = nil;
var
texturesArray: array of _TTexture = nil;
- framesArray: array of TFrames = nil;
const
const
end;
end;
-procedure TAnimation.draw (x, y: Integer; mirror: TMirrorType);
-begin
- if (not mEnabled) then exit;
- e_DrawAdv(framesArray[mId].TexturesID[mCurrentFrame], x, y, mAlpha, true, mBlending, 0, nil, mirror);
- //e_DrawQuad(X, Y, X+FramesArray[ID].FrameWidth-1, Y+FramesArray[ID].FrameHeight-1, 0, 255, 0);
-end;
-
-
procedure TAnimation.update ();
begin
if (not mEnabled) then exit;
procedure TAnimation.update ();
begin
if (not mEnabled) then exit;
procedure TAnimation.enable (); begin mEnabled := true; end;
procedure TAnimation.enable (); begin mEnabled := true; end;
-procedure TAnimation.drawEx (x, y: Integer; mirror: TMirrorType; rpoint: TDFPoint; angle: SmallInt);
-begin
- if (not mEnabled) then exit;
- e_DrawAdv(framesArray[mId].TexturesID[mCurrentFrame], x, y, mAlpha, true, mBlending, angle, @rpoint, mirror);
-end;
-
-
function TAnimation.totalFrames (): Integer; inline; begin result := Length(framesArray[mId].TexturesID); end;
function TAnimation.totalFrames (): Integer; inline; begin result := Length(framesArray[mId].TexturesID); end;