summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: c7f0b67)
raw | patch | inline | side by side (parent: c7f0b67)
author | DeaDDooMER <deaddoomer@deadsoftware.ru> | |
Mon, 17 Jan 2022 16:35:32 +0000 (19:35 +0300) | ||
committer | DeaDDooMER <deaddoomer@deadsoftware.ru> | |
Mon, 17 Jan 2022 16:35:32 +0000 (19:35 +0300) |
src/game/g_player.pas | patch | blob | history | |
src/game/g_weapons.pas | patch | blob | history | |
src/game/opengl/r_player.pas | patch | blob | history |
diff --git a/src/game/g_player.pas b/src/game/g_player.pas
index e7f3fee964a6f24df74675de530d0b8d3255312b..070ca331c1097a5e15336a2bb88c8d1b7a9410f2 100644 (file)
--- a/src/game/g_player.pas
+++ b/src/game/g_player.pas
PShell = ^TShell;
TShell = record
- SpriteID: DWORD;
- alive: Boolean;
+ alive: Boolean;
SType: Byte;
RAngle: Integer;
Timeout: Cardinal;
- CX, CY: Integer;
Obj: TObj;
procedure getMapBox (out x, y, w, h: Integer); inline;
end;
procedure g_Player_CreateShell(fX, fY, dX, dY: Integer; T: Byte);
-var
- SID: DWORD;
begin
if (gShells = nil) or (Length(gShells) = 0) then
Exit;
with gShells[CurrentShell] do
begin
- SpriteID := 0;
g_Obj_Init(@Obj);
Obj.Rect.X := 0;
Obj.Rect.Y := 0;
if T = SHELL_BULLET then
begin
- if g_Texture_Get('TEXTURE_SHELL_BULLET', SID) then
- SpriteID := SID;
- CX := 2;
- CY := 1;
Obj.Rect.Width := 4;
Obj.Rect.Height := 2;
end
else
begin
- if g_Texture_Get('TEXTURE_SHELL_SHELL', SID) then
- SpriteID := SID;
- CX := 4;
- CY := 2;
Obj.Rect.Width := 7;
Obj.Rect.Height := 3;
end;
diff --git a/src/game/g_weapons.pas b/src/game/g_weapons.pas
index 2f157abf53ef42e5357146a6c05ed1f5152ebdbe..1ffbdf6c15794dcbe2e6fd10dc409b322c452329 100644 (file)
--- a/src/game/g_weapons.pas
+++ b/src/game/g_weapons.pas
g_Sound_CreateWADEx('SOUND_PLAYER_SHELL1', GameWAD+':SOUNDS\SHELL1');
g_Sound_CreateWADEx('SOUND_PLAYER_SHELL2', GameWAD+':SOUNDS\SHELL2');
- g_Texture_CreateWADEx('TEXTURE_SHELL_BULLET', GameWAD+':TEXTURES\EBULLET');
- g_Texture_CreateWADEx('TEXTURE_SHELL_SHELL', GameWAD+':TEXTURES\ESHELL');
-
//wgunMonHash := hashNewIntInt();
wgunHitHeap := TBinaryHeapHitTimes.Create();
end;
index 1e5dec0edc646393aa95cab7fba5ff2611dfee24..6d87a18ce5afe35df3f83b35c699966a1a9e5011 100644 (file)
var
PunchFrames: array [Boolean, 0..2] of DWORD;
+ BulletTexture: DWORD;
+ ShellTexture: DWORD;
procedure r_Player_Load;
begin
g_Frames_CreateWAD(@PunchFrames[True, 0], 'FRAMES_PUNCH_BERSERK', GameWAD + ':WEAPONS\PUNCHB', 64, 64, 4, False);
g_Frames_CreateWAD(@PunchFrames[True, 1], 'FRAMES_PUNCH_BERSERK_UP', GameWAD + ':WEAPONS\PUNCHB_UP', 64, 64, 4, False);
g_Frames_CreateWAD(@PunchFrames[True, 2], 'FRAMES_PUNCH_BERSERK_DN', GameWAD + ':WEAPONS\PUNCHB_DN', 64, 64, 4, False);
+ g_Texture_CreateWADEx('TEXTURE_SHELL_BULLET', GameWAD + ':TEXTURES\EBULLET');
+ g_Texture_CreateWADEx('TEXTURE_SHELL_SHELL', GameWAD + ':TEXTURES\ESHELL');
+ g_Texture_Get('TEXTURE_SHELL_BULLET', BulletTexture);
+ g_Texture_Get('TEXTURE_SHELL_SHELL', ShellTexture);
end;
procedure r_Player_Free;
r_Player_DrawCorpse(gCorpses[i])
end;
-procedure r_Player_DrawShells;
-var
- i, fX, fY: Integer;
- a: TDFPoint;
-begin
- if gShells <> nil then
- for i := 0 to High(gShells) do
- if gShells[i].alive then
- with gShells[i] do
+ procedure r_Player_DrawShells;
+ var i, fX, fY: Integer; a: TDFPoint; TextureID: DWORD = DWORD(-1);
+ begin
+ if gShells <> nil then
+ begin
+ for i := 0 to High(gShells) do
+ begin
+ if gShells[i].alive and g_Obj_Collide(sX, sY, sWidth, sHeight, @gShells[i].Obj) then
begin
- if not g_Obj_Collide(sX, sY, sWidth, sHeight, @Obj) then
- Continue;
-
- Obj.lerp(gLerpFactor, fX, fY);
-
- a.X := CX;
- a.Y := CY;
-
- e_DrawAdv(SpriteID, fX, fY, 0, True, False, RAngle, @a, TMirrorType.None);
- end;
-end;
+ gShells[i].Obj.lerp(gLerpFactor, fX, fY);
+ case gShells[i].SType of
+ SHELL_BULLET:
+ begin
+ TextureID := BulletTexture;
+ a.X := 2;
+ a.Y := 1;
+ end;
+ SHELL_SHELL, SHELL_DBLSHELL:
+ begin
+ TextureID := ShellTexture;
+ a.X := 4;
+ a.Y := 2;
+ end
+ else
+ Assert(false)
+ end;
+ e_DrawAdv(TextureID, fX, fY, 0, True, False, gShells[i].RAngle, @a, TMirrorType.None);
+ end
+ end
+ end
+ end;
procedure r_Player_DrawIndicator (p: TPlayer; Color: TRGB);
var