summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 0a01542)
raw | patch | inline | side by side (parent: 0a01542)
author | DeaDDooMER <deaddoomer@deadsoftware.ru> | |
Thu, 9 Jun 2022 20:12:05 +0000 (23:12 +0300) | ||
committer | DeaDDooMER <deaddoomer@deadsoftware.ru> | |
Fri, 9 Jun 2023 08:41:44 +0000 (11:41 +0300) |
src/game/renders/opengl/r_map.pas | patch | blob | history | |
src/game/renders/opengl/r_render.pas | patch | blob | history |
index 9a984283979f63d9676da548bc34d8bffe020035..a87abcf15e742582596d3b388efd7ac04f5d8b7e 100644 (file)
interface
- uses g_base; // TRectWH
+ uses g_base, g_player; // TRectWH, TPlayer
procedure r_Map_Initialize;
procedure r_Map_Finalize;
procedure r_Map_Update;
- procedure r_Map_Draw (x, y, w, h, camx, camy: Integer);
+ procedure r_Map_Draw (x, y, w, h, camx, camy: Integer; player: TPlayer);
implementation
e_log,
binheap, MAPDEF, utils,
g_options, g_textures, g_basic, g_phys,
- g_game, g_map, g_panel, g_items, g_monsters, g_playermodel, g_player, g_weapons,
+ g_game, g_map, g_panel, g_items, g_monsters, g_playermodel, g_weapons,
{$IFDEF ENABLE_CORPSES}
g_corpses,
{$ENDIF}
FlagTextures: array [0..FLAG_LAST] of TGLMultiTexture;
PunchTextures: array [Boolean, 0..2] of TGLMultiTexture; // [berserk, center/up/down]
VileFire: TGLMultiTexture;
+ InvulPenta: TGLTexture;
Models: array of record
anim: array [TDirection, 0..A_LAST] of record
base, mask: TGLMultiTexture;
// ok
end;
end;
- for a := 0 to m.GibsCount - 1 do
- e_logwritefln('model %s gib %s: %sx%s:%sx%s', [i, a, Models[i].gibs.rect[a].x, Models[i].gibs.rect[a].y, Models[i].gibs.rect[a].width, Models[i].gibs.rect[a].height]);
end;
{$ENDIF}
end;
for i := 0 to 2 do
PunchTextures[b, i] := r_Textures_LoadMultiFromFileAndInfo(GameWad + ':WEAPONS/' + PunchName[b] + WeapPos[i], 64, 64, 4, false);
end;
+ // --------- other --------- //
+ InvulPenta := r_Textures_LoadFromFile(GameWad + ':TEXTURES/PENTA');
end;
procedure r_Map_Free;
var i, j, k: Integer; d: TDirection; b: Boolean;
begin
+ if InvulPenta <> nil then
+ InvulPenta.Free;
+ InvulPenta := nil;
for b := false to true do
begin
for i := 0 to 2 do
end;
end;
- procedure r_Map_DrawPlayer (p: TPlayer);
- var fX, fY, fSlope, ax, ay: Integer; b, flip: Boolean; t: TGLMultiTexture;
+ procedure r_Map_DrawPlayer (p, drawed: TPlayer);
+ var fX, fY, fSlope, ax, ay, w, h: Integer; b, flip: Boolean; t: TGLMultiTexture;
begin
if p.alive then
begin
r_Draw_MultiTextureRepeat(t, p.PunchAnim, fx + ax, fy + fSlope + ay, t.width, t.height, flip, 255, 255, 255, 255, false)
end;
end;
- // TODO invul pentagram
+ if (InvulPenta <> nil) and (p.FMegaRulez[MR_INVUL] > gTime) and ((p <> drawed) or (p.SpawnInvul >= gTime)) then
+ begin
+ w := InvulPenta.width;
+ h := InvulPenta.height;
+ ax := p.Obj.Rect.X + (p.Obj.Rect.Width div 2) - (w div 2); // + IfThen(flip, +4, -2) // ???
+ ay := p.Obj.Rect.Y + (p.Obj.Rect.Height div 2) - (h div 2) - 7; // ???
+ r_Draw_Texture(InvulPenta, fx + ax, fy + ay + fSlope, w, h, false, 255, 255, 255, 255, false);
+ end;
// TODO draw it with transparency
r_Map_DrawPlayerModel(p.Model, fX, fY + fSlope);
end;
// TODO draw aim
end;
- procedure r_Map_DrawPlayers (x, y, w, h: Integer);
+ procedure r_Map_DrawPlayers (x, y, w, h: Integer; player: TPlayer);
var i: Integer;
begin
if gPlayers <> nil then
for i := 0 to High(gPlayers) do
if gPlayers[i] <> nil then
- r_Map_DrawPlayer(gPlayers[i]);
+ r_Map_DrawPlayer(gPlayers[i], player);
end;
{$IFDEF ENABLE_GIBS}
end;
{$ENDIF}
- procedure r_Map_Draw (x, y, w, h, camx, camy: Integer);
+ procedure r_Map_Draw (x, y, w, h, camx, camy: Integer; player: TPlayer);
var iter: TPanelGrid.Iter; p: PPanel; cx, cy, xx, yy, ww, hh: Integer;
begin
cx := camx - w div 2;
{$IFDEF ENABLE_SHELLS}
r_Map_DrawShells(xx, yy, ww, hh);
{$ENDIF}
- r_Map_DrawPlayers(xx, yy, ww, hh);
+ r_Map_DrawPlayers(xx, yy, ww, hh, player);
{$IFDEF ENABLE_GIBS}
r_Map_DrawGibs(xx, yy, ww, hh);
{$ENDIF}
index c5b2c30497fe751895fbbc245c6f257fadc90a5d..2a385a15b4724838172a520fb0d2bf0ed2214b13 100644 (file)
// TODO setup player view siz
// TODO draw player view + setup screen coords
- r_Map_Draw(0, 0, gScreenWidth, gScreenHeight, gPlayer1.obj.x + 32, gPlayer1.obj.y + 32); // !!! remove unnamed consts
+ r_Map_Draw(0, 0, gScreenWidth, gScreenHeight, gPlayer1.obj.x + 32, gPlayer1.obj.y + 32, gPlayer1); // !!! remove unnamed consts
// TODO draw holmes inspector