index 1b634051753716d481178091eaf2134a6bbe88bb..76426d548f06a107cb6eb139ac19ccb91efd7334 100644 (file)
interface
- uses g_base, g_textures, MAPDEF, Imaging; // TMirrorType, TAnimation, TDFPoint, TDynImageDataArray
+ uses g_base, g_animations, MAPDEF, Imaging; // TMirrorType, TAnimationState, TDFPoint, TDynImageDataArray
- procedure r_Animation_Draw (t: TAnimation; x, y: Integer; mirror: TMirrorType);
- procedure r_Animation_DrawEx (t: TAnimation; x, y: Integer; mirror: TMirrorType; rpoint: TDFPoint; angle: SmallInt);
+ procedure r_AnimState_Draw (FID: DWORD; const t: TAnimState; x, y: Integer; alpha: Byte; mirror: TMirrorType; blending: Boolean);
+ procedure r_AnimState_DrawEx (FID: DWORD; const t: TAnimState; x, y: Integer; alpha: Byte; mirror: TMirrorType; blending: Boolean; rpoint: TDFPoint; angle: SmallInt);
function g_CreateFramesImg (ia: TDynImageDataArray; ID: PDWORD; const Name: AnsiString; BackAnimation: Boolean = false): Boolean;
function g_Frames_Dup (const NewName, OldName: AnsiString): Boolean;
function g_Frames_Get (out ID: LongWord; const FramesName: AnsiString): Boolean;
function g_Frames_GetTexture (out ID: LongWord; const FramesName: AnsiString; Frame: Word): Boolean;
+ procedure g_Frames_GetFrameSize (ID: DWORD; out w, h: Integer);
function g_Frames_Exists (const FramesName: AnsiString): Boolean;
procedure g_Frames_DeleteByName (const FramesName: AnsiString);
procedure g_Frames_DeleteByID (ID: LongWord);
g_language, g_game
;
- procedure r_Animation_Draw (t: TAnimation; x, y: Integer; mirror: TMirrorType);
+ procedure g_Frames_GetFrameSize (ID: DWORD; out w, h: Integer);
+ begin
+ w := 0;
+ h := 0;
+ if framesArray <> nil then
+ begin
+ w := framesArray[ID].frameWidth;
+ h := framesArray[ID].frameHeight;
+ end
+ end;
+
+ procedure r_AnimState_Draw (FID: DWORD; const t: TAnimState; x, y: Integer; alpha: Byte; mirror: TMirrorType; blending: Boolean);
begin
if t.enabled then
- e_DrawAdv(framesArray[t.id].TexturesID[t.currentFrame], x, y, t.alpha, true, t.blending, 0, nil, mirror)
+ e_DrawAdv(framesArray[FID].TexturesID[t.currentFrame], x, y, alpha, true, blending, 0, nil, mirror)
end;
- procedure r_Animation_DrawEx (t: TAnimation; x, y: Integer; mirror: TMirrorType; rpoint: TDFPoint; angle: SmallInt);
+ procedure r_AnimState_DrawEx (FID: DWORD; const t: TAnimState; x, y: Integer; alpha: Byte; mirror: TMirrorType; blending: Boolean; rpoint: TDFPoint; angle: SmallInt);
begin
if t.enabled then
- e_DrawAdv(framesArray[t.id].TexturesID[t.currentFrame], x, y, t.alpha, true, t.blending, angle, @rpoint, mirror)
+ e_DrawAdv(framesArray[FID].TexturesID[t.currentFrame], x, y, alpha, true, blending, angle, @rpoint, mirror)
end;
function allocFrameSlot (): LongWord;