From e1374aa6af5136df980925ce752e5f5132526964 Mon Sep 17 00:00:00 2001 From: wootguy Date: Tue, 19 Nov 2024 02:19:55 -0800 Subject: [PATCH] organize move util and game code to subfolders --- CMakeLists.txt | 2 + dlls/CMakeLists.txt | 98 ++++++++++++------------ dlls/{ => game}/game.cpp | 12 ++- dlls/{ => game}/game.h | 0 dlls/{ => game}/gamerules.cpp | 0 dlls/{ => game}/gamerules.h | 0 dlls/{ => game}/globals.cpp | 0 dlls/{ => game}/multiplay_gamerules.cpp | 0 dlls/{ => game}/singleplay_gamerules.cpp | 0 dlls/{ => game}/skill.cpp | 0 dlls/{ => game}/skill.h | 0 dlls/{ => game}/teamplay_gamerules.cpp | 0 dlls/{ => game}/teamplay_gamerules.h | 0 dlls/{ => game}/user_messages.cpp | 0 dlls/{ => game}/user_messages.h | 0 dlls/{ => util}/Bsp.cpp | 0 dlls/{ => util}/Bsp.h | 0 dlls/{ => util}/CommandArgs.cpp | 0 dlls/{ => util}/CommandArgs.h | 0 dlls/{ => util}/Scheduler.cpp | 0 dlls/{ => util}/Scheduler.h | 0 dlls/{ => util}/TextMenu.cpp | 0 dlls/{ => util}/TextMenu.h | 0 dlls/{ => util}/ThreadSafeInt.cpp | 0 dlls/{ => util}/ThreadSafeInt.h | 0 dlls/{ => util}/ThreadSafeQueue.cpp | 0 dlls/{ => util}/ThreadSafeQueue.h | 0 dlls/{ => util}/animation.cpp | 0 dlls/{ => util}/animation.h | 0 dlls/{ => util}/bsplimits.h | 0 dlls/{ => util}/bsptypes.cpp | 0 dlls/{ => util}/bsptypes.h | 0 dlls/{ => util}/debug.cpp | 0 dlls/{ => util}/debug.h | 0 dlls/{ => util}/eng_wrappers.cpp | 0 dlls/{ => util}/eng_wrappers.h | 0 dlls/{ => util}/lagcomp.cpp | 0 dlls/{ => util}/lagcomp.h | 0 dlls/{ => util}/mstream.cpp | 0 dlls/{ => util}/mstream.h | 0 dlls/{ => util}/plane.cpp | 0 dlls/{ => util}/plane.h | 0 dlls/{ => util}/saverestore.cpp | 0 dlls/{ => util}/saverestore.h | 0 dlls/{ => util}/sound.cpp | 0 dlls/{ => util}/subs.cpp | 0 dlls/{ => util}/util.cpp | 0 dlls/{ => util}/util.h | 0 dlls/{ => util}/vector.h | 0 dlls/{ => util}/wav.cpp | 0 dlls/{ => util}/wav.h | 0 51 files changed, 62 insertions(+), 50 deletions(-) rename dlls/{ => game}/game.cpp (98%) rename dlls/{ => game}/game.h (100%) rename dlls/{ => game}/gamerules.cpp (100%) rename dlls/{ => game}/gamerules.h (100%) rename dlls/{ => game}/globals.cpp (100%) rename dlls/{ => game}/multiplay_gamerules.cpp (100%) rename dlls/{ => game}/singleplay_gamerules.cpp (100%) rename dlls/{ => game}/skill.cpp (100%) rename dlls/{ => game}/skill.h (100%) rename dlls/{ => game}/teamplay_gamerules.cpp (100%) rename dlls/{ => game}/teamplay_gamerules.h (100%) rename dlls/{ => game}/user_messages.cpp (100%) rename dlls/{ => game}/user_messages.h (100%) rename dlls/{ => util}/Bsp.cpp (100%) rename dlls/{ => util}/Bsp.h (100%) rename dlls/{ => util}/CommandArgs.cpp (100%) rename dlls/{ => util}/CommandArgs.h (100%) rename dlls/{ => util}/Scheduler.cpp (100%) rename dlls/{ => util}/Scheduler.h (100%) rename dlls/{ => util}/TextMenu.cpp (100%) rename dlls/{ => util}/TextMenu.h (100%) rename dlls/{ => util}/ThreadSafeInt.cpp (100%) rename dlls/{ => util}/ThreadSafeInt.h (100%) rename dlls/{ => util}/ThreadSafeQueue.cpp (100%) rename dlls/{ => util}/ThreadSafeQueue.h (100%) rename dlls/{ => util}/animation.cpp (100%) rename dlls/{ => util}/animation.h (100%) rename dlls/{ => util}/bsplimits.h (100%) rename dlls/{ => util}/bsptypes.cpp (100%) rename dlls/{ => util}/bsptypes.h (100%) rename dlls/{ => util}/debug.cpp (100%) rename dlls/{ => util}/debug.h (100%) rename dlls/{ => util}/eng_wrappers.cpp (100%) rename dlls/{ => util}/eng_wrappers.h (100%) rename dlls/{ => util}/lagcomp.cpp (100%) rename dlls/{ => util}/lagcomp.h (100%) rename dlls/{ => util}/mstream.cpp (100%) rename dlls/{ => util}/mstream.h (100%) rename dlls/{ => util}/plane.cpp (100%) rename dlls/{ => util}/plane.h (100%) rename dlls/{ => util}/saverestore.cpp (100%) rename dlls/{ => util}/saverestore.h (100%) rename dlls/{ => util}/sound.cpp (100%) rename dlls/{ => util}/subs.cpp (100%) rename dlls/{ => util}/util.cpp (100%) rename dlls/{ => util}/util.h (100%) rename dlls/{ => util}/vector.h (100%) rename dlls/{ => util}/wav.cpp (100%) rename dlls/{ => util}/wav.h (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt index d88e9535..4441a45c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -31,6 +31,8 @@ include_directories(${CMAKE_SOURCE_DIR}/dlls/path) include_directories(${CMAKE_SOURCE_DIR}/dlls/weapon) include_directories(${CMAKE_SOURCE_DIR}/dlls/net) include_directories(${CMAKE_SOURCE_DIR}/dlls/hooks) +include_directories(${CMAKE_SOURCE_DIR}/dlls/util) +include_directories(${CMAKE_SOURCE_DIR}/dlls/game) include_directories(${CMAKE_SOURCE_DIR}/dlls/) include_directories(${CMAKE_SOURCE_DIR}/rehlds) diff --git a/dlls/CMakeLists.txt b/dlls/CMakeLists.txt index b55d7a22..a8e44940 100644 --- a/dlls/CMakeLists.txt +++ b/dlls/CMakeLists.txt @@ -406,45 +406,45 @@ set(AMMO_SRC ) set(UTIL_HDR - animation.h - Bsp.h - bsptypes.h - bsplimits.h - CommandArgs.h - debug.h - eng_wrappers.h - plane.h - saverestore.h - util.h - mstream.h - lagcomp.h - vector.h - Scheduler.h - TextMenu.h - ThreadSafeInt.h - ThreadSafeQueue.h - wav.h + util/animation.h + util/Bsp.h + util/bsptypes.h + util/bsplimits.h + util/CommandArgs.h + util/debug.h + util/eng_wrappers.h + util/plane.h + util/saverestore.h + util/util.h + util/mstream.h + util/lagcomp.h + util/vector.h + util/Scheduler.h + util/TextMenu.h + util/ThreadSafeInt.h + util/ThreadSafeQueue.h + util/wav.h ../game_shared/shared_util.h ) set(UTIL_SRC - animation.cpp - Bsp.cpp - bsptypes.cpp - CommandArgs.cpp - debug.cpp - eng_wrappers.cpp - plane.cpp - sound.cpp - util.cpp - mstream.cpp - lagcomp.cpp - saverestore.cpp - Scheduler.cpp - subs.cpp - TextMenu.cpp - ThreadSafeInt.cpp - ThreadSafeQueue.cpp - wav.cpp + util/animation.cpp + util/Bsp.cpp + util/bsptypes.cpp + util/CommandArgs.cpp + util/debug.cpp + util/eng_wrappers.cpp + util/plane.cpp + util/sound.cpp + util/util.cpp + util/mstream.cpp + util/lagcomp.cpp + util/saverestore.cpp + util/Scheduler.cpp + util/subs.cpp + util/TextMenu.cpp + util/ThreadSafeInt.cpp + util/ThreadSafeQueue.cpp + util/wav.cpp ../game_shared/shared_util.cpp ) set(PLAYER_HDR @@ -500,22 +500,22 @@ else() endif() set(GAME_HDR - game.h - gamerules.h - skill.h - teamplay_gamerules.h - user_messages.h + game/game.h + game/gamerules.h + game/skill.h + game/teamplay_gamerules.h + game/user_messages.h ) set(GAME_SRC - game.cpp - gamerules.cpp - globals.cpp - multiplay_gamerules.cpp - singleplay_gamerules.cpp - skill.cpp - teamplay_gamerules.cpp + game/game.cpp + game/gamerules.cpp + game/globals.cpp + game/multiplay_gamerules.cpp + game/singleplay_gamerules.cpp + game/skill.cpp + game/teamplay_gamerules.cpp ../game_shared/voice_gamemgr.cpp - user_messages.cpp + game/user_messages.cpp ) set(ALL_TRIGGER_MISC_SRC ${TRIGGER_SRC} ${TRIGGER_OBSOLETE_SRC}) diff --git a/dlls/game.cpp b/dlls/game/game.cpp similarity index 98% rename from dlls/game.cpp rename to dlls/game/game.cpp index 8f352778..5c7b3bd2 100644 --- a/dlls/game.cpp +++ b/dlls/game/game.cpp @@ -21,6 +21,7 @@ #include "CBaseMonster.h" #include "skill.h" #include "PluginManager.h" +#include "user_messages.h" cvar_t displaysoundlist = {"displaysoundlist","0", 0, 0, 0}; @@ -269,7 +270,16 @@ void freespace_command() { } void test_command() { - + int id = GetUserMsgInfo("VoiceMask", NULL); + + MESSAGE_BEGIN(MSG_ALL, id); + int dw; + for (dw = 0; dw < VOICE_MAX_PLAYERS_DW; dw++) + { + WRITE_LONG(0); + WRITE_LONG(0); + } + MESSAGE_END(); } void cfg_exec_finished() { diff --git a/dlls/game.h b/dlls/game/game.h similarity index 100% rename from dlls/game.h rename to dlls/game/game.h diff --git a/dlls/gamerules.cpp b/dlls/game/gamerules.cpp similarity index 100% rename from dlls/gamerules.cpp rename to dlls/game/gamerules.cpp diff --git a/dlls/gamerules.h b/dlls/game/gamerules.h similarity index 100% rename from dlls/gamerules.h rename to dlls/game/gamerules.h diff --git a/dlls/globals.cpp b/dlls/game/globals.cpp similarity index 100% rename from dlls/globals.cpp rename to dlls/game/globals.cpp diff --git a/dlls/multiplay_gamerules.cpp b/dlls/game/multiplay_gamerules.cpp similarity index 100% rename from dlls/multiplay_gamerules.cpp rename to dlls/game/multiplay_gamerules.cpp diff --git a/dlls/singleplay_gamerules.cpp b/dlls/game/singleplay_gamerules.cpp similarity index 100% rename from dlls/singleplay_gamerules.cpp rename to dlls/game/singleplay_gamerules.cpp diff --git a/dlls/skill.cpp b/dlls/game/skill.cpp similarity index 100% rename from dlls/skill.cpp rename to dlls/game/skill.cpp diff --git a/dlls/skill.h b/dlls/game/skill.h similarity index 100% rename from dlls/skill.h rename to dlls/game/skill.h diff --git a/dlls/teamplay_gamerules.cpp b/dlls/game/teamplay_gamerules.cpp similarity index 100% rename from dlls/teamplay_gamerules.cpp rename to dlls/game/teamplay_gamerules.cpp diff --git a/dlls/teamplay_gamerules.h b/dlls/game/teamplay_gamerules.h similarity index 100% rename from dlls/teamplay_gamerules.h rename to dlls/game/teamplay_gamerules.h diff --git a/dlls/user_messages.cpp b/dlls/game/user_messages.cpp similarity index 100% rename from dlls/user_messages.cpp rename to dlls/game/user_messages.cpp diff --git a/dlls/user_messages.h b/dlls/game/user_messages.h similarity index 100% rename from dlls/user_messages.h rename to dlls/game/user_messages.h diff --git a/dlls/Bsp.cpp b/dlls/util/Bsp.cpp similarity index 100% rename from dlls/Bsp.cpp rename to dlls/util/Bsp.cpp diff --git a/dlls/Bsp.h b/dlls/util/Bsp.h similarity index 100% rename from dlls/Bsp.h rename to dlls/util/Bsp.h diff --git a/dlls/CommandArgs.cpp b/dlls/util/CommandArgs.cpp similarity index 100% rename from dlls/CommandArgs.cpp rename to dlls/util/CommandArgs.cpp diff --git a/dlls/CommandArgs.h b/dlls/util/CommandArgs.h similarity index 100% rename from dlls/CommandArgs.h rename to dlls/util/CommandArgs.h diff --git a/dlls/Scheduler.cpp b/dlls/util/Scheduler.cpp similarity index 100% rename from dlls/Scheduler.cpp rename to dlls/util/Scheduler.cpp diff --git a/dlls/Scheduler.h b/dlls/util/Scheduler.h similarity index 100% rename from dlls/Scheduler.h rename to dlls/util/Scheduler.h diff --git a/dlls/TextMenu.cpp b/dlls/util/TextMenu.cpp similarity index 100% rename from dlls/TextMenu.cpp rename to dlls/util/TextMenu.cpp diff --git a/dlls/TextMenu.h b/dlls/util/TextMenu.h similarity index 100% rename from dlls/TextMenu.h rename to dlls/util/TextMenu.h diff --git a/dlls/ThreadSafeInt.cpp b/dlls/util/ThreadSafeInt.cpp similarity index 100% rename from dlls/ThreadSafeInt.cpp rename to dlls/util/ThreadSafeInt.cpp diff --git a/dlls/ThreadSafeInt.h b/dlls/util/ThreadSafeInt.h similarity index 100% rename from dlls/ThreadSafeInt.h rename to dlls/util/ThreadSafeInt.h diff --git a/dlls/ThreadSafeQueue.cpp b/dlls/util/ThreadSafeQueue.cpp similarity index 100% rename from dlls/ThreadSafeQueue.cpp rename to dlls/util/ThreadSafeQueue.cpp diff --git a/dlls/ThreadSafeQueue.h b/dlls/util/ThreadSafeQueue.h similarity index 100% rename from dlls/ThreadSafeQueue.h rename to dlls/util/ThreadSafeQueue.h diff --git a/dlls/animation.cpp b/dlls/util/animation.cpp similarity index 100% rename from dlls/animation.cpp rename to dlls/util/animation.cpp diff --git a/dlls/animation.h b/dlls/util/animation.h similarity index 100% rename from dlls/animation.h rename to dlls/util/animation.h diff --git a/dlls/bsplimits.h b/dlls/util/bsplimits.h similarity index 100% rename from dlls/bsplimits.h rename to dlls/util/bsplimits.h diff --git a/dlls/bsptypes.cpp b/dlls/util/bsptypes.cpp similarity index 100% rename from dlls/bsptypes.cpp rename to dlls/util/bsptypes.cpp diff --git a/dlls/bsptypes.h b/dlls/util/bsptypes.h similarity index 100% rename from dlls/bsptypes.h rename to dlls/util/bsptypes.h diff --git a/dlls/debug.cpp b/dlls/util/debug.cpp similarity index 100% rename from dlls/debug.cpp rename to dlls/util/debug.cpp diff --git a/dlls/debug.h b/dlls/util/debug.h similarity index 100% rename from dlls/debug.h rename to dlls/util/debug.h diff --git a/dlls/eng_wrappers.cpp b/dlls/util/eng_wrappers.cpp similarity index 100% rename from dlls/eng_wrappers.cpp rename to dlls/util/eng_wrappers.cpp diff --git a/dlls/eng_wrappers.h b/dlls/util/eng_wrappers.h similarity index 100% rename from dlls/eng_wrappers.h rename to dlls/util/eng_wrappers.h diff --git a/dlls/lagcomp.cpp b/dlls/util/lagcomp.cpp similarity index 100% rename from dlls/lagcomp.cpp rename to dlls/util/lagcomp.cpp diff --git a/dlls/lagcomp.h b/dlls/util/lagcomp.h similarity index 100% rename from dlls/lagcomp.h rename to dlls/util/lagcomp.h diff --git a/dlls/mstream.cpp b/dlls/util/mstream.cpp similarity index 100% rename from dlls/mstream.cpp rename to dlls/util/mstream.cpp diff --git a/dlls/mstream.h b/dlls/util/mstream.h similarity index 100% rename from dlls/mstream.h rename to dlls/util/mstream.h diff --git a/dlls/plane.cpp b/dlls/util/plane.cpp similarity index 100% rename from dlls/plane.cpp rename to dlls/util/plane.cpp diff --git a/dlls/plane.h b/dlls/util/plane.h similarity index 100% rename from dlls/plane.h rename to dlls/util/plane.h diff --git a/dlls/saverestore.cpp b/dlls/util/saverestore.cpp similarity index 100% rename from dlls/saverestore.cpp rename to dlls/util/saverestore.cpp diff --git a/dlls/saverestore.h b/dlls/util/saverestore.h similarity index 100% rename from dlls/saverestore.h rename to dlls/util/saverestore.h diff --git a/dlls/sound.cpp b/dlls/util/sound.cpp similarity index 100% rename from dlls/sound.cpp rename to dlls/util/sound.cpp diff --git a/dlls/subs.cpp b/dlls/util/subs.cpp similarity index 100% rename from dlls/subs.cpp rename to dlls/util/subs.cpp diff --git a/dlls/util.cpp b/dlls/util/util.cpp similarity index 100% rename from dlls/util.cpp rename to dlls/util/util.cpp diff --git a/dlls/util.h b/dlls/util/util.h similarity index 100% rename from dlls/util.h rename to dlls/util/util.h diff --git a/dlls/vector.h b/dlls/util/vector.h similarity index 100% rename from dlls/vector.h rename to dlls/util/vector.h diff --git a/dlls/wav.cpp b/dlls/util/wav.cpp similarity index 100% rename from dlls/wav.cpp rename to dlls/util/wav.cpp diff --git a/dlls/wav.h b/dlls/util/wav.h similarity index 100% rename from dlls/wav.h rename to dlls/util/wav.h