summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: fa608ea)
raw | patch | inline | side by side (parent: fa608ea)
author | DeaDDooMER <deaddoomer@deadsoftware.ru> | |
Thu, 9 Jun 2022 14:43:29 +0000 (17:43 +0300) | ||
committer | DeaDDooMER <deaddoomer@deadsoftware.ru> | |
Fri, 9 Jun 2023 08:40:56 +0000 (11:40 +0300) |
src/game/g_shells.pas | patch | blob | history | |
src/game/renders/opengl/r_map.pas | patch | blob | history |
diff --git a/src/game/g_shells.pas b/src/game/g_shells.pas
index 1ba5fdb9d0d53130d8fad8475a1c574588d5c261..6e2e61e8f20fb689ce6daeccb7de7f5b38f16e2f 100644 (file)
--- a/src/game/g_shells.pas
+++ b/src/game/g_shells.pas
SHELL_BULLET = 0;
SHELL_SHELL = 1;
SHELL_DBLSHELL = 2;
+ SHELL_LAST = SHELL_DBLSHELL;
DefaultShellTimeout = 60000;
DefaultShellMax = 300;
index 9c25806b3dba7356d97a5d41935b733cad41595a..8c555bf57f4eb696b56508e953f65331eac99719 100644 (file)
{$IFDEF ENABLE_CORPSES}
g_corpses,
{$ENDIF}
+ {$IFDEF ENABLE_SHELLS}
+ g_shells,
+ {$ENDIF}
{$IFDEF ENABLE_GIBS}
g_gibs,
{$ENDIF}
VILEFIRE_DX = 32;
VILEFIRE_DY = 128;
+{$IFDEF ENABLE_GFX}
GFXAnim: array [0..R_GFX_LAST] of record
name: AnsiString;
w, h: Integer;
(name: 'SMOKE'; w: 32; h: 32; count: 10; back: false; speed: 3; rspeed: 0; alpha: 150), // transparent
(name: 'FLAME'; w: 32; h: 32; count: 11; back: false; speed: 3; rspeed: 2; alpha: 0) // random
);
+{$ENDIF}
ShotAnim: array [0..WEAPON_LAST] of record
name: AnsiString;
(name: 'BSKELFIRE'; w: 64; h: 64; count: 2) // 26 SKEL_FIRE
);
+{$IFDEF ENABLE_SHELLS}
+ ShellAnim: array [0..SHELL_LAST] of record
+ name: AnsiString;
+ dx, dy: Integer;
+ end = (
+ (name: 'EBULLET'; dx: 2; dy: 1), // 0 SHELL_BULLET
+ (name: 'ESHELL'; dx: 4; dy: 2), // 1 SHELL_SHELL
+ (name: 'ESHELL'; dx: 4; dy: 2) // 2 SHELL_DBLSHELL
+ );
+{$ENDIF}
+
type
TBinHeapPanelDrawCmp = class
public
StubShotAnim: TAnimState;
FlagAnim: TAnimState;
+{$IFDEF ENABLE_SHELLS}
+ ShellTextures: array [0..SHELL_LAST] of TGLTexture;
+{$ENDIF}
{$IFDEF ENABLE_GFX}
GFXTextures: array [0..R_GFX_LAST] of TGLMultiTexture;
gfxlist: array of record
FlagTextures[FLAG_RED] := r_Textures_LoadMultiFromFileAndInfo(GameWad + ':TEXTURES/FLAGRED', 64, 64, 5, false);
FlagTextures[FLAG_BLUE] := r_Textures_LoadMultiFromFileAndInfo(GameWad + ':TEXTURES/FLAGBLUE', 64, 64, 5, false);
// FlagTextures[FLAG_DOM] := r_Textures_LoadMultiFromFileAndInfo(GameWad + ':TEXTURES/FLAGDOM', 64, 64, 8, false);
+ // --------- shells --------- //
+ {$IFDEF ENABLE_SHELLS}
+ for i := 0 to SHELL_LAST do
+ ShellTextures[i] := r_Textures_LoadFromFile(GameWad + ':TEXTURES/' + ShellAnim[i].name);
+ {$ENDIF}
end;
procedure r_Map_Free;
var i, j, k, a: Integer; d: TDirection;
begin
+ {$IFDEF ENABLE_SHELLS}
+ for i := 0 to SHELL_LAST do
+ begin
+ if ShellTextures[i] <> nil then
+ ShellTextures[i].Free;
+ ShellTextures[i] := nil;
+ end;
+ {$ENDIF}
for i := 0 to FLAG_LAST do
begin
if FlagTextures[i] <> nil then
end;
end;
+{$IFDEF ENABLE_SHELLS}
+ procedure r_Map_DrawShells (x, y, w, h: Integer);
+ var i, fx, fy, typ: Integer; t: TGLTexture; p: PObj;
+ begin
+ if gShells <> nil then
+ begin
+ for i := 0 to High(gShells) do
+ begin
+ if gShells[i].alive then
+ begin
+ typ := gShells[i].SType;
+ if typ <= SHELL_LAST then
+ begin
+ p := @gShells[i].Obj;
+ if g_Obj_Collide(x, y, w, h, p) then
+ begin
+ t := ShellTextures[typ];
+ if t <> nil then
+ begin
+ p.Lerp(gLerpFactor, fx, fy);
+ r_Draw_TextureRepeatRotate(t, fx, fy, t.width, t.height, false, 255, 255, 255, 255, false, ShellAnim[typ].dx, ShellAnim[typ].dy, gShells[i].RAngle);
+ end;
+ end;
+ end;
+ end;
+ end;
+ end;
+ end;
+{$ENDIF}
+
procedure r_Map_Draw (x, y, w, h, camx, camy: Integer);
var iter: TPanelGrid.Iter; p: PPanel; cx, cy, xx, yy, ww, hh: Integer;
begin
r_Map_DrawPanelType(PANEL_STEP);
r_Map_DrawItems(xx, yy, ww, hh, false);
r_Map_DrawShots(xx, yy, ww, hh);
- // TODO draw shells
+ {$IFDEF ENABLE_SHELLS}
+ r_Map_DrawShells(xx, yy, ww, hh);
+ {$ENDIF}
r_Map_DrawPlayers(xx, yy, ww, hh);
{$IFDEF ENABLE_GIBS}
r_Map_DrawGibs(xx, yy, ww, hh);