This commit is contained in:
quaK 2023-02-13 15:44:16 +02:00
parent b2acb99381
commit 816f46febd
5 changed files with 100 additions and 3 deletions

View File

@ -32,6 +32,7 @@ namespace thread_names
{game::THREAD_CONTEXT_DATABASE, "Database"}, {game::THREAD_CONTEXT_DATABASE, "Database"},
{game::THREAD_CONTEXT_SOUND_STREAM, "Sound Stream"}, {game::THREAD_CONTEXT_SOUND_STREAM, "Sound Stream"},
{game::THREAD_CONTEXT_SOUND, "Snd stream packet callback"}, {game::THREAD_CONTEXT_SOUND, "Snd stream packet callback"},
{game::THREAD_CONTEXT_SOUND_DECODE, "Sound Decoder"},
{game::THREAD_CONTEXT_RECIPE, "Recipe"}, {game::THREAD_CONTEXT_RECIPE, "Recipe"},
}; };

View File

@ -42,6 +42,24 @@ namespace game
return sv_cmd_args->argv[sv_cmd_args->nesting][index]; return sv_cmd_args->argv[sv_cmd_args->nesting][index];
} }
const char* G_GAME_MODE_STRINGS[] =
{
"none",
"sp",
"mp",
"cp",
};
const char* Com_GameMode_GetActiveGameModeStr()
{
return G_GAME_MODE_STRINGS[game::Com_GameMode_GetActiveGameMode()];
}
const char* Com_GameMode_GetGameModeStr(GameModeType gameMode)
{
return G_GAME_MODE_STRINGS[gameMode];
}
bool CL_IsGameClientActive(const int localClientNum) bool CL_IsGameClientActive(const int localClientNum)
{ {
if (game::clientUIActives[localClientNum].frontEndSceneState[0]) if (game::clientUIActives[localClientNum].frontEndSceneState[0])

View File

@ -48,6 +48,9 @@ namespace game
int SV_Cmd_Argc(); int SV_Cmd_Argc();
const char* SV_Cmd_Argv(int index); const char* SV_Cmd_Argv(int index);
const char* Com_GameMode_GetActiveGameModeStr();
const char* Com_GameMode_GetGameModeStr(GameModeType gameMode);
bool CL_IsGameClientActive(const int localClientNum); bool CL_IsGameClientActive(const int localClientNum);
extern const char* g_assetNames[ASSET_TYPE_COUNT]; extern const char* g_assetNames[ASSET_TYPE_COUNT];

View File

@ -431,7 +431,7 @@ namespace game
THREAD_CONTEXT_DATABASE = 14, THREAD_CONTEXT_DATABASE = 14,
THREAD_CONTEXT_SOUND_STREAM = 15, THREAD_CONTEXT_SOUND_STREAM = 15,
THREAD_CONTEXT_SOUND = 16, THREAD_CONTEXT_SOUND = 16,
THREAD_CONTEXT_UNKNOWN17 = 17, THREAD_CONTEXT_SOUND_DECODE = 17,
THREAD_CONTEXT_UNKNOWN18 = 18, THREAD_CONTEXT_UNKNOWN18 = 18,
THREAD_CONTEXT_UNKNOWN19 = 19, THREAD_CONTEXT_UNKNOWN19 = 19,
THREAD_CONTEXT_RECIPE = 20, THREAD_CONTEXT_RECIPE = 20,
@ -2061,14 +2061,89 @@ namespace game
char __pad0[176]; char __pad0[176];
}; static_assert(sizeof(SndGlobals) == 0xD0); }; static_assert(sizeof(SndGlobals) == 0xD0);
struct SndAlias
{
const char* aliasName;
char __pad0[192];
}; static_assert(sizeof(SndAlias) == 200);
struct SndAliasList
{
const char* aliasName;
unsigned int id;
SndAlias* head;
int count;
int sequence;
}; static_assert(sizeof(SndAliasList) == 32);
static_assert(offsetof(SndAliasList, head) == 16);
static_assert(offsetof(SndAliasList, count) == 24);
struct SndIndexEntry
{
unsigned short value;
unsigned short next;
}; static_assert(sizeof(SndIndexEntry) == 4);
struct SndSendEffectParams
{
char __pad0[136];
}; static_assert(sizeof(SndSendEffectParams) == 136);
struct SoundTable
{
char __pad0[248];
}; static_assert(sizeof(SoundTable) == 248);
struct SndDuck
{
char __pad0[144];
}; static_assert(sizeof(SndDuck) == 144);
struct SndMusicState
{
char __pad0[384];
}; static_assert(sizeof(SndMusicState) == 384);
struct SndMusicSet
{
char name[64];
unsigned int id;
unsigned int stateCount;
SndMusicState* states;
}; static_assert(sizeof(SndMusicSet) == 80);
static_assert(offsetof(SndMusicSet, stateCount) == 68);
static_assert(offsetof(SndMusicSet, states) == 72);
struct SndBank struct SndBank
{ {
const char* name; const char* name;
const char* zone; const char* zone;
const char* gameLanguage; const char* gameLanguage;
const char* soundLanguage; const char* soundLanguage;
char __pad0[320]; unsigned int aliasCount;
SndAliasList* alias;
SndIndexEntry* aliasIndex;
unsigned int sendEffectCount;
SndSendEffectParams* sendEffects;
SoundTable soundTable;
unsigned int duckCount;
SndDuck* ducks;
unsigned int musicSetCount;
SndMusicSet* musicSets;
}; };
static_assert(offsetof(SndBank, name) == 0);
static_assert(offsetof(SndBank, zone) == 8);
static_assert(offsetof(SndBank, gameLanguage) == 16);
static_assert(offsetof(SndBank, soundLanguage) == 24);
static_assert(offsetof(SndBank, aliasCount) == 32);
static_assert(offsetof(SndBank, aliasIndex) == 48);
static_assert(offsetof(SndBank, sendEffectCount) == 56);
static_assert(offsetof(SndBank, sendEffects) == 64);
static_assert(offsetof(SndBank, soundTable) == 72);
static_assert(offsetof(SndBank, duckCount) == 320);
static_assert(offsetof(SndBank, ducks) == 328);
static_assert(offsetof(SndBank, musicSetCount) == 336);
static_assert(offsetof(SndBank, musicSets) == 344);
struct SndBankResident struct SndBankResident
{ {

View File

@ -3,7 +3,7 @@
void component_loader::register_component(std::unique_ptr<component_interface>&& component_, [[maybe_unused]] const std::string& name) void component_loader::register_component(std::unique_ptr<component_interface>&& component_, [[maybe_unused]] const std::string& name)
{ {
#ifdef DEBUG #ifdef DEV_BUILD
printf("registering component: %s\n", name.data()); printf("registering component: %s\n", name.data());
#endif #endif