X-Git-Url: http://deadsoftware.ru/gitweb?a=blobdiff_plain;f=src%2Fgame%2Fopengl%2Fr_animations.pas;h=8af7830556b35c49ba65b8a9c700357e7c25a0b6;hb=0da9a438ff0d90e07b82d929065de68a106cb09e;hp=156869b82640047a1f888265e1c36887b932736a;hpb=e575ce001fa1150001a91db8c019f72a5ff48b32;p=d2df-sdl.git diff --git a/src/game/opengl/r_animations.pas b/src/game/opengl/r_animations.pas index 156869b..8af7830 100644 --- a/src/game/opengl/r_animations.pas +++ b/src/game/opengl/r_animations.pas @@ -17,13 +17,10 @@ unit r_animations; interface - uses g_base, g_textures, MAPDEF, Imaging; // TMirrorType, TAnimation, TDFPoint, TDynImageDataArray + uses g_base, g_textures, 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_AnimationState_Draw (TID: DWORD; t: TAnimationState; x, y: Integer; mirror: TMirrorType); - procedure r_AnimationState_DrawEx (FID: DWORD; t: TAnimationState; x, y: Integer; mirror: TMirrorType; rpoint: TDFPoint; angle: SmallInt); + procedure r_AnimationState_Draw (FID: DWORD; t: TAnimationState; x, y: Integer; alpha: Byte; mirror: TMirrorType; blending: Boolean); + procedure r_AnimationState_DrawEx (FID: DWORD; t: TAnimationState; 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; @@ -33,6 +30,7 @@ interface 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); @@ -59,28 +57,27 @@ implementation 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 - if t.enabled then - e_DrawAdv(framesArray[t.id].TexturesID[t.currentFrame], x, y, t.alpha, true, t.blending, 0, nil, mirror) - end; - - procedure r_Animation_DrawEx (t: TAnimation; x, y: Integer; mirror: TMirrorType; 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) + w := 0; + h := 0; + if framesArray <> nil then + begin + w := framesArray[ID].frameWidth; + h := framesArray[ID].frameHeight; + end end; - procedure r_AnimationState_Draw (TID: DWORD; t: TAnimationState; x, y: Integer; mirror: TMirrorType); + procedure r_AnimationState_Draw (FID: DWORD; t: TAnimationState; x, y: Integer; alpha: Byte; mirror: TMirrorType; blending: Boolean); begin if t.enabled then - e_DrawAdv(framesArray[TID].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_AnimationState_DrawEx (FID: DWORD; t: TAnimationState; x, y: Integer; mirror: TMirrorType; rpoint: TDFPoint; angle: SmallInt); + procedure r_AnimationState_DrawEx (FID: DWORD; t: TAnimationState; x, y: Integer; alpha: Byte; mirror: TMirrorType; blending: Boolean; rpoint: TDFPoint; angle: SmallInt); begin if t.enabled then - e_DrawAdv(framesArray[FID].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;