summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: a070ca5)
raw | patch | inline | side by side (parent: a070ca5)
author | DeaDDooMER <deaddoomer@deadsoftware.ru> | |
Sat, 18 Feb 2023 15:33:55 +0000 (18:33 +0300) | ||
committer | DeaDDooMER <deaddoomer@deadsoftware.ru> | |
Fri, 9 Jun 2023 09:17:24 +0000 (12:17 +0300) |
src/game/g_console.pas | patch | blob | history | |
src/game/g_game.pas | patch | blob | history | |
src/game/renders/opengl/r_map.pas | patch | blob | history |
diff --git a/src/game/g_console.pas b/src/game/g_console.pas
index 3005340534c6eec96e5553e1d1e7eef3eb3a51e9..3b2f290f6f225808c8810b7d2e16016361dd8824 100644 (file)
--- a/src/game/g_console.pas
+++ b/src/game/g_console.pas
AddCommand('d_window', DebugCommands);
AddCommand('d_sounds', DebugCommands);
- AddCommand('d_frames', DebugCommands);
AddCommand('d_winmsg', DebugCommands);
AddCommand('d_monoff', DebugCommands);
AddCommand('d_botoff', DebugCommands);
diff --git a/src/game/g_game.pas b/src/game/g_game.pas
index ff94b2860bfff29e190216ace14f71de42feffa8..8ad28c2134bae80eb7fd3821bf20aa3841b7537e 100644 (file)
--- a/src/game/g_game.pas
+++ b/src/game/g_game.pas
gLanguageChange: Boolean = False;
gDebugMode: Boolean = False;
g_debug_Sounds: Boolean = False;
- g_debug_Frames: Boolean = False;
g_debug_WinMsgs: Boolean = False;
g_debug_MonsterOff: Boolean = False;
g_debug_BotAIOff: Byte = 0;
procedure ClearDebugCvars();
begin
g_debug_Sounds := False;
- g_debug_Frames := False;
g_debug_WinMsgs := False;
g_debug_MonsterOff := False;
g_debug_BotAIOff := 0;
g_Console_Add(Format('d_sounds is %d', [Byte(g_Debug_Sounds)]));
end
- else if cmd = 'd_frames' then
- begin
- if (Length(P) > 1) and
- ((P[1] = '1') or (P[1] = '0')) then
- g_Debug_Frames := (P[1][1] = '1');
-
- g_Console_Add(Format('d_frames is %d', [Byte(g_Debug_Frames)]));
- end
else if cmd = 'd_winmsg' then
begin
if (Length(P) > 1) and
index eff895d9b528d404a0560b035f1958efe48bf619..c2b65b01dcb39c5d2b2813505cd03aa7537f0f17 100644 (file)
TMonsterAnims = array [0..ANIM_LAST, TDirection] of TGLMultiTexture;
var
+ DebugFrames: Boolean;
DebugCameraScale: Single;
FillOutsizeArea: Boolean;
SkyTexture: TGLTexture;
r_Common_GetObjectPos(it.obj, xx, yy);
tex := t.GetTexture(Items[it.ItemType].frame);
r_Draw_TextureRepeat(tex, xx, yy, tex.width, tex.height, false, 255, 255, 255, 255, false);
+ if DebugFrames then
+ begin
+ r_Draw_Rect(
+ xx + it.obj.rect.x, // it.obj.x + it.obj.rect.x,
+ yy + it.obj.rect.y, // it.obj.y + it.obj.rect.y,
+ xx + it.obj.rect.x + it.obj.rect.width, // it.obj.x + it.obj.rect.x + it.obj.rect.width,
+ yy + it.obj.rect.y + it.obj.rect.height, // it.obj.y + it.obj.rect.y + it.obj.rect.height,
+ 0, 255, 0, 255
+ );
+ end;
end;
end;
end;
end;
- // TODO draw g_debug_frames
end;
function r_Map_GetMonsterTexture (m, a: Integer; d: TDirection; out t: TGLMultiTexture; out dx, dy: Integer; out flip: Boolean): Boolean;
a := mon.MonsterAnim;
d := mon.GameDirection;
+ r_Common_GetObjectPos(mon.obj, xx, yy);
if r_Map_GetMonsterTexture(m, a, d, t, dx, dy, flip) then
begin
- r_Common_GetObjectPos(mon.obj, xx, yy);
r_Draw_MultiTextureRepeat(t, mon.DirAnim[a, d], false, xx + dx, yy + dy, t.width, t.height, flip, 255, 255, 255, 255, false);
end;
-
- // TODO draw g_debug_frames
+ if DebugFrames then
+ begin
+ r_Draw_Rect(
+ xx + mon.obj.rect.x, // mon.obj.x + mon.obj.rect.x,
+ yy + mon.obj.rect.y, // mon.obj.y + mon.obj.rect.y,
+ xx + mon.obj.rect.x + mon.obj.rect.width, // mon.obj.x + mon.obj.rect.x + mon.obj.rect.width,
+ yy + mon.obj.rect.y + mon.obj.rect.height, // mon.obj.y + mon.obj.rect.y + mon.obj.rect.height,
+ 0, 255, 0, 255
+ );
+ end;
end;
procedure r_Map_DrawMonsters (x, y, w, h: Integer);
r_Map_DrawPlayerModel(p.Model, x, y, alpha);
end;
- // TODO draw g_debug_frames
+
+ if DebugFrames then
+ begin
+ r_Draw_Rect(
+ x + p.obj.rect.x, // p.obj.x + p.obj.rect.x,
+ y + p.obj.rect.y, // p.obj.y + p.obj.rect.y,
+ x + p.obj.rect.x + p.obj.rect.width, // p.obj.x + p.obj.rect.x + p.obj.rect.width,
+ y + p.obj.rect.y + p.obj.rect.height, // p.obj.y + p.obj.rect.y + p.obj.rect.height,
+ 0, 255, 0, 255
+ );
+ end;
if (gChatBubble > 0) and p.FKeys[KEY_CHAT].Pressed and (p.Ghost = false) then
if (p.FMegaRulez[MR_INVIS] <= gTime) or ((drawed <> nil) and ((p = drawed) or (p.Team = drawed.Team) and (gGameSettings.GameMode <> GM_DM))) then
end;
end;
end;
- // TODO draw g_debug_frames
end;
{$ENDIF}
end;
end;
end;
- // TODO draw g_debug_frames
end;
{$ENDIF}
g_Anim_GetFrameByTime(ShotAnim[typ].anim, (gTime - Shots[i].time) DIV GAME_TICK, count, frame);
tex := t.GetTexture(frame);
r_Draw_TextureRepeatRotate(tex, xx, yy, tex.width, tex.height, false, 255, 255, 255, 255, false, pX, pY, a);
+ if DebugFrames then
+ begin
+ r_Draw_Rect(
+ xx + Shots[i].obj.rect.x, // Shots[i].obj.x + Shots[i].obj.rect.x,
+ yy + Shots[i].obj.rect.y, // Shots[i].obj.y + Shots[i].obj.rect.y,
+ xx + Shots[i].obj.rect.x + Shots[i].obj.rect.width, // Shots[i].obj.x + Shots[i].obj.rect.x + Shots[i].obj.rect.width,
+ yy + Shots[i].obj.rect.y + Shots[i].obj.rect.height, // Shots[i].obj.y + Shots[i].obj.rect.y + Shots[i].obj.rect.height,
+ 0, 255, 0, 255
+ );
+ end;
end;
end;
end;
end;
- // TODO draw g_debug_frames
end;
procedure r_Map_DrawFlags (x, y, w, h: Integer);
if flip then dx := -1 else dx := +1;
t := FlagTextures[i];
tex := t.GetTexture(FlagFrame);
- r_Draw_TextureRepeat(tex, xx + dx, yy + 1, tex.width, tex.height, flip, 255, 255, 255, 255, false)
+ r_Draw_TextureRepeat(tex, xx + dx, yy + 1, tex.width, tex.height, flip, 255, 255, 255, 255, false);
+ if DebugFrames then
+ begin
+ r_Draw_Rect(
+ xx + gFlags[i].obj.rect.x, // gFlags[i].obj.x + gFlags[i].obj.rect.x,
+ yy + gFlags[i].obj.rect.y, // gFlags[i].obj.y + gFlags[i].obj.rect.y,
+ xx + gFlags[i].obj.rect.x + gFlags[i].obj.rect.width, // gFlags[i].obj.x + gFlags[i].obj.rect.x + gFlags[i].obj.rect.width,
+ yy + gFlags[i].obj.rect.y + gFlags[i].obj.rect.height, // gFlags[i].obj.y + gFlags[i].obj.rect.y + gFlags[i].obj.rect.height,
+ 0, 255, 0, 255
+ );
+ end;
end;
end;
end;
- // TODO g_debug_frames
end;
{$IFDEF ENABLE_SHELLS}
initialization
conRegVar('r_debug_camera_scale', @DebugCameraScale, 0.0001, 1000.0, '', '');
conRegVar('r_gl_fill_outside', @FillOutsizeArea, '', '');
+ conRegVar('d_frames', @DebugFrames, '', '');
DebugCameraScale := 1.0;
FillOutsizeArea := true;
+ DebugFrames := false;
end.