diff --git a/src/game/g_game.pas b/src/game/g_game.pas
index 2a52eccfb90dd8b19c144ee23530224f9684315a..e4f7afea5da959741fbb7a5b0af47bfaaf2a99b1 100644 (file)
--- a/src/game/g_game.pas
+++ b/src/game/g_game.pas
g_playermodel, g_gfx, g_options, g_weapons, Math,
g_triggers, MAPDEF, g_monsters, e_sound, CONFIG,
BinEditor, g_language, g_net, SDL,
- ENet, e_fixedbuffer, g_netmsg, g_netmaster, GL, GLExt,
+ ENet, e_msg, g_netmsg, g_netmaster, GL, GLExt,
utils, sfs;
w: Word;
i, b: Integer;
- function sendMonsPos (monidx: Integer; mon: TMonster): Boolean;
+ function sendMonsPos (mon: TMonster): Boolean;
begin
result := false; // don't stop
if (mon.MonsterType = MONSTER_BARREL) then
var
a, aX, aY, aX2, aY2, Scale, ScaleSz: Integer;
- function monDraw (monidx: Integer; mon: TMonster): Boolean;
+ function monDraw (mon: TMonster): Boolean;
begin
result := false; // don't stop
with mon do
State: Byte;
OuterLoop: Boolean;
newResPath: string;
+ InMsg: TMsg;
begin
g_Game_Free();
if (NetEvent.kind = ENET_EVENT_TYPE_RECEIVE) then
begin
Ptr := NetEvent.packet^.data;
- e_Raw_Seek(0);
+ if not InMsg.Init(Ptr, NetEvent.packet^.dataLength, True) then
+ continue;
- MID := e_Raw_Read_Byte(Ptr);
+ MID := InMsg.ReadByte();
if (MID = NET_MSG_INFO) and (State = 0) then
begin
- NetMyID := e_Raw_Read_Byte(Ptr);
- NetPlrUID1 := e_Raw_Read_Word(Ptr);
+ NetMyID := InMsg.ReadByte();
+ NetPlrUID1 := InMsg.ReadWord();
- WadName := e_Raw_Read_String(Ptr);
- Map := e_Raw_Read_String(Ptr);
+ WadName := InMsg.ReadString();
+ Map := InMsg.ReadString();
- gWADHash := e_Raw_Read_MD5(Ptr);
+ gWADHash := InMsg.ReadMD5();
- gGameSettings.GameMode := e_Raw_Read_Byte(Ptr);
+ gGameSettings.GameMode := InMsg.ReadByte();
gSwitchGameMode := gGameSettings.GameMode;
- gGameSettings.GoalLimit := e_Raw_Read_Word(Ptr);
- gGameSettings.TimeLimit := e_Raw_Read_Word(Ptr);
- gGameSettings.MaxLives := e_Raw_Read_Byte(Ptr);
- gGameSettings.Options := e_Raw_Read_LongWord(Ptr);
- T := e_Raw_Read_LongWord(Ptr);
+ gGameSettings.GoalLimit := InMsg.ReadWord();
+ gGameSettings.TimeLimit := InMsg.ReadWord();
+ gGameSettings.MaxLives := InMsg.ReadByte();
+ gGameSettings.Options := InMsg.ReadLongWord();
+ T := InMsg.ReadLongWord();
newResPath := g_Res_SearchSameWAD(MapsDir, WadName, gWADHash);
if newResPath = '' then
var
i, n, nb, nr: Integer;
- function monRespawn (monidx: Integer; mon: TMonster): Boolean;
+ function monRespawn (mon: TMonster): Boolean;
begin
result := false; // don't stop
if not mon.FNoRespawn then mon.Respawn();
exit;
end;
- if cmd = 'dbg_sq_coldet' then
+ if cmd = 'cd_sq_enabled' then
begin
case getBool(1) of
-1: begin end;
exit;
end;
+ {
if (cmd = 'sq_use_grid') or (cmd = 'sq_use_tree') then
begin
gdbg_map_use_tree_coldet := (cmd = 'sq_use_tree');
if gdbg_map_use_tree_draw then g_Console_Add('render acceleration: tree') else g_Console_Add('render acceleration: grid');
exit;
end;
+ }
+ {
if (cmd = 't_dump_node_queries') then
begin
case getBool(1) of
if gdbg_map_dump_coldet_tree_queries then g_Console_Add('grid coldet tree queries: tan') else g_Console_Add('grid coldet tree queries: ona');
exit;
end;
+ }
+
+ if (cmd = 'mon_sq_enabled') then
+ begin
+ case getBool(1) of
+ -1: begin end;
+ 0: gmon_debug_use_sqaccel := false;
+ 1: gmon_debug_use_sqaccel := true;
+ end;
+ if gmon_debug_use_sqaccel then g_Console_Add('accelerated monster coldet: tan') else g_Console_Add('accelerated monster coldet: ona');
+ exit;
+ end;
+
+ if (cmd = 'wtrace_sq_enabled') then
+ begin
+ case getBool(1) of
+ -1: begin end;
+ 0: gwep_debug_fast_trace := false;
+ 1: gwep_debug_fast_trace := true;
+ end;
+ if gwep_debug_fast_trace then g_Console_Add('accelerated weapon hitscan: tan') else g_Console_Add('accelerated weapon hitscan: ona');
+ exit;
+ end;
end;
procedure DebugCommands(P: SArray);