summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 3e1354d)
raw | patch | inline | side by side (parent: 3e1354d)
author | DeaDDooMER <deaddoomer@deadsoftware.ru> | |
Tue, 18 Jan 2022 21:16:26 +0000 (00:16 +0300) | ||
committer | DeaDDooMER <deaddoomer@deadsoftware.ru> | |
Fri, 9 Jun 2023 07:57:04 +0000 (10:57 +0300) |
src/game/opengl/r_animations.pas | patch | blob | history | |
src/game/opengl/r_monsters.pas | patch | blob | history |
index f50ce92b382b21cb5868c22fb12d96f88226205b..8af7830556b35c49ba65b8a9c700357e7c25a0b6 100644 (file)
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 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_AnimationState_Draw (FID: DWORD; t: TAnimationState; x, y: Integer; alpha: Byte; mirror: TMirrorType; blending: Boolean);
begin
if t.enabled then
index 7b1fcc4b0a147dda4b2ff37ddd9de3b36202d078..6ae4510555fba9f331f156adbfcca768e6aba966 100644 (file)
;
type
- TMonsterDirected = array [TDirection.D_LEFT..TDirection.D_RIGHT] of DWORD;
- TMonsterAnims = array [ANIM_SLEEP..ANIM_PAIN] of TMonsterDirected;
+ TMonsterAnims = array [ANIM_SLEEP..ANIM_PAIN, TDirection.D_LEFT..TDirection.D_RIGHT] of DWORD;
var
VileFire: DWORD;
end;
procedure r_Monsters_Draw (constref monster: TMonster);
- var m: TMirrorType; dx, dy, c, fX, fY: Integer; o: TObj;
+ var m: TMirrorType; dx, dy, c, fX, fY, mw, mh: Integer; o: TObj;
begin
with monster do
begin
// Расстояние от края текстуры до края визуального положения объекта на текстуре:
c := (MONSTERTABLE[MonsterType].Rect.X - dx) + MONSTERTABLE[MonsterType].Rect.Width;
// Расстояние от края хит бокса до края визуального положения объекта на текстуре:
- //dx := DirAnim[MonsterAnim, GameDirection].Width - c - MONSTERTABLE[MonsterType].Rect.X;
- dx := 64 - c - MONSTERTABLE[MonsterType].Rect.X; // !!! ^^^
+ g_Frames_GetFrameSize(monFrames[MonsterType, MonsterAnim, GameDirection], mw, mh);
+ dx := mw - c - MONSTERTABLE[MonsterType].Rect.X; // !!! ^^^
// Т.к. двигать текстуру нужно будет в противоположном направлении:
dx := -dx;
// Это значит: dX := -frameWidth - animDeltaX + hitX + hitWidth + hitX