refactor(client): wow launch flags should have the CMDOPT type

This commit is contained in:
superp00t 2025-04-01 11:08:45 -04:00
parent 46843880ef
commit f4e9f86ca6
2 changed files with 40 additions and 44 deletions

View File

@ -1,5 +1,4 @@
#include "client/CmdLine.hpp" #include "client/CmdLine.hpp"
#include <storm/Command.hpp> #include <storm/Command.hpp>
int32_t CmdLineProcess() { int32_t CmdLineProcess() {
@ -32,23 +31,23 @@ int32_t CmdLineProcess() {
void ProcessCommandLine() { void ProcessCommandLine() {
static ARGLIST s_wowArgList[] = { static ARGLIST s_wowArgList[] = {
{ 0x0, WOWCMD_RES_800x600, "800x600", nullptr }, { 0x0, CMD_RES_800x600, "800x600", nullptr },
{ 0x0, WOWCMD_RES_1024x768, "1024x768", nullptr }, { 0x0, CMD_RES_1024x768, "1024x768", nullptr },
{ 0x0, WOWCMD_RES_1280x960, "1280x960", nullptr }, { 0x0, CMD_RES_1280x960, "1280x960", nullptr },
{ 0x0, WOWCMD_RES_1280x1024, "1280x1024", nullptr }, { 0x0, CMD_RES_1280x1024, "1280x1024", nullptr },
{ 0x0, WOWCMD_RES_1600x1200, "1600x1200", nullptr }, { 0x0, CMD_RES_1600x1200, "1600x1200", nullptr },
{ 0x0, WOWCMD_16_BIT, "16bit", nullptr }, { 0x0, CMD_16_BIT, "16bit", nullptr },
{ 0x0, WOWCMD_UP_TO_DATE, "uptodate", nullptr }, { 0x0, CMD_UP_TO_DATE, "uptodate", nullptr },
{ 0x0, WOWCMD_NO_SOUND, "nosound", nullptr }, { 0x0, CMD_NO_SOUND, "nosound", nullptr },
{ 0x0, WOWCMD_SOUND_CHAOS, "soundchaos", nullptr }, { 0x0, CMD_SOUND_CHAOS, "soundchaos", nullptr },
{ 0x0, WOWCMD_NO_FIX_LAG, "nofixlag", nullptr }, { 0x0, CMD_NO_FIX_LAG, "nofixlag", nullptr },
{ 0x0, WOWCMD_DEPTH_16, "d16", nullptr }, { 0x0, CMD_DEPTH_16, "d16", nullptr },
{ 0x0, WOWCMD_DEPTH_24, "d24", nullptr }, { 0x0, CMD_DEPTH_24, "d24", nullptr },
{ 0x0, WOWCMD_DEPTH_32, "d32", nullptr }, { 0x0, CMD_DEPTH_32, "d32", nullptr },
{ 0x0, WOWCMD_WINDOWED, "windowed", nullptr }, { 0x0, CMD_WINDOWED, "windowed", nullptr },
{ 0x0, WOWCMD_HW_DETECT, "hwdetect", nullptr }, { 0x0, CMD_HW_DETECT, "hwdetect", nullptr },
{ 0x0, WOWCMD_CONSOLE, "console", nullptr }, { 0x0, CMD_CONSOLE, "console", nullptr },
{ STORM_COMMAND_TYPE_STRING, WOWCMD_GX_OVERRIDE, "gxoverride", nullptr } { STORM_COMMAND_TYPE_STRING, CMD_GX_OVERRIDE, "gxoverride", nullptr }
}; };
// Load wow-specific launch flags // Load wow-specific launch flags
@ -57,7 +56,7 @@ void ProcessCommandLine() {
CmdLineProcess(); CmdLineProcess();
} }
const char* CmdLineGetString(uint32_t opt) { const char* CmdLineGetString(CMDOPT opt) {
static char buffer[260] = {0}; static char buffer[260] = {0};
SCmdGetString(opt, buffer, 260); SCmdGetString(opt, buffer, 260);
@ -65,10 +64,10 @@ const char* CmdLineGetString(uint32_t opt) {
return buffer; return buffer;
} }
uint32_t CmdLineGetUint(uint32_t opt) { uint32_t CmdLineGetUint(CMDOPT opt) {
return SCmdGetNum(opt); return SCmdGetNum(opt);
} }
int32_t CmdLineGetBool(uint32_t opt) { int32_t CmdLineGetBool(CMDOPT opt) {
return SCmdGetBool(opt); return SCmdGetBool(opt);
} }

View File

@ -23,35 +23,32 @@ enum CMDOPT {
CMDOPTS CMDOPTS
}; };
enum WOWCMDOPT { #define CMD_RES_800x600 static_cast<CMDOPT>(16)
WOWCMD_RES_800x600 = 16, #define CMD_RES_1024x768 static_cast<CMDOPT>(17)
WOWCMD_RES_1024x768 = 17, #define CMD_RES_1280x960 static_cast<CMDOPT>(18)
WOWCMD_RES_1280x960 = 18, #define CMD_RES_1280x1024 static_cast<CMDOPT>(19)
WOWCMD_RES_1280x1024 = 19, #define CMD_RES_1600x1200 static_cast<CMDOPT>(20)
WOWCMD_RES_1600x1200 = 20, #define CMD_UP_TO_DATE static_cast<CMDOPT>(21)
WOWCMD_UP_TO_DATE = 21, #define CMD_16_BIT static_cast<CMDOPT>(22)
WOWCMD_16_BIT = 22, #define CMD_NO_FIX_LAG static_cast<CMDOPT>(24)
WOWCMD_NO_FIX_LAG = 24, #define CMD_NO_SOUND static_cast<CMDOPT>(26)
WOWCMD_NO_SOUND = 26, #define CMD_SOUND_CHAOS static_cast<CMDOPT>(27)
WOWCMD_SOUND_CHAOS = 27, #define CMD_DEPTH_16 static_cast<CMDOPT>(29)
WOWCMD_DEPTH_16 = 29, #define CMD_DEPTH_24 static_cast<CMDOPT>(30)
WOWCMD_DEPTH_24 = 30, #define CMD_DEPTH_32 static_cast<CMDOPT>(31)
WOWCMD_DEPTH_32 = 31, #define CMD_WINDOWED static_cast<CMDOPT>(32)
WOWCMD_WINDOWED = 32, #define CMD_CONSOLE static_cast<CMDOPT>(35)
WOWCMD_CONSOLE = 35, #define CMD_HW_DETECT static_cast<CMDOPT>(36)
WOWCMD_HW_DETECT = 36, #define CMD_GX_OVERRIDE static_cast<CMDOPT>(39)
WOWCMD_GX_OVERRIDE = 39,
WOWCMD_OPTS
};
int32_t CmdLineProcess(); int32_t CmdLineProcess();
void ProcessCommandLine(); void ProcessCommandLine();
const char* CmdLineGetString(uint32_t opt); const char* CmdLineGetString(CMDOPT opt);
uint32_t CmdLineGetUint(uint32_t opt); uint32_t CmdLineGetUint(CMDOPT opt);
int32_t CmdLineGetBool(uint32_t opt); int32_t CmdLineGetBool(CMDOPT opt);
#endif #endif