diff --git a/source/common/gamecontrol.cpp b/source/common/gamecontrol.cpp index 2fabae2d1..56e5d5ec9 100644 --- a/source/common/gamecontrol.cpp +++ b/source/common/gamecontrol.cpp @@ -408,12 +408,19 @@ FStringCVar* const CombatMacros[] = { &combatmacro0, &combatmacro1, &combatmacro void CONFIG_ReadCombatMacros() { FScanner sc; - sc.Open("demolition/combatmacros.txt"); - for (auto s : CombatMacros) + try { - sc.MustGetToken(TK_StringConst); - if (strlen(*s) == 0) - *s = sc.String; + sc.Open("demolition/combatmacros.txt"); + for (auto s : CombatMacros) + { + sc.MustGetToken(TK_StringConst); + if (strlen(*s) == 0) + *s = sc.String; + } + } + catch (const std::runtime_error &) + { + // We do not want this to error out. Just ignore if it fails. } } diff --git a/source/common/gamecontrol.h b/source/common/gamecontrol.h index 61d3a1068..13905fb1c 100644 --- a/source/common/gamecontrol.h +++ b/source/common/gamecontrol.h @@ -119,7 +119,10 @@ enum GAMEFLAG_RRRA = 0x00000200, GAMEFLAG_BLOOD = 0x00000400, GAMEFLAG_SW = 0x00000800, - GAMEFLAG_STANDALONE = 0x00001000, + GAMEFLAG_POWERSLAVE = 0x00001000, + GAMEFLAG_EXHUMED = 0x00002000, + GAMEFLAG_PSEXHUMED = 0x00003000, // the two games really are the same, except for the name and the publisher. + GAMEFLAG_STANDALONE = 0x00004000, GAMEFLAGMASK = 0x00000FFF, // flags allowed from grpinfo }; diff --git a/source/common/initfs.cpp b/source/common/initfs.cpp index 4a93a87e0..cb9bda281 100644 --- a/source/common/initfs.cpp +++ b/source/common/initfs.cpp @@ -267,7 +267,7 @@ static void D_AddDirectory (TArray &wadfiles, const char *dir) { skindir[stuffstart++] = '/'; int savedstart = stuffstart; - const char* validexts[] = { "*.grp", "*.zip", "*.pk3", "*.pk4", "*.7z", "*.pk7" }; + const char* validexts[] = { "*.grp", "*.zip", "*.pk3", "*.pk4", "*.7z", "*.pk7", "*.dat" }; for (auto ext : validexts) { stuffstart = savedstart; diff --git a/source/common/searchpaths.cpp b/source/common/searchpaths.cpp index e7cc03255..0c1ba45b3 100644 --- a/source/common/searchpaths.cpp +++ b/source/common/searchpaths.cpp @@ -1061,6 +1061,9 @@ const char* G_DefaultDefFile(void) if (g_gameType & GAMEFLAG_SW) return "sw.def"; + if (g_gameType & GAMEFLAG_PSEXHUMED) + return "exhumed.def"; + if (g_gameType & GAMEFLAG_NAM) return fileSystem.FindFile("nam.def") ? "nam.def" : "napalm.def"; diff --git a/source/common/utility/printf.h b/source/common/utility/printf.h index a906b0a7c..3eef5e088 100644 --- a/source/common/utility/printf.h +++ b/source/common/utility/printf.h @@ -40,6 +40,7 @@ enum void I_Error(const char *fmt, ...) ATTRIBUTE((format(printf,1,2))); int PrintString (int iprintlevel, const char *outline); +int VPrintf(int printlevel, const char* format, va_list parms); int Printf (int printlevel, const char *format, ...) ATTRIBUTE((format(printf,2,3))); int Printf (const char *format, ...) ATTRIBUTE((format(printf,1,2))); int DPrintf (int level, const char *format, ...) ATTRIBUTE((format(printf,2,3))); diff --git a/source/exhumed/CMakeLists.txt b/source/exhumed/CMakeLists.txt index 11dc103f2..bebd5ef0a 100644 --- a/source/exhumed/CMakeLists.txt +++ b/source/exhumed/CMakeLists.txt @@ -51,7 +51,6 @@ set( PCH_SOURCES src/exscript.cpp src/fish.cpp src/grenade.cpp - src/grpscan.cpp src/gun.cpp src/init.cpp src/input.cpp diff --git a/source/exhumed/src/anims.cpp b/source/exhumed/src/anims.cpp index 2caa62881..7be83cf02 100644 --- a/source/exhumed/src/anims.cpp +++ b/source/exhumed/src/anims.cpp @@ -269,7 +269,7 @@ loc_2D755: default: { - DebugOut("unknown msg %x for anim\n", a & 0x7F0000); + Printf("unknown msg %x for anim\n", a & 0x7F0000); return; } } diff --git a/source/exhumed/src/anubis.cpp b/source/exhumed/src/anubis.cpp index 16dac1b16..5429ab9b0 100644 --- a/source/exhumed/src/anubis.cpp +++ b/source/exhumed/src/anubis.cpp @@ -483,7 +483,7 @@ void FuncAnubis(int a, int nDamage, int nRun) } default: { - DebugOut("unknown msg %d for Anubis\n", a & 0x7F0000); + Printf("unknown msg %d for Anubis\n", a & 0x7F0000); return; } } diff --git a/source/exhumed/src/bubbles.cpp b/source/exhumed/src/bubbles.cpp index 29d2bf707..3e6022708 100644 --- a/source/exhumed/src/bubbles.cpp +++ b/source/exhumed/src/bubbles.cpp @@ -194,7 +194,7 @@ void FuncBubble(int a, int b, int nRun) return; default: - DebugOut("unknown msg %d for Bubble\n", nMessage); + Printf("unknown msg %d for Bubble\n", nMessage); return; } } @@ -218,7 +218,7 @@ void DoBubbleMachines() void BuildBubbleMachine(int nSprite) { if (nMachineCount >= kMaxMachines) { - bail2dos("too many bubble machines in level %d\n", levelnew); + I_Error("too many bubble machines in level %d\n", levelnew); } Machine[nMachineCount]._4 = 75; diff --git a/source/exhumed/src/bullet.cpp b/source/exhumed/src/bullet.cpp index e0d13b0c0..dfb0922b3 100644 --- a/source/exhumed/src/bullet.cpp +++ b/source/exhumed/src/bullet.cpp @@ -845,7 +845,7 @@ void FuncBullet(int a, int b, int nRun) default: { - DebugOut("unknown msg %x for bullet\n", a & 0x7F0000); + Printf("unknown msg %x for bullet\n", a & 0x7F0000); return; } } diff --git a/source/exhumed/src/config.cpp b/source/exhumed/src/config.cpp index f1b0d81ab..c063aa3f5 100644 --- a/source/exhumed/src/config.cpp +++ b/source/exhumed/src/config.cpp @@ -15,7 +15,6 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ //------------------------------------------------------------------------- -#if 0 #include "ns.h" #include "compat.h" @@ -27,7 +26,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "control.h" #include "exhumed.h" #include "typedefs.h" -#include "scriplib.h" #include "config.h" @@ -38,167 +36,10 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. BEGIN_PS_NS -const char gamefunctions[kMaxGameFunctions][kMaxGameFuncLen] = -{ - "Move_Forward", - "Move_Backward", - "Turn_Left", - "Turn_Right", - "Strafe", - "Strafe_Left", - "Strafe_Right", - "Run", - "Jump", - "Crouch", - "Fire", - "Open", - "Look_Up", - "Look_Down", - "Look_Straight", - "Aim_Up", - "Aim_Down", - "SendMessage", - "Weapon_1", - "Weapon_2", - "Weapon_3", - "Weapon_4", - "Weapon_5", - "Weapon_6", - "Weapon_7", - "Mouseview", - "Pause", - "Map", - "Zoom_In", - "Zoom_Out", - "Gamma_Correction", - "Escape", - "Shrink_Screen", - "Enlarge_Screen", - "Inventory", - "Inventory_Left", - "Inventory_Right", - "Mouse_Sensitivity_Up", - "Mouse_Sensitivity_Down", - "Show_Console", -}; -const char keydefaults[kMaxGameFunctions * 2][kMaxGameFuncLen] = -{ - "W", "Kpad8", - "S", "Kpad2", - "Left", "Kpad4", - "Right", "KPad6", - "LAlt", "RAlt", - "A", "", - "D", "", - "LShift", "RShift", - "Space", "", - "LCtrl", "", - "RCtrl", "", - "E", "", - "PgUp", "", - "PgDn", "", - "Home", "", - "Insert", "", - "Delete", "", - "T", "", - "1", "", - "2", "", - "3", "", - "4", "", - "5", "", - "6", "", - "7", "", - "/", "", - "Pause", "", - "Tab", "", - "=", "", - "-", "", - "F11", "", - "Escape", "", - "Kpad-", "", - "Kpad+", "", - "Enter", "", - "[", "", - "]", "", - "F7", "", - "F8", "", - "`", "", -}; - -const char oldkeydefaults[kMaxGameFunctions * 2][kMaxGameFuncLen] = -{ - "Up", "Kpad8", - "Down", "Kpad2", - "Left", "Kpad4", - "Right", "KPad6", - "LAlt", "RAlt", - ",", "", - ".", "", - "LShift", "RShift", - "A", "", - "Z", "", - "LCtrl", "RCtrl", - "Space", "", - "PgUp", "", - "PgDn", "", - "Home", "", - "Insert", "", - "Delete", "", - "T", "", - "1", "", - "2", "", - "3", "", - "4", "", - "5", "", - "6", "", - "7", "", - "/", "", - "Pause", "", - "Tab", "", - "=", "", - "-", "", - "F11", "", - "Escape", "", - "Kpad-", "", - "Kpad+", "", - "Enter", "", - "[", "", - "]", "", - "F7", "", - "F8", "", - "`", "", -}; - -static const char *mousedefaults[MAXMOUSEBUTTONS] = -{ - "Fire", - "Strafe", - "Move_Forward" - "", - "", - "", -}; - -static const char *mouseclickeddefaults[MAXMOUSEBUTTONS] = -{ -}; - -static const char* mouseanalogdefaults[MAXMOUSEAXES] = -{ -"analog_strafing", -"analog_moving", -}; - - -static const char* mousedigitaldefaults[MAXMOUSEDIGITAL] = -{ -}; ud_setup_t gSetup; -char setupfilename[128] = {kSetupFilename}; - int lMouseSens = 32; unsigned int dword_1B82E0 = 0; @@ -221,199 +62,6 @@ int32_t useprecache; int32_t MouseDeadZone, MouseBias; int32_t SmoothInput; -// JBF 20031211: Store the input settings because -// (currently) mact can't regurgitate them -int32_t MouseFunctions[MAXMOUSEBUTTONS][2]; -int32_t MouseDigitalFunctions[MAXMOUSEAXES][2]; -int32_t MouseAnalogueAxes[MAXMOUSEAXES]; -int32_t MouseAnalogueScale[MAXMOUSEAXES]; -int32_t JoystickFunctions[MAXJOYBUTTONSANDHATS][2]; -int32_t JoystickDigitalFunctions[MAXJOYAXES][2]; -int32_t JoystickAnalogueAxes[MAXJOYAXES]; -int32_t JoystickAnalogueScale[MAXJOYAXES]; -int32_t JoystickAnalogueInvert[MAXJOYAXES]; -int32_t JoystickAnalogueDead[MAXJOYAXES]; -int32_t JoystickAnalogueSaturate[MAXJOYAXES]; -uint8_t KeyboardKeys[kMaxGameFunctions][2]; - -int32_t MAXCACHE1DSIZE = (96*1024*1024); - - -void SetupGameButtons() -{ - CONTROL_DefineFlag(gamefunc_Move_Forward, kFalse); - CONTROL_DefineFlag(gamefunc_Move_Backward, kFalse); - CONTROL_DefineFlag(gamefunc_Turn_Left, kFalse); - CONTROL_DefineFlag(gamefunc_Turn_Right, kFalse); - CONTROL_DefineFlag(gamefunc_Strafe, kFalse); - CONTROL_DefineFlag(gamefunc_Strafe_Left, kFalse); - CONTROL_DefineFlag(gamefunc_Strafe_Right, kFalse); - CONTROL_DefineFlag(gamefunc_Jump, kFalse); - CONTROL_DefineFlag(gamefunc_Crouch, kFalse); - CONTROL_DefineFlag(gamefunc_Fire, kFalse); - CONTROL_DefineFlag(gamefunc_Open, kFalse); - CONTROL_DefineFlag(gamefunc_Aim_Up, kFalse); - CONTROL_DefineFlag(gamefunc_Aim_Down, kFalse); - CONTROL_DefineFlag(gamefunc_Look_Up, kFalse); - CONTROL_DefineFlag(gamefunc_Look_Down, kFalse); - CONTROL_DefineFlag(gamefunc_Look_Straight, kFalse); - CONTROL_DefineFlag(gamefunc_Run, kFalse); - CONTROL_DefineFlag(gamefunc_SendMessage, kFalse); - CONTROL_DefineFlag(gamefunc_Weapon_1, kFalse); - CONTROL_DefineFlag(gamefunc_Weapon_2, kFalse); - CONTROL_DefineFlag(gamefunc_Weapon_3, kFalse); - CONTROL_DefineFlag(gamefunc_Weapon_4, kFalse); - CONTROL_DefineFlag(gamefunc_Weapon_5, kFalse); - CONTROL_DefineFlag(gamefunc_Weapon_6, kFalse); - CONTROL_DefineFlag(gamefunc_Weapon_7, kFalse); - CONTROL_DefineFlag(gamefunc_Map, kFalse); - CONTROL_DefineFlag(gamefunc_Escape, kFalse); - CONTROL_DefineFlag(gamefunc_Shrink_Screen, kFalse); - CONTROL_DefineFlag(gamefunc_Enlarge_Screen, kFalse); - CONTROL_DefineFlag(gamefunc_Zoom_In, kFalse); - CONTROL_DefineFlag(gamefunc_Zoom_Out, kFalse); - CONTROL_DefineFlag(gamefunc_Inventory_Left, kFalse); - CONTROL_DefineFlag(gamefunc_Inventory_Right, kFalse); - CONTROL_DefineFlag(gamefunc_Mouseview, kFalse); - CONTROL_DefineFlag(gamefunc_Inventory, kFalse); -} - -hashtable_t h_gamefuncs = { kMaxGameFunctions<<1, NULL }; - -int32_t CONFIG_FunctionNameToNum(const char *func) -{ - if (!func) - return -1; - - return hash_findcase(&h_gamefuncs, func); -} - - -static char const * CONFIG_FunctionNumToName(int32_t func) -{ - if ((unsigned)func >= (unsigned)kMaxGameFunctions) - return ""; - return gamefunctions[func]; -} - - -int32_t CONFIG_AnalogNameToNum(const char *func) -{ - if (!func) - return -1; - else if (!Bstrcasecmp(func, "analog_turning")) - return analog_turning; - else if (!Bstrcasecmp(func, "analog_strafing")) - return analog_strafing; - else if (!Bstrcasecmp(func, "analog_moving")) - return analog_moving; - else if (!Bstrcasecmp(func, "analog_lookingupanddown")) - return analog_lookingupanddown; - else - return -1; -} - - -static char const * CONFIG_AnalogNumToName(int32_t func) -{ - switch (func) - { - case analog_turning: - return "analog_turning"; - case analog_strafing: - return "analog_strafing"; - case analog_moving: - return "analog_moving"; - case analog_lookingupanddown: - return "analog_lookingupanddown"; - } - - return ""; -} - - -static void CONFIG_SetJoystickButtonFunction(int i, int j, int function) -{ - JoystickFunctions[i][j] = function; - CONTROL_MapButton(function, i, j, controldevice_joystick); -} -static void CONFIG_SetJoystickAnalogAxisScale(int i, int scale) -{ - JoystickAnalogueScale[i] = scale; - CONTROL_SetAnalogAxisScale(i, scale, controldevice_joystick); -} -static void CONFIG_SetJoystickAnalogAxisInvert(int i, int invert) -{ - JoystickAnalogueInvert[i] = invert; - CONTROL_SetAnalogAxisInvert(i, invert, controldevice_joystick); -} -static void CONFIG_SetJoystickAnalogAxisDeadSaturate(int i, int dead, int saturate) -{ - JoystickAnalogueDead[i] = dead; - JoystickAnalogueSaturate[i] = saturate; - joySetDeadZone(i, dead, saturate); -} -static void CONFIG_SetJoystickDigitalAxisFunction(int i, int j, int function) -{ - JoystickDigitalFunctions[i][j] = function; - CONTROL_MapDigitalAxis(i, function, j, controldevice_joystick); -} -static void CONFIG_SetJoystickAnalogAxisFunction(int i, int function) -{ - JoystickAnalogueAxes[i] = function; - CONTROL_MapAnalogAxis(i, function, controldevice_joystick); -} - - -void CONFIG_SetDefaultKeys(const char (*keyptr)[kMaxGameFuncLen], bool lazy/*=false*/) -{ - static char const s_gamefunc_[] = "gamefunc_"; - int constexpr strlen_gamefunc_ = ARRAY_SIZE(s_gamefunc_) - 1; - - if (!lazy) - { - Bmemset(KeyboardKeys, 0xff, sizeof(KeyboardKeys)); - CONTROL_ClearAllBinds(); - } - - for (int i=0; i < ARRAY_SSIZE(gamefunctions); ++i) - { - if (gamefunctions[i][0] == '\0') - continue; - - auto &key = KeyboardKeys[i]; - - int const default0 = KB_StringToScanCode(keyptr[i<<1]); - int const default1 = KB_StringToScanCode(keyptr[(i<<1)+1]); - - // skip the function if the default key is already used - // or the function is assigned to another key - if (lazy && (key[0] != 0xff || (CONTROL_KeyIsBound(default0) && Bstrlen(CONTROL_KeyBinds[default0].cmdstr) > strlen_gamefunc_ - && CONFIG_FunctionNameToNum(CONTROL_KeyBinds[default0].cmdstr + strlen_gamefunc_) >= 0))) - { -#if 0 // defined(DEBUGGINGAIDS) - if (key[0] != 0xff) - initprintf("Skipping %s bound to %s\n", keyptr[i<<1], CONTROL_KeyBinds[default0].cmdstr); -#endif - continue; - } - - key[0] = default0; - key[1] = default1; - - if (key[0]) - CONTROL_FreeKeyBind(key[0]); - - if (key[1]) - CONTROL_FreeKeyBind(key[1]); - - if (i == gamefunc_Show_Console) - OSD_CaptureKey(key[0]); - else - CONFIG_MapKey(i, key[0], 0, key[1], 0); - } -} - void CONFIG_SetDefaults() { scripthandle = -1; @@ -437,12 +85,6 @@ void CONFIG_SetDefaults() gSetup.ydim = 768; } -#ifdef USE_OPENGL - gSetup.bpp = 32; -#else - gSetup.bpp = 8; -#endif - // currently settings.cfg is only read after the startup window launches the game, // and rereading binds might be fickle so just enable this gSetup.usejoystick = 1; @@ -465,556 +107,18 @@ void CONFIG_SetDefaults() runkey_mode = 0; auto_run = 1; - CONFIG_SetDefaultKeys(keydefaults); - - memset(MouseFunctions, -1, sizeof(MouseFunctions)); - memset(MouseDigitalFunctions, -1, sizeof(MouseDigitalFunctions)); - memset(JoystickFunctions, -1, sizeof(JoystickFunctions)); - memset(JoystickDigitalFunctions, -1, sizeof(JoystickDigitalFunctions)); - - CONTROL_MouseSensitivity = DEFAULTMOUSESENSITIVITY; - - for (int i=0; i=4) continue; - MouseFunctions[i][1] = CONFIG_FunctionNameToNum(mouseclickeddefaults[i]); - CONTROL_MapButton(MouseFunctions[i][1], i, 1, controldevice_mouse); - } - - for (int i=0; i MAXCACHE1DSIZE) - MAXCACHE1DSIZE = cachesize; - - - if (g_noSetup == 0 && g_modDir[0] == '/') - { - SCRIPT_GetString(scripthandle, "Setup","ModDir",&g_modDir[0]); - - if (!buildvfs_isdir(g_modDir)) - { - initprintf("Invalid mod dir in cfg!\n"); - Bsprintf(g_modDir,"/"); - } - } - - windowx = -1; - windowy = -1; - - SCRIPT_GetNumber(scripthandle, "Screen Setup", "MaxRefreshFreq", (int32_t *)&maxrefreshfreq); - SCRIPT_GetNumber(scripthandle, "Screen Setup", "ScreenBPP", &gSetup.bpp); - SCRIPT_GetNumber(scripthandle, "Screen Setup", "ScreenHeight", &gSetup.ydim); - SCRIPT_GetNumber(scripthandle, "Screen Setup", "ScreenMode", &gSetup.fullscreen); - SCRIPT_GetNumber(scripthandle, "Screen Setup", "ScreenWidth", &gSetup.xdim); - SCRIPT_GetNumber(scripthandle, "Screen Setup", "WindowPosX", (int32_t *)&windowx); - SCRIPT_GetNumber(scripthandle, "Screen Setup", "WindowPosY", (int32_t *)&windowy); - SCRIPT_GetNumber(scripthandle, "Screen Setup", "WindowPositioning", (int32_t *)&windowpos); - - if (gSetup.bpp < 8) gSetup.bpp = 32; - - setupread = 1; - return 0; + CONFIG_SetDefaults(); + if (ScreenBPP < 8) ScreenBPP = 32; + return 0; } -// wrapper for CONTROL_MapKey(), generates key bindings to reflect changes to keyboard setup -void CONFIG_MapKey(int which, kb_scancode key1, kb_scancode oldkey1, kb_scancode key2, kb_scancode oldkey2) -{ - char tempbuf[256]; - int const keys[] = { key1, key2, oldkey1, oldkey2 }; - char buf[2*kMaxGameFuncLen]; - - if (which == gamefunc_Show_Console) - OSD_CaptureKey(key1); - - for (int k = 0; (unsigned)k < ARRAY_SIZE(keys); k++) - { - if (keys[k] == 0xff || !keys[k]) - continue; - - int match = 0; - - for (; match < ARRAY_SSIZE(sctokeylut); ++match) - { - if (keys[k] == sctokeylut[match].sc) - break; - } - - tempbuf[0] = 0; - - for (int i=kMaxGameFunctions-1; i>=0; i--) - { - if (KeyboardKeys[i][0] == keys[k] || KeyboardKeys[i][1] == keys[k]) - { - Bsprintf(buf, "gamefunc_%s; ", CONFIG_FunctionNumToName(i)); - Bstrcat(tempbuf,buf); - } - } - - int const len = Bstrlen(tempbuf); - - if (len >= 2) - { - tempbuf[len-2] = 0; // cut off the trailing "; " - CONTROL_BindKey(keys[k], tempbuf, 1, sctokeylut[match].key ? sctokeylut[match].key : ""); - } - else - { - CONTROL_FreeKeyBind(keys[k]); - } - } -} - - -void CONFIG_SetupMouse(void) -{ - if (scripthandle < 0) - return; - - char str[80]; - char temp[80]; - - for (int i=0; i_settings.cfg { - char filename[BMAX_PATH]; +} - if (!Bstrcmp(setupfilename, kSetupFilename)) - Bsprintf(filename, "settings.cfg"); - else - Bsprintf(filename, "%s_settings.cfg", strtok(setupfilename, ".")); - - buildvfs_FILE fp = buildvfs_fopen_write(filename); - - if (fp) - { - buildvfs_fputstr(fp, "// this file is automatically generated by "); - buildvfs_fputstrptr(fp, AppProperName); - buildvfs_fputstr(fp,"\nunbindall\n"); - - for (int i=0; i= (MAXMOUSEBUTTONS-2)) continue; - - if (CONFIG_FunctionNumToName(MouseFunctions[i][1])) - { - Bsprintf(buf, "MouseButtonClicked%d", i); - SCRIPT_PutString(scripthandle, "Controls", buf, CONFIG_FunctionNumToName(MouseFunctions[i][1])); - } - } - - for (int i=0; i #include // for printf #include @@ -446,64 +445,13 @@ const char *gString[] = "", }; -static char g_rootDir[BMAX_PATH]; -char g_modDir[BMAX_PATH] = "/"; - -buildvfs_kfd kopen4loadfrommod(const char *fileName, char searchfirst) -{ - buildvfs_kfd kFile = buildvfs_kfd_invalid; - - if (g_modDir[0] != '/' || g_modDir[1] != 0) - { - static char staticFileName[BMAX_PATH]; - Bsnprintf(staticFileName, sizeof(staticFileName), "%s/%s", g_modDir, fileName); - kFile = kopen4load(staticFileName, searchfirst); - } - - return (kFile == buildvfs_kfd_invalid) ? kopen4load(fileName, searchfirst) : kFile; -} struct grpfile_t const *g_selectedGrp; -int32_t g_gameType = GAMEFLAG_POWERSLAVE; - // g_gameNamePtr can point to one of: grpfiles[].name (string literal), string // literal, malloc'd block (XXX: possible leak) const char *g_gameNamePtr = NULL; -// grp handling - -static const char *defaultgamegrp = "STUFF.DAT"; -static const char *defaultdeffilename = "exhumed.def"; - -// g_grpNamePtr can ONLY point to a malloc'd block (length BMAX_PATH) -char *g_grpNamePtr = NULL; - -void clearGrpNamePtr(void) -{ - Xfree(g_grpNamePtr); - // g_grpNamePtr assumed to be assigned to right after -} - -const char *G_DefaultGrpFile(void) -{ - return defaultgamegrp; -} -const char *G_DefaultDefFile(void) -{ - return defaultdeffilename; -} - -const char *G_GrpFile(void) -{ - return (g_grpNamePtr == NULL) ? G_DefaultGrpFile() : g_grpNamePtr; -} - -const char *G_DefFile(void) -{ - return (g_defNamePtr == NULL) ? G_DefaultDefFile() : g_defNamePtr; -} - int32_t g_commandSetup = 0; int32_t g_noSetup = 0; int32_t g_noAutoLoad = 0; @@ -514,301 +462,10 @@ static struct strllist *CommandPaths, *CommandGrps; void G_ExtPreInit(int32_t argc,char const * const * argv) { - g_useCwd = G_CheckCmdSwitch(argc, argv, "-usecwd"); - -#ifdef _WIN32 - GetModuleFileName(NULL,g_rootDir,BMAX_PATH); - Bcorrectfilename(g_rootDir,1); - //buildvfs_chdir(g_rootDir); -#else - buildvfs_getcwd(g_rootDir,BMAX_PATH); - strcat(g_rootDir,"/"); -#endif } void G_ExtInit(void) { - char cwd[BMAX_PATH]; - -#ifdef EDUKE32_OSX - char *appdir = Bgetappdir(); - addsearchpath(appdir); - Xfree(appdir); -#endif - -#ifdef USE_PHYSFS - strncpy(cwd, PHYSFS_getBaseDir(), ARRAY_SIZE(cwd)); - cwd[ARRAY_SIZE(cwd)-1] = '\0'; -#else - if (buildvfs_getcwd(cwd, ARRAY_SIZE(cwd)) && Bstrcmp(cwd, "/") != 0) -#endif - addsearchpath(cwd); - - if (CommandPaths) - { - int32_t i; - struct strllist *s; - while (CommandPaths) - { - s = CommandPaths->next; - i = addsearchpath(CommandPaths->str); - if (i < 0) - { - initprintf("Failed adding %s for game data: %s\n", CommandPaths->str, - i==-1 ? "not a directory" : "no such directory"); - } - - Xfree(CommandPaths->str); - Xfree(CommandPaths); - CommandPaths = s; - } - } - -#if defined(_WIN32) && !defined(EDUKE32_STANDALONE) - if (buildvfs_exists("user_profiles_enabled")) -#else - if (g_useCwd == 0 && !buildvfs_exists("user_profiles_disabled")) -#endif - { - char *homedir; - int32_t asperr; - - if ((homedir = Bgethomedir())) - { - Bsnprintf(cwd, ARRAY_SIZE(cwd), "%s/" -#if defined(_WIN32) - APPNAME -#elif defined(GEKKO) - "apps/" APPBASENAME -#else - ".config/" APPBASENAME -#endif - ,homedir); - asperr = addsearchpath(cwd); - if (asperr == -2) - { - if (buildvfs_mkdir(cwd,S_IRWXU) == 0) asperr = addsearchpath(cwd); - else asperr = -1; - } - if (asperr == 0) - buildvfs_chdir(cwd); - Xfree(homedir); - } - } -} - -void G_ScanGroups(void) -{ - ScanGroups(); - - g_selectedGrp = NULL; - - char const * const currentGrp = G_GrpFile(); - - for (grpfile_t const *fg = foundgrps; fg; fg=fg->next) - { - if (!Bstrcasecmp(fg->filename, currentGrp)) - { - g_selectedGrp = fg; - break; - } - } - - if (g_selectedGrp == NULL) - g_selectedGrp = foundgrps; -} - -static int32_t G_TryLoadingGrp(char const * const grpfile) -{ - int32_t i; - - if ((i = initgroupfile(grpfile)) == -1) - initprintf("Warning: could not find main data file \"%s\"!\n", grpfile); - else - initprintf("Using \"%s\" as main game data file.\n", grpfile); - - return i; -} - -static int32_t G_LoadGrpDependencyChain(grpfile_t const * const grp) -{ - if (!grp) - return -1; - - if (grp->type->dependency && grp->type->dependency != grp->type->crcval) - G_LoadGrpDependencyChain(FindGroup(grp->type->dependency)); - - int32_t const i = G_TryLoadingGrp(grp->filename); - - return i; -} - -void G_LoadGroups(int32_t autoload) -{ - if (g_modDir[0] != '/') - { - char cwd[BMAX_PATH]; - - Bstrcat(g_rootDir, g_modDir); - addsearchpath(g_rootDir); - // addsearchpath(mod_dir); - - char path[BMAX_PATH]; - - if (buildvfs_getcwd(cwd, BMAX_PATH)) - { - Bsnprintf(path, sizeof(path), "%s/%s", cwd, g_modDir); - if (!Bstrcmp(g_rootDir, path)) - { - if (addsearchpath(path) == -2) - if (buildvfs_mkdir(path, S_IRWXU) == 0) - addsearchpath(path); - } - } - -#ifdef USE_OPENGL - Bsnprintf(path, sizeof(path), "%s/%s", g_modDir, TEXCACHEFILE); - Bstrcpy(TEXCACHEFILE, path); -#endif - } - - const char *grpfile; - int32_t i; - - if ((i = G_LoadGrpDependencyChain(g_selectedGrp)) != -1) - { - grpfile = g_selectedGrp->filename; - - clearGrpNamePtr(); - g_grpNamePtr = dup_filename(grpfile); - - grpinfo_t const * const type = g_selectedGrp->type; - - g_gameType = type->game; - g_gameNamePtr = type->name; - - if (type->defname && g_defNamePtr == NULL) - g_defNamePtr = dup_filename(type->defname); - } - else - { - grpfile = G_GrpFile(); - i = G_TryLoadingGrp(grpfile); - } - - if (autoload) - { - G_LoadGroupsInDir("autoload"); - - if (i != -1) - G_DoAutoload(grpfile); - } - - if (g_modDir[0] != '/') - G_LoadGroupsInDir(g_modDir); - - loaddefinitions_game(G_DefFile(), TRUE); - - struct strllist *s; - - int const bakpathsearchmode = pathsearchmode; - pathsearchmode = 1; - - while (CommandGrps) - { - int32_t j; - - s = CommandGrps->next; - - if ((j = initgroupfile(CommandGrps->str)) == -1) - initprintf("Could not find file \"%s\".\n", CommandGrps->str); - else - { - g_groupFileHandle = j; - initprintf("Using file \"%s\" as game data.\n", CommandGrps->str); - if (autoload) - G_DoAutoload(CommandGrps->str); - } - - Xfree(CommandGrps->str); - Xfree(CommandGrps); - CommandGrps = s; - } - pathsearchmode = bakpathsearchmode; -} - -////////// - -void G_AddGroup(const char *buffer) -{ - char buf[BMAX_PATH]; - - struct strllist *s = (struct strllist *)Xcalloc(1,sizeof(struct strllist)); - - Bstrcpy(buf, buffer); - - if (Bstrchr(buf,'.') == 0) - Bstrcat(buf,".grp"); - - s->str = Xstrdup(buf); - - if (CommandGrps) - { - struct strllist *t; - for (t = CommandGrps; t->next; t=t->next) ; - t->next = s; - return; - } - CommandGrps = s; -} - -void G_AddPath(const char *buffer) -{ - struct strllist *s = (struct strllist *)Xcalloc(1,sizeof(struct strllist)); - s->str = Xstrdup(buffer); - - if (CommandPaths) - { - struct strllist *t; - for (t = CommandPaths; t->next; t=t->next) ; - t->next = s; - return; - } - CommandPaths = s; -} - -////////// - -// loads all group (grp, zip, pk3/4) files in the given directory -void G_LoadGroupsInDir(const char *dirname) -{ - static const char *extensions[] = { "*.grp", "*.zip", "*.ssi", "*.pk3", "*.pk4" }; - char buf[BMAX_PATH]; - fnlist_t fnlist = FNLIST_INITIALIZER; - - for (auto & extension : extensions) - { - BUILDVFS_FIND_REC *rec; - - fnlist_getnames(&fnlist, dirname, extension, -1, 0); - - for (rec=fnlist.findfiles; rec; rec=rec->next) - { - Bsnprintf(buf, sizeof(buf), "%s/%s", dirname, rec->name); - initprintf("Using group file \"%s\".\n", buf); - initgroupfile(buf); - } - - fnlist_clearnames(&fnlist); - } -} - -void G_DoAutoload(const char *dirname) -{ - char buf[BMAX_PATH]; - - Bsnprintf(buf, sizeof(buf), "autoload/%s", dirname); - G_LoadGroupsInDir(buf); } ////////// @@ -909,20 +566,10 @@ static int parsedefinitions_game(scriptfile *pScript, int firstPass) { char *fileName; - pathsearchmode = 1; if (!scriptfile_getstring(pScript,&fileName) && firstPass) { - if (initgroupfile(fileName) == -1) - initprintf("Could not find file \"%s\".\n", fileName); - else - { - initprintf("Using file \"%s\" as game data.\n", fileName); - if (!g_noAutoLoad && !gSetup.noautoload) - G_DoAutoload(fileName); - } + fileSystem.AddAdditionalFile(fileName); } - - pathsearchmode = 0; } break; case T_CACHESIZE: @@ -931,9 +578,6 @@ static int parsedefinitions_game(scriptfile *pScript, int firstPass) if (scriptfile_getnumber(pScript, &cacheSize) || !firstPass) break; - - if (cacheSize > 0) - MAXCACHE1DSIZE = cacheSize << 10; } break; case T_INCLUDE: @@ -971,7 +615,7 @@ int loaddefinitions_game(const char *fileName, int32_t firstPass) if (pScript) parsedefinitions_game(pScript, firstPass); - for (char const * m : g_defModules) + for (auto &m : *userConfig.AddDefs) parsedefinitions_game_include(m, NULL, "null", firstPass); if (pScript) @@ -1165,21 +809,12 @@ void DebugOut(const char *fmt, ...) #ifdef _DEBUG va_list args; va_start(args, fmt); - - debugBuffer[0] = '\0'; - - vsprintf(debugBuffer, fmt, args); - - initprintf("%s", debugBuffer); - fflush(stdout); - - va_end(args); + VPrintf(PRINT_HIGH, fmt, args); #endif } void ShutDown(void) { - CONFIG_WriteSetup(0); StopCD(); if (bSerialPlay) { @@ -1189,13 +824,12 @@ void ShutDown(void) UnInitSerial(); } - KB_Shutdown(); RemoveEngine(); UnInitNet(); UnInitFX(); } -void bail2dos(const char *fmt, ...) +void I_Error(const char *fmt, ...) { char buf[256]; @@ -1417,9 +1051,7 @@ void mysetbrightness(char nBrightness) void CheckKeys() { - int eax; - - if (BUTTON(gamefunc_Enlarge_Screen)) + if (buttonMap.ButtonDown(gamefunc_Enlarge_Screen)) { if (screensize == 0) { @@ -1438,12 +1070,12 @@ void CheckKeys() UpdateScreenSize(); } - CONTROL_ClearButton(gamefunc_Enlarge_Screen); + buttonMap.ClearButton(gamefunc_Enlarge_Screen); } // F11? #if 0 - if (BUTTON(gamefunc_Gamma_Correction)) + if (buttonMap.ButtonDown(gamefunc_Gamma_Correction)) { nGamma++; @@ -1451,11 +1083,11 @@ void CheckKeys() nGamma = 0; mysetbrightness((uint8_t)nGamma); - CONTROL_ClearButton(gamefunc_Gamma_Correction); -#endif + buttonMap.ClearButton(gamefunc_Gamma_Correction); } +#endif - if (BUTTON(gamefunc_Shrink_Screen)) + if (buttonMap.ButtonDown(gamefunc_Shrink_Screen)) { if (bFullScreen) { @@ -1468,19 +1100,11 @@ void CheckKeys() } UpdateScreenSize(); - CONTROL_ClearButton(gamefunc_Shrink_Screen); - } - - // print version string? - if (KB_KeyDown[sc_V] && KB_KeyDown[sc_LeftAlt]) - { - KB_KeyDown[sc_V] = 0; - StatusMessage(300, versionstr); - return; + buttonMap.ClearButton(gamefunc_Shrink_Screen); } // go to 3rd person view? - if (KB_KeyDown[sc_C] && KB_KeyDown[sc_LeftAlt]) + if (buttonMap.ButtonDown(gamefunc_Third_Person_View)) { if (!nFreeze) { @@ -1494,11 +1118,11 @@ void CheckKeys() if (bCamera) GrabPalette(); } - KB_KeyDown[sc_C] = 0; - return; + buttonMap.ClearButton(gamefunc_Third_Person_View); + return; } - if (KB_KeyDown[sc_Pause]) + if (inputState.GetKeyStatus(sc_Pause)) { if (!nNetPlayerCount) { @@ -1516,15 +1140,15 @@ void CheckKeys() // Clip(); // videoNextPage(); } - KB_KeyDown[sc_Pause] = 0; + inputState.ClearKeyStatus(sc_Pause); } return; } // Handle cheat codes - if (!bInDemo && KB_KeyWaiting()) + if (!bInDemo && inputState.keyBufferWaiting()) { - char ch = KB_GetCh(); + char ch = inputState.keyGetChar(); if (bHolly) { @@ -1667,7 +1291,7 @@ void CheckKeys() } else { - KB_GetCh(); + inputState.keyGetChar(); //??? } } @@ -1771,11 +1395,11 @@ void DoCredits() while ((int)totalclock + 600 > (int)totalclock) { - if (KB_KeyDown[sc_F12]) + if(inputState.GetKeyStatus(sc_F12)) { var_20++; - KB_KeyDown[sc_F12] = 0; + inputState.ClearKeyStatus(sc_F12); if (var_20 > 5) { return; @@ -1788,9 +1412,7 @@ void DoCredits() while (CDplaying()) { - if (KB_KeyWaiting()) { - KB_GetCh(); - } + inputState.keyGetChar(); } Clip(); @@ -2624,7 +2246,7 @@ int app_main(int argc, char const* const* argv) GrabPalette(); if (bSerialPlay && !InitSerial()) { - bail2dos("Unable to connect"); + I_Error("Unable to connect"); } if (doTitle) @@ -2689,7 +2311,7 @@ STARTGAME2: { int nPlayer = GrabPlayer(); if (nPlayer < 0) { - bail2dos("Can't create local player\n"); + I_Error("Can't create local player\n"); } InitPlayerInventory(nPlayer); @@ -2780,7 +2402,7 @@ LOOP3: Query(2, 0, "Insert CD into drive", "(ESC to abort)"); KB_ClearKeysDown(); if (KB_GetCh() == asc_Escape) { - bail2dos("Aborted\n"); + I_Error("Aborted\n"); } } } @@ -2962,9 +2584,9 @@ LOOP3: // } // else if (nNetTime == 0) // { - // if (BUTTON(gamefunc_Open)) + // if (buttonMap.ButtonDown(gamefunc_Open)) // { - // CONTROL_ClearButton(gamefunc_Open); + // buttonMap.ClearButton(gamefunc_Open); // goto MENU2; // } // } @@ -3035,9 +2657,9 @@ LOOP3: } if (!bInDemo) { - if (BUTTON(gamefunc_Escape)) + if (buttonMap.ButtonDown(gamefunc_Escape)) { - CONTROL_ClearButton(gamefunc_Escape); + buttonMap.ClearButton(gamefunc_Escape); // MENU2: CONTROL_BindsEnabled = 0; bInMove = kTrue; @@ -3076,9 +2698,9 @@ LOOP3: KB_ClearKeyDown(sc_F12); videoCaptureScreen("captxxxx.png", 0); } - else if (BUTTON(gamefunc_Map)) // e.g. TAB (to show 2D map) + else if (buttonMap.ButtonDown(gamefunc_Map)) // e.g. TAB (to show 2D map) { - CONTROL_ClearButton(gamefunc_Map); + buttonMap.ClearButton(gamefunc_Map); if (!nFreeze) { nMapMode = (nMapMode+1)%3; @@ -3090,10 +2712,10 @@ LOOP3: int const timerOffset = ((int) totalclock - nonsharedtimer); nonsharedtimer += timerOffset; - if (BUTTON(gamefunc_Zoom_In)) + if (buttonMap.ButtonDown(gamefunc_Zoom_In)) lMapZoom += mulscale6(timerOffset, max(lMapZoom, 256)); - if (BUTTON(gamefunc_Zoom_Out)) + if (buttonMap.ButtonDown(gamefunc_Zoom_Out)) lMapZoom -= mulscale6(timerOffset, max(lMapZoom, 256)); lMapZoom = clamp(lMapZoom, 48, 2048); @@ -3101,20 +2723,20 @@ LOOP3: if (PlayerList[nLocalPlayer].nHealth > 0) { - if (BUTTON(gamefunc_Inventory_Left)) + if (buttonMap.ButtonDown(gamefunc_Inventory_Left)) { SetPrevItem(nLocalPlayer); - CONTROL_ClearButton(gamefunc_Inventory_Left); + buttonMap.ClearButton(gamefunc_Inventory_Left); } - if (BUTTON(gamefunc_Inventory_Right)) + if (buttonMap.ButtonDown(gamefunc_Inventory_Right)) { SetNextItem(nLocalPlayer); - CONTROL_ClearButton(gamefunc_Inventory_Right); + buttonMap.ClearButton(gamefunc_Inventory_Right); } - if (BUTTON(gamefunc_Inventory)) + if (buttonMap.ButtonDown(gamefunc_Inventory)) { UseCurItem(nLocalPlayer); - CONTROL_ClearButton(gamefunc_Inventory); + buttonMap.ClearButton(gamefunc_Inventory); } } else { @@ -3168,7 +2790,7 @@ void mychangespritesect(int nSprite, int nSector) void mydeletesprite(int nSprite) { if (nSprite < 0 || nSprite > kMaxSprites) { - bail2dos("bad sprite value %d handed to mydeletesprite", nSprite); + I_Error("bad sprite value %d handed to mydeletesprite", nSprite); } deletesprite(nSprite); diff --git a/source/exhumed/src/exhumed.h b/source/exhumed/src/exhumed.h index d1e5027b9..1aa236985 100644 --- a/source/exhumed/src/exhumed.h +++ b/source/exhumed/src/exhumed.h @@ -21,7 +21,13 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "compat.h" #include "cache1d.h" -#include "grpscan.h" +#include "v_text.h" +#include "printf.h" +#include "gamecvars.h" +#include "m_argv.h" +#include "gamecontrol.h" +#include "c_buttons.h" +#include "filesystem/filesystem.h" BEGIN_PS_NS @@ -31,17 +37,6 @@ BEGIN_PS_NS void handleevents(); #endif -// TODO: -#define OSDTEXT_DEFAULT "^00" -#define OSDTEXT_DARKRED "^00" -#define OSDTEXT_GREEN "^00" -#define OSDTEXT_RED "^00" -#define OSDTEXT_YELLOW "^00" - -#define OSDTEXT_BRIGHT "^S0" - -#define OSD_ERROR OSDTEXT_DARKRED OSDTEXT_BRIGHT - enum basepal_t { BASEPAL = 0, ANIMPAL, @@ -50,7 +45,6 @@ enum basepal_t { void ShutDown(void); void DebugOut(const char *fmt, ...); -void bail2dos(const char *fmt, ...); int ExhumedMain(int argc, char *argv[]); void FinishLevel(); diff --git a/source/exhumed/src/fish.cpp b/source/exhumed/src/fish.cpp index 4117fac66..550eee688 100644 --- a/source/exhumed/src/fish.cpp +++ b/source/exhumed/src/fish.cpp @@ -325,7 +325,7 @@ void FuncFish(int a, int nDamage, int nRun) { default: { - DebugOut("unknown msg %d for Fish\n", a & 0x7F0000); + Printf("unknown msg %d for Fish\n", a & 0x7F0000); return; } diff --git a/source/exhumed/src/grenade.cpp b/source/exhumed/src/grenade.cpp index 7f9f2e283..777be645e 100644 --- a/source/exhumed/src/grenade.cpp +++ b/source/exhumed/src/grenade.cpp @@ -295,7 +295,7 @@ void FuncGrenade(int a, int nDamage, int nRun) default: { - DebugOut("unknown msg %d for bullet\n", a & 0x7F0000); // TODO - change 'bullet' to 'grenade' ? + Printf("unknown msg %d for bullet\n", a & 0x7F0000); // TODO - change 'bullet' to 'grenade' ? return; } diff --git a/source/exhumed/src/grpscan.cpp b/source/exhumed/src/grpscan.cpp deleted file mode 100644 index fd560cf8c..000000000 --- a/source/exhumed/src/grpscan.cpp +++ /dev/null @@ -1,474 +0,0 @@ -//------------------------------------------------------------------------- -/* -Copyright (C) 2010 EDuke32 developers and contributors - -This file is part of EDuke32. - -EDuke32 is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License version 2 -as published by the Free Software Foundation. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - -See the GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -*/ -//------------------------------------------------------------------------- -#include "ns.h" -#include "baselayer.h" -#include "cache1d.h" -#include "exhumed.h" -#include "common.h" -#include "compat.h" -//#include "crc32.h" -#include "grpscan.h" -#include "scriptfile.h" - -BEGIN_PS_NS - - -#ifndef EDUKE32_STANDALONE -static void process_vaca13(int32_t crcval); -static void process_vacapp15(int32_t crcval); - -// custom GRP support for the startup window, file format reflects the structure below -#define GAMELISTFILE "games.list" -// name crc size flags dependency -static internalgrpinfo_t const internalgrpfiles[] = -{ - { "Powerslave", POWERSLAVE_CRC, 27020745, GAMEFLAG_POWERSLAVE, 0 }, - { "Exhumed", EXHUMED_CRC, 27108170, GAMEFLAG_EXHUMED, 0 }, -}; -#endif - -struct grpfile_t *foundgrps = NULL; -struct grpinfo_t *listgrps = NULL; - -static void LoadList(const char * filename) -{ - scriptfile *script = scriptfile_fromfile(filename); - - if (!script) - return; - -#ifndef EDUKE32_STANDALONE - scriptfile_addsymbolvalue("GAMEFLAG_POWERSLAVE", GAMEFLAG_POWERSLAVE); - scriptfile_addsymbolvalue("POWERSLAVE_CRC", POWERSLAVE_CRC); - scriptfile_addsymbolvalue("EXHUMED_CRC", EXHUMED_CRC); -#endif - - while (!scriptfile_eof(script)) - { - enum - { - T_GRPINFO, - T_GAMENAME, - T_CRC, - T_SIZE, - T_DEPCRC, - T_DEFNAME, - T_FLAGS, - }; - - static const tokenlist profiletokens[] = - { - { "grpinfo", T_GRPINFO }, - }; - - int32_t token = getatoken(script,profiletokens,ARRAY_SIZE(profiletokens)); - switch (token) - { - case T_GRPINFO: - { - int32_t gsize = 0, gcrcval = 0, gflags = GAMEFLAG_POWERSLAVE, gdepcrc = POWERSLAVE_CRC; - char *gname = NULL, *gdef = NULL; - char *grpend = NULL; - - static const tokenlist grpinfotokens[] = - { - { "name", T_GAMENAME }, - { "defname", T_DEFNAME }, - { "crc", T_CRC }, - { "dependency", T_DEPCRC }, - { "size", T_SIZE }, - { "flags", T_FLAGS }, - - }; - - if (scriptfile_getbraces(script,&grpend)) break; - - while (script->textptr < grpend) - { - int32_t token = getatoken(script,grpinfotokens,ARRAY_SIZE(grpinfotokens)); - - switch (token) - { - case T_GAMENAME: - scriptfile_getstring(script,&gname); break; - case T_DEFNAME: - scriptfile_getstring(script,&gdef); break; - - case T_FLAGS: - scriptfile_getsymbol(script,&gflags); gflags &= GAMEFLAGMASK; break; - case T_DEPCRC: - scriptfile_getsymbol(script,&gdepcrc); break; - case T_CRC: - scriptfile_getsymbol(script,&gcrcval); break; - case T_SIZE: - scriptfile_getnumber(script,&gsize); break; - default: - break; - } - - grpinfo_t * const fg = (grpinfo_t *)Xcalloc(1, sizeof(grpinfo_t)); - fg->next = listgrps; - listgrps = fg; - - if (gname) - fg->name = Xstrdup(gname); - - fg->size = gsize; - fg->crcval = gcrcval; - fg->dependency = gdepcrc; - fg->game = gflags; - - if (gdef) - fg->defname = dup_filename(gdef); - } - break; - } - - default: - break; - } - } - - scriptfile_close(script); - scriptfile_clearsymbols(); -} - -static void LoadGameList(void) -{ -#ifndef EDUKE32_STANDALONE - for (size_t i = 0; i < ARRAY_SIZE(internalgrpfiles); i++) - { - grpinfo_t * const fg = (grpinfo_t *)Xcalloc(1, sizeof(grpinfo_t)); - - fg->name = Xstrdup(internalgrpfiles[i].name); - fg->crcval = internalgrpfiles[i].crcval; - fg->size = internalgrpfiles[i].size; - fg->game = internalgrpfiles[i].game; - fg->dependency = internalgrpfiles[i].dependency; - - fg->next = listgrps; - listgrps = fg; - } -#endif - -#ifdef USE_PHYSFS - auto const base = PHYSFS_getBaseDir(); -#else - static char const base[] = "/"; -#endif - BUILDVFS_FIND_REC * const srch = klistpath(base, "*.grpinfo", BUILDVFS_FIND_FILE); - - for (BUILDVFS_FIND_REC *sidx = srch; sidx; sidx = sidx->next) - LoadList(sidx->name); - - klistfree(srch); -} - -static void FreeGameList(void) -{ - while (listgrps) - { - Xfree(listgrps->name); - Xfree(listgrps->defname); - - grpinfo_t * const fg = listgrps->next; - Xfree(listgrps); - listgrps = fg; - } -} - - -#define GRPCACHEFILE "grpfiles.cache" -static struct grpcache -{ - struct grpcache *next; - int32_t size; - int32_t mtime; - int32_t crcval; - char name[BMAX_PATH]; -} -*grpcache = NULL, *usedgrpcache = NULL; - -static int32_t LoadGroupsCache(void) -{ - struct grpcache *fg; - - int32_t fsize, fmtime, fcrcval; - char *fname; - - scriptfile *script; - - script = scriptfile_fromfile(GRPCACHEFILE); - if (!script) return -1; - - while (!scriptfile_eof(script)) - { - if (scriptfile_getstring(script, &fname)) break; // filename - if (scriptfile_getnumber(script, &fsize)) break; // filesize - if (scriptfile_getnumber(script, &fmtime)) break; // modification time - if (scriptfile_getnumber(script, &fcrcval)) break; // crc checksum - - fg = (struct grpcache *)Xcalloc(1, sizeof(struct grpcache)); - fg->next = grpcache; - grpcache = fg; - - Bstrncpy(fg->name, fname, BMAX_PATH); - fg->size = fsize; - fg->mtime = fmtime; - fg->crcval = fcrcval; - } - - scriptfile_close(script); - return 0; -} - -static void FreeGroupsCache(void) -{ - while (grpcache) - { - struct grpcache * const fg = grpcache->next; - Xfree(grpcache); - grpcache = fg; - } -} - -static void RemoveGroup(grpfile_t *igrp) -{ - for (grpfile_t *prev = NULL, *grp = foundgrps; grp; grp=grp->next) - { - if (grp == igrp) - { - if (grp == foundgrps) - foundgrps = grp->next; - else - prev->next = grp->next; - - Xfree((char *)grp->filename); - Xfree(grp); - - return; - } - - prev = grp; - } -} - -grpfile_t * FindGroup(int32_t crcval) -{ - grpfile_t *grp; - - for (grp = foundgrps; grp; grp=grp->next) - { - if (grp->type->crcval == crcval) - return grp; - } - - return NULL; -} - -#ifndef USE_PHYSFS -static grpinfo_t const * FindGrpInfo(int32_t crcval, int32_t size) -{ - grpinfo_t *grpinfo; - - for (grpinfo = listgrps; grpinfo; grpinfo=grpinfo->next) - { - if (grpinfo->crcval == crcval && grpinfo->size == size) - return grpinfo; - } - - return NULL; -} - -static void ProcessGroups(BUILDVFS_FIND_REC *srch) -{ - BUILDVFS_FIND_REC *sidx; - struct grpcache *fg, *fgg; - char *fn; - struct Bstat st; - - static constexpr int ReadSize = 65536; - - auto buf = (uint8_t *)Xmalloc(ReadSize); - - for (sidx = srch; sidx; sidx = sidx->next) - { - for (fg = grpcache; fg; fg = fg->next) - { - if (!Bstrcmp(fg->name, sidx->name)) break; - } - - if (fg) - { - if (findfrompath(sidx->name, &fn)) continue; // failed to resolve the filename - if (Bstat(fn, &st)) - { - Xfree(fn); - continue; - } // failed to stat the file - Xfree(fn); - if (fg->size == (int32_t)st.st_size && fg->mtime == (int32_t)st.st_mtime) - { - grpinfo_t const * const grptype = FindGrpInfo(fg->crcval, fg->size); - if (grptype) - { - grpfile_t * const grp = (grpfile_t *)Xcalloc(1, sizeof(grpfile_t)); - grp->filename = Xstrdup(sidx->name); - grp->type = grptype; - grp->next = foundgrps; - foundgrps = grp; - } - - fgg = (struct grpcache *)Xcalloc(1, sizeof(struct grpcache)); - strcpy(fgg->name, fg->name); - fgg->size = fg->size; - fgg->mtime = fg->mtime; - fgg->crcval = fg->crcval; - fgg->next = usedgrpcache; - usedgrpcache = fgg; - continue; - } - } - - { - int32_t b, fh; - int32_t crcval = 0; - - fh = openfrompath(sidx->name, BO_RDONLY|BO_BINARY, BS_IREAD); - if (fh < 0) continue; - if (Bfstat(fh, &st)) continue; - - initprintf(" Checksumming %s...", sidx->name); - do - { - b = read(fh, buf, ReadSize); - if (b > 0) crcval = Bcrc32((uint8_t *)buf, b, crcval); - } - while (b == ReadSize); - close(fh); - initprintf(" Done\n"); - - grpinfo_t const * const grptype = FindGrpInfo(crcval, st.st_size); - if (grptype) - { - grpfile_t * const grp = (grpfile_t *)Xcalloc(1, sizeof(grpfile_t)); - grp->filename = Xstrdup(sidx->name); - grp->type = grptype; - grp->next = foundgrps; - foundgrps = grp; - } - - fgg = (struct grpcache *)Xcalloc(1, sizeof(struct grpcache)); - Bstrncpy(fgg->name, sidx->name, BMAX_PATH); - fgg->size = st.st_size; - fgg->mtime = st.st_mtime; - fgg->crcval = crcval; - fgg->next = usedgrpcache; - usedgrpcache = fgg; - } - } - - Xfree(buf); -} -#endif - -int32_t ScanGroups(void) -{ -#ifndef USE_PHYSFS - struct grpcache *fg, *fgg; - - initprintf("Searching for game data...\n"); - - LoadGameList(); - LoadGroupsCache(); - - static char const *extensions[] = - { - "*.grp", - "*.ssi", - "*.dat", - }; - - for (char const *extension : extensions) - { - BUILDVFS_FIND_REC *srch = klistpath("/", extension, BUILDVFS_FIND_FILE); - ProcessGroups(srch); - klistfree(srch); - } - - FreeGroupsCache(); - - for (grpfile_t *grp = foundgrps; grp; grp=grp->next) - { - if (grp->type->dependency) - { - if (FindGroup(grp->type->dependency) == NULL) // couldn't find dependency - { - //initprintf("removing %s\n", grp->name); - RemoveGroup(grp); - grp = foundgrps; - // start from the beginning so we can remove anything that depended on this grp - continue; - } - } - } - - if (usedgrpcache) - { - int32_t i = 0; - buildvfs_FILE fp = buildvfs_fopen_write(GRPCACHEFILE); - if (fp) - { - for (fg = usedgrpcache; fg; fg=fgg) - { - fgg = fg->next; - fprintf(fp, "\"%s\" %d %d %d\n", fg->name, fg->size, fg->mtime, fg->crcval); - Xfree(fg); - i++; - } - buildvfs_fclose(fp); - } -// initprintf("Found %d recognized GRP %s.\n",i,i>1?"files":"file"); - - return 0; - } - - initprintf("Found no recognized game data!\n"); -#endif - - return 0; -} - - -void FreeGroups(void) -{ - while (foundgrps) - { - Xfree((char *)foundgrps->filename); - grpfile_t * const fg = foundgrps->next; - Xfree(foundgrps); - foundgrps = fg; - } - - FreeGameList(); -} -END_PS_NS diff --git a/source/exhumed/src/grpscan.h b/source/exhumed/src/grpscan.h deleted file mode 100644 index 4616f2f85..000000000 --- a/source/exhumed/src/grpscan.h +++ /dev/null @@ -1,80 +0,0 @@ -//------------------------------------------------------------------------- -/* -Copyright (C) 2010 EDuke32 developers and contributors - -This file is part of EDuke32. - -EDuke32 is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License version 2 -as published by the Free Software Foundation. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - -See the GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -*/ -//------------------------------------------------------------------------- - -#ifndef grpscan_h_ -#define grpscan_h_ - -BEGIN_PS_NS - -#define MAXLISTNAMELEN 32 - -// List of internally-known GRP files -#define POWERSLAVE_CRC (int32_t)0x303CBD89 -// TODO: -#define EXHUMED_CRC (int32_t)0xE3B172F1 - -#define GAMEFLAG_POWERSLAVE 0x00000001 -#define GAMEFLAG_EXHUMED 0x00000002 -//#define GAMEFLAG_ADDON 0x00000010 -//#define GAMEFLAG_SHAREWARE 0x00000020 -#define GAMEFLAGMASK 0x000000FF // flags allowed from grpinfo - -typedef struct internalgrpinfo_t { - char const *name; - int32_t const crcval; - int32_t const size; - int32_t const game; - int32_t const dependency; - // char const *scriptname; - // void(*postprocessing)(int32_t); -} internalgrpinfo_t; - -typedef struct grpinfo_t { - char *name; - int32_t crcval; - int32_t size; - int32_t game; - int32_t dependency; - // char *scriptname; - char *defname; - // char *rtsname; - // void (*postprocessing)(int32_t); - struct grpinfo_t *next; -} grpinfo_t; - -typedef struct grpfile_t { - char *filename; - struct grpinfo_t const *type; - struct grpfile_t *next; -} grpfile_t; - -extern grpfile_t *foundgrps; -extern grpinfo_t *listgrps; - -extern grpfile_t * FindGroup(int32_t crcval); - -int32_t ScanGroups(void); -void FreeGroups(void); - -END_PS_NS - -#endif diff --git a/source/exhumed/src/gun.cpp b/source/exhumed/src/gun.cpp index 9af55f69a..6b73874c0 100644 --- a/source/exhumed/src/gun.cpp +++ b/source/exhumed/src/gun.cpp @@ -32,7 +32,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "grenade.h" #include "lighting.h" #include "light.h" -#include "input.h" +#include "ps_input.h" #include "util.h" #include "anims.h" #include "runlist.h" diff --git a/source/exhumed/src/init.cpp b/source/exhumed/src/init.cpp index fd75808b3..7427315d5 100644 --- a/source/exhumed/src/init.cpp +++ b/source/exhumed/src/init.cpp @@ -40,7 +40,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "menu.h" #include "lighting.h" #include "anims.h" -#include "input.h" +#include "ps_input.h" #include "util.h" #include #include @@ -449,7 +449,7 @@ void InstallEngine() { buildvfs_chdir(cwd); if (artLoadFiles("tiles000.art", MAXCACHE1DSIZE) < 0) - bail2dos("Failed loading art."); + I_Error("Failed loading art."); } buildvfs_chdir(cwd); #ifndef __ANDROID__ //This crashes on *some* Android devices. Small onetime memory leak. TODO fix above function @@ -457,7 +457,7 @@ void InstallEngine() #endif } else if (artLoadFiles("tiles000.art",MAXCACHE1DSIZE) < 0) - bail2dos("Failed loading art."); + I_Error("Failed loading art."); // TEMP @@ -502,7 +502,7 @@ void InstallEngine() if (++resIdx == validmodecnt) { if (bpp == 8) - bail2dos("Fatal error: unable to set any video mode!"); + I_Error("Fatal error: unable to set any video mode!"); resIdx = savedIdx; bpp = 8; diff --git a/source/exhumed/src/input.cpp b/source/exhumed/src/input.cpp index 44379b185..265ece5ce 100644 --- a/source/exhumed/src/input.cpp +++ b/source/exhumed/src/input.cpp @@ -16,7 +16,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ //------------------------------------------------------------------------- #include "ns.h" -#include "input.h" +#include "ps_input.h" #include "engine.h" #include "exhumed.h" #include "player.h" @@ -73,7 +73,7 @@ void InitInput() void ClearSpaceBar(short nPlayer) { sPlayerInput[nPlayer].buttons &= 0x0FB; - CONTROL_ClearButton(gamefunc_Open); + buttonMap.ClearButton(gamefunc_Open); } void GetLocalInput() @@ -81,22 +81,22 @@ void GetLocalInput() int i; for (i = 6; i >= 0; i--) { - if (BUTTON(gamefunc_Weapon_1+i)) + if (buttonMap.ButtonDown(gamefunc_Weapon_1+i)) break; } i++; if (PlayerList[nLocalPlayer].nHealth) { - lLocalButtons = (BUTTON(gamefunc_Crouch) << 4) | (BUTTON(gamefunc_Fire) << 3) - | (BUTTON(gamefunc_Jump)<<0) | (i<<13); + lLocalButtons = (buttonMap.ButtonDown(gamefunc_Crouch) << 4) | (buttonMap.ButtonDown(gamefunc_Fire) << 3) + | (buttonMap.ButtonDown(gamefunc_Jump)<<0) | (i<<13); } else { lLocalButtons = 0; } - lLocalButtons |= BUTTON(gamefunc_Open) << 2; + lLocalButtons |= buttonMap.ButtonDown(gamefunc_Open) << 2; // TODO ExecRecord(&sPlayerInput[nLocalPlayer], sizeof(PlayerInput)); } diff --git a/source/exhumed/src/items.cpp b/source/exhumed/src/items.cpp index 1a1fc56bf..06d0bc356 100644 --- a/source/exhumed/src/items.cpp +++ b/source/exhumed/src/items.cpp @@ -26,7 +26,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "engine.h" #include "random.h" #include "init.h" -#include "input.h" +#include "ps_input.h" #include "object.h" BEGIN_PS_NS diff --git a/source/exhumed/src/lavadude.cpp b/source/exhumed/src/lavadude.cpp index 9d96cf203..c757654ef 100644 --- a/source/exhumed/src/lavadude.cpp +++ b/source/exhumed/src/lavadude.cpp @@ -223,7 +223,7 @@ void FuncLava(int a, int nDamage, int nRun) { default: { - DebugOut("unknown msg %d for Lava\n", a & 0x7F0000); + Printf("unknown msg %d for Lava\n", a & 0x7F0000); return; } diff --git a/source/exhumed/src/lion.cpp b/source/exhumed/src/lion.cpp index 5c5ba7e39..ccdc5f1b9 100644 --- a/source/exhumed/src/lion.cpp +++ b/source/exhumed/src/lion.cpp @@ -138,7 +138,7 @@ void FuncLion(int a, int nDamage, int nRun) { default: { - DebugOut("unknown msg %d for Lion\n", nMessage); + Printf("unknown msg %d for Lion\n", nMessage); return; } diff --git a/source/exhumed/src/menu.cpp b/source/exhumed/src/menu.cpp index 98c02f0fe..85c0d8690 100644 --- a/source/exhumed/src/menu.cpp +++ b/source/exhumed/src/menu.cpp @@ -31,7 +31,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "sound.h" #include "names.h" #include "init.h" -#include "input.h" +#include "ps_input.h" #include "gun.h" #include "view.h" #include "object.h" diff --git a/source/exhumed/src/movie.cpp b/source/exhumed/src/movie.cpp index c70d911d8..41065c3c2 100644 --- a/source/exhumed/src/movie.cpp +++ b/source/exhumed/src/movie.cpp @@ -58,7 +58,7 @@ palette_t moviepal[256]; int ReadFrame(FILE *fp) { static int nFrame = 0; - DebugOut("Reading frame %d...\n", nFrame); + Printf("Reading frame %d...\n", nFrame); nFrame++; uint8_t nType; @@ -100,14 +100,14 @@ int ReadFrame(FILE *fp) } case kFrameSound: { - DebugOut("Reading sound block size %d...\n", nSize); + Printf("Reading sound block size %d...\n", nSize); // TODO - just skip for now fseek(fp, nSize, SEEK_CUR); continue; } case kFrameImage: { - DebugOut("Reading image block size %d...\n", nSize); + Printf("Reading image block size %d...\n", nSize); if (nSize == 0) { continue; } @@ -173,11 +173,11 @@ void PlayMovie(const char *fileName) FILE *fp = fopen(buffer, "rb"); if (fp == NULL) { - DebugOut("Can't open movie file '%s' on CD-ROM\n", buffer); + Printf("Can't open movie file '%s' on CD-ROM\n", buffer); fp = fopen(fileName, "rb"); if (fp == NULL) { - DebugOut("Can't open movie file on hard drive\n"); + Printf("Can't open movie file on hard drive\n"); return; } } diff --git a/source/exhumed/src/mummy.cpp b/source/exhumed/src/mummy.cpp index 220a71b90..a014aa6a9 100644 --- a/source/exhumed/src/mummy.cpp +++ b/source/exhumed/src/mummy.cpp @@ -523,7 +523,7 @@ void FuncMummy(int a, int nDamage, int nRun) default: { - DebugOut("unknown msg %d for Mummy\n", a & 0x7F0000); + Printf("unknown msg %d for Mummy\n", a & 0x7F0000); break; } } diff --git a/source/exhumed/src/network.cpp b/source/exhumed/src/network.cpp index d72a0b07f..14492be05 100644 --- a/source/exhumed/src/network.cpp +++ b/source/exhumed/src/network.cpp @@ -21,7 +21,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "typedefs.h" #include "network.h" #include "serial.h" -#include "input.h" +#include "ps_input.h" BEGIN_PS_NS diff --git a/source/exhumed/src/object.cpp b/source/exhumed/src/object.cpp index cbc033518..b9b08790e 100644 --- a/source/exhumed/src/object.cpp +++ b/source/exhumed/src/object.cpp @@ -797,7 +797,7 @@ void InitWallFace() int BuildWallFace(short nChannel, short nWall, short nCount, ...) { if (WallFaceCount <= 0) { - bail2dos("Too many wall faces!\n"); + I_Error("Too many wall faces!\n"); } WallFaceCount--; @@ -898,7 +898,7 @@ int BuildSlide(int nChannel, int edx, int ebx, int ecx, int arg1, int arg2, int int nVal = ecx; if (SlideCount <= 0) { - bail2dos("Too many slides!\n"); + I_Error("Too many slides!\n"); return -1; } @@ -1162,7 +1162,7 @@ int BuildTrap(int nSprite, int edx, int ebx, int ecx) int var_10 = ecx; if (nTraps >= kMaxTraps) { - bail2dos("Too many traps!\n"); + I_Error("Too many traps!\n"); } short nTrap = nTraps; @@ -1828,7 +1828,7 @@ void FuncEnergyBlock(int a, int nDamage, int nRun) int BuildObject(short nSprite, int nOjectType, int nHitag) { if (ObjectCount >= kMaxObjects) { - bail2dos("Too many objects!\n"); + I_Error("Too many objects!\n"); } short nObject = ObjectCount; @@ -2139,7 +2139,7 @@ FUNCOBJECT_GOTO: void BuildDrip(int nSprite) { if (nDrips >= kMaxDrips) { - bail2dos("Too many drips!\n"); + I_Error("Too many drips!\n"); } sDrip[nDrips].nSprite = nSprite; @@ -2239,7 +2239,7 @@ void SnapBobs(short nSectorA, short nSectorB) void AddSectorBob(int nSector, int nHitag, int bx) { if (nBobs >= kMaxBobs) { - bail2dos("Too many bobs!\n"); + I_Error("Too many bobs!\n"); } sBob[nBobs].field_3 = bx; @@ -2283,7 +2283,7 @@ int FindTrail(int nVal) void ProcessTrailSprite(int nSprite, int nLotag, int nHitag) { if (nTrailPoints >= 100) { - bail2dos("Too many trail point sprites (900-949)... increase MAX_TRAILPOINTS\n"); + I_Error("Too many trail point sprites (900-949)... increase MAX_TRAILPOINTS\n"); } short nPoint = nTrailPoints; @@ -2347,7 +2347,7 @@ void ProcessTrailSprite(int nSprite, int nLotag, int nHitag) void AddMovingSector(int nSector, int edx, int ebx, int ecx) { if (nMoveSects >= kMaxMoveSects) { - bail2dos("Too many moving sectors\n"); + I_Error("Too many moving sectors\n"); } CreatePushBlock(nSector); diff --git a/source/exhumed/src/osdcmds.cpp b/source/exhumed/src/osdcmds.cpp index d4e1fd26c..892652c62 100644 --- a/source/exhumed/src/osdcmds.cpp +++ b/source/exhumed/src/osdcmds.cpp @@ -48,7 +48,7 @@ int osdcmd_restartvid(osdcmdptr_t UNUSED(parm)) UNREFERENCED_CONST_PARAMETER(parm); videoResetMode(); if (videoSetGameMode(gSetup.fullscreen,gSetup.xdim,gSetup.ydim,gSetup.bpp,0)) - bail2dos("restartvid: Reset failed...\n"); + I_Error("restartvid: Reset failed...\n"); onvideomodechange(gSetup.bpp>8); UpdateScreenSize(); @@ -92,7 +92,7 @@ static int osdcmd_vidmode(osdcmdptr_t parm) { initprintf("vidmode: Mode change failed!\n"); if (videoSetGameMode(gSetup.fullscreen, gSetup.xdim, gSetup.ydim, gSetup.bpp, upscalefactor)) - bail2dos("vidmode: Reset failed!\n"); + I_Error("vidmode: Reset failed!\n"); } gSetup.bpp = newbpp; gSetup.xdim = newwidth; @@ -142,31 +142,6 @@ static int osdcmd_button(osdcmdptr_t parm) return OSDCMD_OK; } -static int osdcmd_unbound(osdcmdptr_t parm) -{ - if (parm->numparms != 1) - return OSDCMD_OK; - - int const gameFunc = CONFIG_FunctionNameToNum(parm->parms[0]); - - if (gameFunc != -1) - KeyboardKeys[gameFunc][0] = 0; - - return OSDCMD_OK; -} - -static int osdcmd_screenshot(osdcmdptr_t parm) -{ -// KB_ClearKeysDown(); - static const char *fn = "capt0000.png"; - - if (parm->numparms == 1 && !Bstrcasecmp(parm->parms[0], "tga")) - videoCaptureScreenTGA(fn, 0); - else videoCaptureScreen(fn, 0); - - return OSDCMD_OK; -} - static int osdcmd_cvar_set_game(osdcmdptr_t parm) { int const r = osdcmd_cvar_set(parm); @@ -380,36 +355,13 @@ int32_t registerosdcommands(void) //OSD_RegisterFunction("restartmap", "restartmap: restarts the current map", osdcmd_restartmap); //OSD_RegisterFunction("restartsound","restartsound: reinitializes the sound system",osdcmd_restartsound); OSD_RegisterFunction("restartvid","restartvid: reinitializes the video mode",osdcmd_restartvid); - OSD_RegisterFunction("screenshot","screenshot [format]: takes a screenshot.", osdcmd_screenshot); //OSD_RegisterFunction("spawn","spawn [palnum] [cstat] [ang] [x y z]: spawns a sprite with the given properties",osdcmd_spawn); - OSD_RegisterFunction("unbound", NULL, osdcmd_unbound); - OSD_RegisterFunction("vidmode","vidmode : change the video mode",osdcmd_vidmode); -#ifdef USE_OPENGL - baselayer_osdcmd_vidmode_func = osdcmd_vidmode; -#endif return 0; } -void GAME_onshowosd(int shown) -{ - // G_UpdateScreenArea(); - - mouseLockToWindow((!shown) + 2); - - //osdshown = shown; - - // XXX: it's weird to fake a keypress like this. -// if (numplayers == 1 && ((shown && !ud.pause_on) || (!shown && ud.pause_on))) -// KB_KeyDown[sc_Pause] = 1; -} - -void GAME_clearbackground(int numcols, int numrows) -{ - COMMON_clearbackground(numcols, numrows); -} END_PS_NS diff --git a/source/exhumed/src/player.cpp b/source/exhumed/src/player.cpp index 132a97433..d0ffef9d6 100644 --- a/source/exhumed/src/player.cpp +++ b/source/exhumed/src/player.cpp @@ -31,7 +31,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "bubbles.h" #include "random.h" #include "ra.h" -#include "input.h" +#include "ps_input.h" #include "light.h" #include "status.h" #include "mouse.h" @@ -194,7 +194,7 @@ void PlayerInterruptKeys() } // JBF: Run key behaviour is selectable - int const playerRunning = (runkey_mode) ? (BUTTON(gamefunc_Run) | auto_run) : (auto_run ^ BUTTON(gamefunc_Run)); + int const playerRunning = (runkey_mode) ? (buttonMap.ButtonDown(gamefunc_Run) | auto_run) : (auto_run ^ buttonMap.ButtonDown(gamefunc_Run)); int const turnAmount = playerRunning ? 12 : 8; int const keyMove = playerRunning ? 12 : 6; constexpr int const analogTurnAmount = 12; @@ -202,7 +202,7 @@ void PlayerInterruptKeys() int fvel = 0, svel = 0; fix16_t q16avel = 0, q16horz = 0; - if (BUTTON(gamefunc_Strafe)) + if (buttonMap.ButtonDown(gamefunc_Strafe)) { static int strafeyaw; @@ -228,12 +228,12 @@ void PlayerInterruptKeys() svel -= info.dx * keyMove / analogExtent; fvel -= info.dz * keyMove / analogExtent; - if (BUTTON(gamefunc_Strafe)) + if (buttonMap.ButtonDown(gamefunc_Strafe)) { - if (BUTTON(gamefunc_Turn_Left)) + if (buttonMap.ButtonDown(gamefunc_Turn_Left)) svel -= -keyMove; - if (BUTTON(gamefunc_Turn_Right)) + if (buttonMap.ButtonDown(gamefunc_Turn_Right)) svel -= keyMove; } else @@ -241,14 +241,14 @@ void PlayerInterruptKeys() static int turn = 0; static int counter = 0; // normal, non strafing movement - if (BUTTON(gamefunc_Turn_Left)) + if (buttonMap.ButtonDown(gamefunc_Turn_Left)) { turn -= 2; if (turn < -turnAmount) turn = -turnAmount; } - else if (BUTTON(gamefunc_Turn_Right)) + else if (buttonMap.ButtonDown(gamefunc_Turn_Right)) { turn += 2; @@ -274,16 +274,16 @@ void PlayerInterruptKeys() q16avel += fix16_from_int(turn<<2); } - if (BUTTON(gamefunc_Strafe_Left)) + if (buttonMap.ButtonDown(gamefunc_Strafe_Left)) svel += keyMove; - if (BUTTON(gamefunc_Strafe_Right)) + if (buttonMap.ButtonDown(gamefunc_Strafe_Right)) svel += -keyMove; - if (BUTTON(gamefunc_Move_Forward)) + if (buttonMap.ButtonDown(gamefunc_Move_Forward)) fvel += keyMove; - if (BUTTON(gamefunc_Move_Backward)) + if (buttonMap.ButtonDown(gamefunc_Move_Backward)) fvel += -keyMove; fvel = clamp(fvel, -12, 12); @@ -312,7 +312,7 @@ void PlayerInterruptKeys() inita &= kAngleMask; - if (BUTTON(gamefunc_Run)) + if (buttonMap.ButtonDown(gamefunc_Run)) { nXVel = Cos(inita) * 12; nYVel = Sin(inita) * 12; @@ -324,12 +324,12 @@ void PlayerInterruptKeys() } // loc_18E60 - if (BUTTON(gamefunc_Move_Forward)) + if (buttonMap.ButtonDown(gamefunc_Move_Forward)) { lPlayerXVel += nXVel; lPlayerYVel += nYVel; } - else if (BUTTON(gamefunc_Move_Backward)) + else if (buttonMap.ButtonDown(gamefunc_Move_Backward)) { lPlayerXVel -= nXVel; lPlayerYVel -= nYVel; @@ -346,10 +346,10 @@ void PlayerInterruptKeys() } if (mouseaiming) - aimmode = BUTTON(gamefunc_Mouseview); + aimmode = buttonMap.ButtonDown(gamefunc_Mouseview); else { - CONTROL_ClearButton(gamefunc_Mouseview); + buttonMap.ClearButton(gamefunc_Mouseview); aimmode = !aimmode; } @@ -371,7 +371,7 @@ void PlayerInterruptKeys() } else { - if (BUTTON(gamefunc_Run)) + if (buttonMap.ButtonDown(gamefunc_Run)) { lPlayerXVel += Cos(inita) * ((-info.mousey) >> 7); lPlayerYVel += Sin(inita) * ((-info.mousey) >> 7); @@ -385,33 +385,33 @@ void PlayerInterruptKeys() } // loc_18FD4 - if (BUTTON(gamefunc_Strafe_Left)) + if (buttonMap.ButtonDown(gamefunc_Strafe_Left)) { lPlayerXVel += nYVel / 4; lPlayerYVel -= nXVel / 4; } - else if (BUTTON(gamefunc_Strafe_Right)) + else if (buttonMap.ButtonDown(gamefunc_Strafe_Right)) { lPlayerXVel -= nYVel / 4; lPlayerYVel += nXVel / 4; } else { - if (BUTTON(gamefunc_Strafe)) + if (buttonMap.ButtonDown(gamefunc_Strafe)) { - if (BUTTON(gamefunc_Turn_Left)) + if (buttonMap.ButtonDown(gamefunc_Turn_Left)) { lPlayerXVel += nYVel; lPlayerYVel -= nXVel; } - else if (BUTTON(gamefunc_Turn_Right)) + else if (buttonMap.ButtonDown(gamefunc_Turn_Right)) { lPlayerXVel -= nYVel; lPlayerYVel += nXVel; } else { - if (BUTTON(gamefunc_Run)) + if (buttonMap.ButtonDown(gamefunc_Run)) { lPlayerXVel -= Sin(inita) * (info.dyaw >> 5); lPlayerYVel += Sin(inita + 512) * (info.dyaw >> 5); @@ -426,11 +426,11 @@ void PlayerInterruptKeys() else { // normal, non strafing movement - if (BUTTON(gamefunc_Turn_Left)) + if (buttonMap.ButtonDown(gamefunc_Turn_Left)) { nPlayerDAng -= 2; - if (BUTTON(gamefunc_Run)) + if (buttonMap.ButtonDown(gamefunc_Run)) { if (nPlayerDAng < -12) nPlayerDAng = -12; @@ -440,11 +440,11 @@ void PlayerInterruptKeys() nPlayerDAng = -8; } } - else if (BUTTON(gamefunc_Turn_Right)) + else if (buttonMap.ButtonDown(gamefunc_Turn_Right)) { nPlayerDAng += 2; - if (BUTTON(gamefunc_Run)) + if (buttonMap.ButtonDown(gamefunc_Run)) { if (nPlayerDAng > 12) nPlayerDAng = 12; @@ -1050,7 +1050,7 @@ void DoKenTest() } if (nextspritesect[i] == i) { - bail2dos("ERROR in Ken's linked list!\n"); + I_Error("ERROR in Ken's linked list!\n"); } } } @@ -3084,7 +3084,7 @@ do_default_b: if (nPlayer == nLocalPlayer) { // TODO - tidy / consolidate repeating blocks of code here? - if (BUTTON(gamefunc_Look_Up)) + if (buttonMap.ButtonDown(gamefunc_Look_Up)) { bLockPan = kFalse; if (nVertPan[nPlayer] < F16(180)) { @@ -3094,7 +3094,7 @@ do_default_b: bPlayerPan = kTrue; nDestVertPan[nPlayer] = nVertPan[nPlayer]; } - else if (BUTTON(gamefunc_Look_Down)) + else if (buttonMap.ButtonDown(gamefunc_Look_Down)) { bLockPan = kFalse; if (nVertPan[nPlayer] > F16(4)) { @@ -3104,14 +3104,14 @@ do_default_b: bPlayerPan = kTrue; nDestVertPan[nPlayer] = nVertPan[nPlayer]; } - else if (BUTTON(gamefunc_Look_Straight)) + else if (buttonMap.ButtonDown(gamefunc_Look_Straight)) { bLockPan = kFalse; bPlayerPan = kFalse; nVertPan[nPlayer] = F16(92); nDestVertPan[nPlayer] = F16(92); } - else if (BUTTON(gamefunc_Aim_Up)) + else if (buttonMap.ButtonDown(gamefunc_Aim_Up)) { bLockPan = kTrue; if (nVertPan[nPlayer] < F16(180)) { @@ -3121,7 +3121,7 @@ do_default_b: bPlayerPan = kTrue; nDestVertPan[nPlayer] = nVertPan[nPlayer]; } - else if (BUTTON(gamefunc_Aim_Down)) + else if (buttonMap.ButtonDown(gamefunc_Aim_Down)) { bLockPan = kTrue; if (nVertPan[nPlayer] > F16(4)) { diff --git a/source/exhumed/src/input.h b/source/exhumed/src/ps_input.h similarity index 100% rename from source/exhumed/src/input.h rename to source/exhumed/src/ps_input.h diff --git a/source/exhumed/src/queen.cpp b/source/exhumed/src/queen.cpp index 8fa7b2c07..625f0ec56 100644 --- a/source/exhumed/src/queen.cpp +++ b/source/exhumed/src/queen.cpp @@ -322,7 +322,7 @@ void BuildTail() tailspr[i] = nTailSprite; if (nTailSprite < 0) { - bail2dos("Can't create queen's tail!\n"); + I_Error("Can't create queen's tail!\n"); } sprite[nTailSprite].lotag = runlist_HeadRun() + 1; diff --git a/source/exhumed/src/ra.cpp b/source/exhumed/src/ra.cpp index a796f7003..47b79eff5 100644 --- a/source/exhumed/src/ra.cpp +++ b/source/exhumed/src/ra.cpp @@ -23,7 +23,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "player.h" #include "move.h" #include "sequence.h" -#include "input.h" +#include "ps_input.h" #include "gun.h" #include "bullet.h" #include @@ -162,7 +162,7 @@ void FuncRa(int a, int nDamage, int nRun) { default: { - DebugOut("unknown msg %d for Ra\n", a & 0x7F0000); + Printf("unknown msg %d for Ra\n", a & 0x7F0000); return; } diff --git a/source/exhumed/src/rat.cpp b/source/exhumed/src/rat.cpp index 233c19f5f..c8547f0a5 100644 --- a/source/exhumed/src/rat.cpp +++ b/source/exhumed/src/rat.cpp @@ -191,7 +191,7 @@ void FuncRat(int a, int nDamage, int nRun) { default: { - DebugOut("unknown msg %d for Rathead\n", nMessage); + Printf("unknown msg %d for Rathead\n", nMessage); return; } diff --git a/source/exhumed/src/rex.cpp b/source/exhumed/src/rex.cpp index c7f90cb0e..9e56f3256 100644 --- a/source/exhumed/src/rex.cpp +++ b/source/exhumed/src/rex.cpp @@ -145,7 +145,7 @@ void FuncRex(int a, int nDamage, int nRun) { default: { - DebugOut("unknown msg %d for Rex\n", a & 0x7F0000); + Printf("unknown msg %d for Rex\n", a & 0x7F0000); return; } diff --git a/source/exhumed/src/roach.cpp b/source/exhumed/src/roach.cpp index 1281f0f54..f3097c402 100644 --- a/source/exhumed/src/roach.cpp +++ b/source/exhumed/src/roach.cpp @@ -150,7 +150,7 @@ void FuncRoach(int a, int nDamage, int nRun) { default: { - DebugOut("unknown msg %d for Roach\n", a & 0x7F0000); + Printf("unknown msg %d for Roach\n", a & 0x7F0000); return; } diff --git a/source/exhumed/src/runlist.cpp b/source/exhumed/src/runlist.cpp index 421106169..4f9dfb2aa 100644 --- a/source/exhumed/src/runlist.cpp +++ b/source/exhumed/src/runlist.cpp @@ -347,7 +347,7 @@ void runlist_PushMoveRun(int eax) int runlist_PopMoveRun() { if (nStackCount <= 0) { - bail2dos("PopMoveRun() called inappropriately\n"); + I_Error("PopMoveRun() called inappropriately\n"); } nStackCount--; diff --git a/source/exhumed/src/scorp.cpp b/source/exhumed/src/scorp.cpp index ca1bef335..4d3633f97 100644 --- a/source/exhumed/src/scorp.cpp +++ b/source/exhumed/src/scorp.cpp @@ -142,7 +142,7 @@ void FuncScorp(int a, int nDamage, int nRun) { default: { - DebugOut("unknown msg %d for Scorp\n", a & 0x7F0000); + Printf("unknown msg %d for Scorp\n", a & 0x7F0000); return; } diff --git a/source/exhumed/src/sequence.cpp b/source/exhumed/src/sequence.cpp index 1ca59fc99..9769958a5 100644 --- a/source/exhumed/src/sequence.cpp +++ b/source/exhumed/src/sequence.cpp @@ -198,7 +198,7 @@ int seq_ReadSequence(const char *seqName) return 0; } else { - bail2dos("Not enough sequences available! Increase array!\n"); + I_Error("Not enough sequences available! Increase array!\n"); } } @@ -225,7 +225,7 @@ int seq_ReadSequence(const char *seqName) return 0; } else { - bail2dos("Not enough frames available! Increase FRAMEMAX!\n"); + I_Error("Not enough frames available! Increase FRAMEMAX!\n"); } } @@ -251,7 +251,7 @@ int seq_ReadSequence(const char *seqName) return 0; } else { - bail2dos("Not enough chunks available! Increase CHUNKMAX!\n"); + I_Error("Not enough chunks available! Increase CHUNKMAX!\n"); } } diff --git a/source/exhumed/src/set.cpp b/source/exhumed/src/set.cpp index 15f4233da..9afc88813 100644 --- a/source/exhumed/src/set.cpp +++ b/source/exhumed/src/set.cpp @@ -219,7 +219,7 @@ void FuncSoul(int pA, int, int nRun) return; default: - DebugOut("unknown msg %d for Soul\n", nMessage); + Printf("unknown msg %d for Soul\n", nMessage); } } @@ -239,7 +239,7 @@ void FuncSet(int a, int nDamage, int nRun) { default: { - DebugOut("unknown msg %d for Set\n", nMessage); + Printf("unknown msg %d for Set\n", nMessage); return; } diff --git a/source/exhumed/src/snake.cpp b/source/exhumed/src/snake.cpp index 72c4e5a19..c9ac479dc 100644 --- a/source/exhumed/src/snake.cpp +++ b/source/exhumed/src/snake.cpp @@ -24,7 +24,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "runlist.h" #include "sequence.h" #include "bullet.h" -#include "input.h" +#include "ps_input.h" #include "anims.h" #include "lighting.h" #include "sound.h" @@ -419,7 +419,7 @@ SEARCH_ENEMY: default: { - DebugOut("unknown msg %x for bullet\n", a & 0x7F0000); + Printf("unknown msg %x for bullet\n", a & 0x7F0000); break; } } diff --git a/source/exhumed/src/sound.cpp b/source/exhumed/src/sound.cpp index 091cbcbe8..30112bc85 100644 --- a/source/exhumed/src/sound.cpp +++ b/source/exhumed/src/sound.cpp @@ -350,9 +350,9 @@ void InitFX(void) if (FX_Init(NumVoices, NumChannels, MixRate, initdata) != FX_Ok) { - DebugOut("Error initializing sound card!\n"); + Printf("Error initializing sound card!\n"); initprintf("Error initializing sound card!\n"); - DebugOut("ERROR: %s\n", FX_ErrorString(FX_Error)); + Printf("ERROR: %s\n", FX_ErrorString(FX_Error)); return; } @@ -491,7 +491,7 @@ int LoadSound(const char *sound) } if (i >= kMaxSounds) - bail2dos("Too many sounds being loaded... increase array size\n"); + I_Error("Too many sounds being loaded... increase array size\n"); strncpy(szSoundName[i], sound, kMaxSoundNameLen); @@ -515,14 +515,14 @@ int LoadSound(const char *sound) SoundLen[i] = nSize; g_cache.allocateBlock((intptr_t*)&SoundBuf[i], nSize, &SoundLock[i]); if (!SoundBuf[i]) - bail2dos("Error allocating buf '%s' to %lld (size=%ld)!\n", buffer, (intptr_t)&SoundBuf[i], nSize); + I_Error("Error allocating buf '%s' to %lld (size=%ld)!\n", buffer, (intptr_t)&SoundBuf[i], nSize); if (kread(hVoc, SoundBuf[i], nSize) != nSize) - bail2dos("Error reading '%s'!\n", buffer); + I_Error("Error reading '%s'!\n", buffer); } else { - bail2dos("Unable to open sound '%s'!\n", buffer); + I_Error("Unable to open sound '%s'!\n", buffer); SoundBuf[i] = NULL; SoundLen[i] = 0; //return hVoc; @@ -552,7 +552,7 @@ void LoadFX(void) { StaticSound[i] = LoadSound(SoundFiles[i]); if (StaticSound[i] < 0) - bail2dos("error loading static sound #%d ('%.8s')\n", i, SoundFiles[i]); + I_Error("error loading static sound #%d ('%.8s')\n", i, SoundFiles[i]); } } diff --git a/source/exhumed/src/spider.cpp b/source/exhumed/src/spider.cpp index cd4accf89..d1b027b03 100644 --- a/source/exhumed/src/spider.cpp +++ b/source/exhumed/src/spider.cpp @@ -429,7 +429,7 @@ case_3: default: { - DebugOut("unknown msg %d for Spider\n", a & 0x7F0000); + Printf("unknown msg %d for Spider\n", a & 0x7F0000); break; } } diff --git a/source/exhumed/src/status.cpp b/source/exhumed/src/status.cpp index 24ab8c759..ce96bba01 100644 --- a/source/exhumed/src/status.cpp +++ b/source/exhumed/src/status.cpp @@ -152,7 +152,7 @@ void RefreshStatus() { short nLives = nPlayerLives[nLocalPlayer]; if (nLives < 0 || nLives > kMaxPlayerLives) { - bail2dos("illegal value for nPlayerLives #%d\n", nLocalPlayer); + I_Error("illegal value for nPlayerLives #%d\n", nLocalPlayer); } // draws the red dots that indicate the lives amount diff --git a/source/exhumed/src/switch.cpp b/source/exhumed/src/switch.cpp index f5a2ec809..e0f7a269a 100644 --- a/source/exhumed/src/switch.cpp +++ b/source/exhumed/src/switch.cpp @@ -97,7 +97,7 @@ void InitSwitch() int BuildSwReady(int nChannel, short nLink) { if (SwitchCount <= 0 || nLink < 0) { - bail2dos("Too many switch readys!\n"); + I_Error("Too many switch readys!\n"); return -1; } @@ -149,7 +149,7 @@ int BuildSwPause(int nChannel, int nLink, int ebx) } if (SwitchCount <= 0 || nLink < 0) { - bail2dos("Too many switches!\n"); + I_Error("Too many switches!\n"); return -1; } @@ -240,7 +240,7 @@ void FuncSwPause(int a, int, int nRun) int BuildSwStepOn(int nChannel, int nLink, int nSector) { if (SwitchCount <= 0 || nLink < 0 || nSector < 0) - bail2dos("Too many switches!\n"); + I_Error("Too many switches!\n"); int nSwitch = --SwitchCount; @@ -309,7 +309,7 @@ void FuncSwStepOn(int a, int, int nRun) int BuildSwNotOnPause(int nChannel, int nLink, int nSector, int ecx) { if (SwitchCount <= 0 || nLink < 0 || nSector < 0) - bail2dos("Too many switches!\n"); + I_Error("Too many switches!\n"); int nSwitch = --SwitchCount; @@ -399,7 +399,7 @@ void FuncSwNotOnPause(int a, int, int nRun) int BuildSwPressSector(int nChannel, int nLink, int nSector, int ecx) { if (SwitchCount <= 0 || nLink < 0 || nSector < 0) - bail2dos("Too many switches!\n"); + I_Error("Too many switches!\n"); int nSwitch = --SwitchCount; @@ -471,7 +471,7 @@ void FuncSwPressSector(int a, int, int nRun) int BuildSwPressWall(short nChannel, short nLink, short nWall) { if (SwitchCount <= 0 || nLink < 0 || nWall < 0) { - bail2dos("Too many switches!\n"); + I_Error("Too many switches!\n"); } SwitchCount--; diff --git a/wadsrc/static/demolition/demolition.grpinfo b/wadsrc/static/demolition/demolition.grpinfo index b1561d67b..a6b2b7561 100644 --- a/wadsrc/static/demolition/demolition.grpinfo +++ b/wadsrc/static/demolition/demolition.grpinfo @@ -28,6 +28,9 @@ CRC RR_CRC 0x19D9BC79 RRRA_CRC 0x958018C6 BLOOD_CRC 0xA8FDDA84 + POWERSLAVE_CRC 0x303CBD89 + EXHUMED_CRC 0xE3B172F1 + } @@ -372,3 +375,23 @@ grpinfo defname "sw.def" gamefilter "ShadowWarrior.ShadowWarrior" } + +grpinfo +{ + name "Powerslave" + flags GAMEFLAG_POWERSLAVE + crc POWERSLAVE_CRC + size 27020745 + defname "exhumed.def" + gamefilter "Exhumed.Powerslave" +} + +grpinfo +{ + name "Exhumed" + flags GAMEFLAG_EXHUMED + crc EXHUMED_CRC + size 27108170 + defname "exhumed.def" + gamefilter "Exhumed.Exhumed" +} diff --git a/wadsrc/static/filter/exhumed/demolition/defbinds.txt b/wadsrc/static/filter/exhumed/demolition/defbinds.txt new file mode 100644 index 000000000..08ae25f57 --- /dev/null +++ b/wadsrc/static/filter/exhumed/demolition/defbinds.txt @@ -0,0 +1,66 @@ +W "+Move_Forward" +KP8 "+Move_Forward" +S "+Move_Backward" +KP2 "+Move_Backward" +leftarrow "+Turn_Left" +KP4 "+Turn_Left" +rightarrow "+Turn_Right" +KP6 "+Turn_Right" +LAlt "+Strafe" +RAlt "+Strafe" +RCtrl "+Fire" +E "+Open" +LShift "+Run" +RShift "+Run" +Space "+Jump" +/ "+Jump" +LCtrl "+Crouch" +PgUp "+Look_Up" +KP9 "+Look_Up" +PgDn "+Look_Down" +KP3 "+Look_Down" +Ins "+Look_Left" +KP0 "+Look_Left" +Del "+Look_Right" +KP. "+Look_Right" +A "+Strafe_Left" +D "+Strafe_Right" +Home "+Aim_Up" +KP7 "+Aim_Up" +End "+Aim_Down" +KP1 "+Aim_Down" +1 "+Weapon_1" +2 "+Weapon_2" +3 "+Weapon_3" +4 "+Weapon_4" +5 "+Weapon_5" +6 "+Weapon_6" +7 "+Weapon_7" +Enter "+Inventory" +KP-Enter "+Inventory" +[ "+Inventory_Left" +] "+Inventory_Right" +Backspace "+Turn_Around" +T "+Send_Message" +Tab "+Map" +- "+Shrink_Screen" +KP- "+Shrink_Screen" += "+Enlarge_Screen" +KP+ "+Enlarge_Screen" +KP5 "+Center_View" +Scroll "+Holster_Weapon" +Y "+Show_Opponents_Weapon" +F "+Map_Follow_Mode" +K "+See_Coop_View" +' "+Next_Weapon" +; "+Previous_Weapon" +` "toggleconsole" +Capslock "+AutoRun" +X "+Last_Used_Weapon" +F6 "+Quick_Save" +F9 "+Quick_Load" +F7 "+Third_Person_View" +C "+Toggle_Crouch" +Mouse1 "+Fire" +Mouse2 "+Strafe" +Mouse3 "+Move_Forward" diff --git a/wadsrc/static/filter/exhumed/demolition/leftbinds.txt b/wadsrc/static/filter/exhumed/demolition/leftbinds.txt new file mode 100644 index 000000000..6a6fd5e57 --- /dev/null +++ b/wadsrc/static/filter/exhumed/demolition/leftbinds.txt @@ -0,0 +1,64 @@ +uparrow "+Move_Forward" +KP8 "+Move_Forward" +downarrow "+Move_Backward" +KP2 "+Move_Backward" +leftarrow "+Turn_Left" +KP4 "+Turn_Left" +rightarrow "+Turn_Right" +KP6 "+Turn_Right" +LAlt "+Strafe" +RAlt "+Strafe" +LCtrl "+Fire" +RCtrl "+Fire" +Space "+Open" +LShift "+Run" +RShift "+Run" +A "+Jump" +KP- "+Jump" +Z "+Crouch" +PgUp "+Look_Up" +PgDn "+Look_Down" +Ins "+Look_Left" +Del "+Look_Right" +, "+Strafe_Left" +KP7 "+Strafe_Left" +. "+Strafe_Right" +KP9 "+Strafe_Right" +Home "+Aim_Up" +End "+Aim_Down" +1 "+Weapon_1" +2 "+Weapon_2" +3 "+Weapon_3" +4 "+Weapon_4" +5 "+Weapon_5" +6 "+Weapon_6" +7 "+Weapon_7" +Enter "+Inventory" +KP-Enter "+Inventory" +[ "+Inventory_Left" +] "+Inventory_Right" +Backspace "+Turn_Around" +T "+Send_Message" +Tab "+Map" +- "+Shrink_Screen" += "+Enlarge_Screen" +//Scroll "+Holster_Weapon" +//W "+Show_Opponents_Weapon" +F "+Map_Follow_Mode" +K "+See_Coop_View" +U "+Mouse_Aiming" +I "+Toggle_Crosshair" +//R "+Steroids" +//Q "+Quick_Kick" +' "+Next_Weapon" +; "+Previous_Weapon" +` "toggleconsole" +Capslock "+AutoRun" +F6 "+Quick_Save" +F9 "+Quick_Load" +F7 "+Third_Person_View" +Mouse1 "+Fire" +Mouse2 "+Open" +Mouse3 "+Run" +MWheelUp "+Previous_Weapon" +MWheelDown "+Next_Weapon" diff --git a/wadsrc/static/filter/exhumed/demolition/origbinds.txt b/wadsrc/static/filter/exhumed/demolition/origbinds.txt new file mode 100644 index 000000000..70f2f743d --- /dev/null +++ b/wadsrc/static/filter/exhumed/demolition/origbinds.txt @@ -0,0 +1,69 @@ +uparrow "+Move_Forward" +KP8 "+Move_Forward" +downarrow "+Move_Backward" +KP2 "+Move_Backward" +leftarrow "+Turn_Left" +KP4 "+Turn_Left" +rightarrow "+Turn_Right" +KP6 "+Turn_Right" +LAlt "+Strafe" +RAlt "+Strafe" +LCtrl "+Fire" +RCtrl "+Fire" +Space "+Open" +LShift "+Run" +RShift "+Run" +A "+Jump" +/ "+Jump" +Z "+Crouch" +PgUp "+Look_Up" +KP9 "+Look_Up" +PgDn "+Look_Down" +KP3 "+Look_Down" +Ins "+Look_Left" +KP0 "+Look_Left" +Del "+Look_Right" +KP. "+Look_Right" +, "+Strafe_Left" +. "+Strafe_Right" +Home "+Aim_Up" +KP7 "+Aim_Up" +End "+Aim_Down" +KP1 "+Aim_Down" +1 "+Weapon_1" +2 "+Weapon_2" +3 "+Weapon_3" +4 "+Weapon_4" +5 "+Weapon_5" +6 "+Weapon_6" +7 "+Weapon_7" +Enter "+Inventory" +KP-Enter "+Inventory" +[ "+Inventory_Left" +] "+Inventory_Right" +Backspace "+Turn_Around" +T "+Send_Message" +Tab "+Map" +- "+Shrink_Screen" +KP- "+Shrink_Screen" += "+Enlarge_Screen" +KP+ "+Enlarge_Screen" +KP5 "+Center_View" +//Scroll "+Holster_Weapon" +//W "+Show_Opponents_Weapon" +F "+Map_Follow_Mode" +K "+See_Coop_View" +U "+Mouse_Aiming" +I "+Toggle_Crosshair" +//R "+Steroids" +//` "+Quick_Kick" +' "+Next_Weapon" +; "+Previous_Weapon" +` "toggleconsole" +Capslock "+AutoRun" +F6 "+Quick_Save" +F9 "+Quick_Load" +F7 "+Third_Person_View" +Mouse1 "+Fire" +Mouse2 "+Strafe" +Mouse3 "+Move_Forward"