diff --git a/source/blood/src/blood.cpp b/source/blood/src/blood.cpp index 25fc79991..13350f957 100644 --- a/source/blood/src/blood.cpp +++ b/source/blood/src/blood.cpp @@ -1259,7 +1259,7 @@ RESTART: if (gQuitGame) continue; - OSD_DispatchQueued(); + C_RunDelayedCommands(); ctrlGetInput(); diff --git a/source/blood/src/demo.cpp b/source/blood/src/demo.cpp index 0796a1d20..714e15ebe 100644 --- a/source/blood/src/demo.cpp +++ b/source/blood/src/demo.cpp @@ -27,7 +27,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include #include "common.h" #include "common_game.h" -#include "osd.h" #include "mmulti.h" #include "blood.h" @@ -345,7 +344,7 @@ _DEMOPLAYBACK: } } ready2send = 0; - OSD_DispatchQueued(); + C_RunDelayedCommands(); if (!gDemo.at1) break; ProcessKeys(); diff --git a/source/blood/src/osdcmd.cpp b/source/blood/src/osdcmd.cpp index 4652509b1..cf1038a43 100644 --- a/source/blood/src/osdcmd.cpp +++ b/source/blood/src/osdcmd.cpp @@ -25,7 +25,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "build.h" #include "baselayer.h" -#include "osd.h" #include "compat.h" #include "mmulti.h" #include "common_game.h" @@ -51,7 +50,7 @@ void LevelWarp(int nEpisode, int nLevel); static int osdcmd_map(CCmdFuncPtr parm) { if (parm->numparms != 1) - return OSDCMD_SHOWHELP; + return CCMD_SHOWHELP; char filename[BMAX_PATH]; @@ -61,7 +60,7 @@ static int osdcmd_map(CCmdFuncPtr parm) if (!fileSystem.Lookup(filename, "MAP")) { Printf(TEXTCOLOR_RED "map: file \"%s\" not found.\n", filename); - return OSDCMD_OK; + return CCMD_OK; } for (int i = 0; i < 512; i++) @@ -71,7 +70,7 @@ static int osdcmd_map(CCmdFuncPtr parm) int e = i / kMaxLevels; int m = i % kMaxLevels; LevelWarp(e, m); - return OSDCMD_OK; + return CCMD_OK; } } // Map has not been defined. Treat as user map. @@ -87,13 +86,13 @@ static int osdcmd_map(CCmdFuncPtr parm) gPacketStartGame.levelId = gGameOptions.nLevel; netBroadcastNewGame(); gStartNewGame = 1; - return OSDCMD_OK; + return CCMD_OK; } levelSetupOptions(gGameOptions.nEpisode, gGameOptions.nLevel); StartLevel(&gGameOptions); viewResizeView(gViewSize); - return OSDCMD_OK; + return CCMD_OK; } static int osdcmd_demo(CCmdFuncPtr parm) @@ -101,23 +100,23 @@ static int osdcmd_demo(CCmdFuncPtr parm) if (numplayers > 1) { Printf("Command not allowed in multiplayer\n"); - return OSDCMD_OK; + return CCMD_OK; } //if (g_player[myconnectindex].ps->gm & MODE_GAME) //{ // Printf("demo: Must not be in a game.\n"); - // return OSDCMD_OK; + // return CCMD_OK; //} if (parm->numparms != 1/* && parm->numparms != 2*/) - return OSDCMD_SHOWHELP; + return CCMD_SHOWHELP; gDemo.SetupPlayback(parm->parms[0]); gGameStarted = 0; gDemo.Playback(); - return OSDCMD_OK; + return CCMD_OK; } @@ -126,10 +125,10 @@ static int osdcmd_give(CCmdFuncPtr parm) if (numplayers != 1 || !gGameStarted || gMe->pXSprite->health == 0) { Printf("give: Cannot give while dead or not in a single-player game.\n"); - return OSDCMD_OK; + return CCMD_OK; } - if (parm->numparms != 1) return OSDCMD_SHOWHELP; + if (parm->numparms != 1) return CCMD_SHOWHELP; if (!Bstrcasecmp(parm->parms[0], "all")) { @@ -139,45 +138,45 @@ static int osdcmd_give(CCmdFuncPtr parm) SetArmor(true); SetKeys(true); gCheatMgr.m_bPlayerCheated = true; - return OSDCMD_OK; + return CCMD_OK; } else if (!Bstrcasecmp(parm->parms[0], "health")) { actHealDude(gMe->pXSprite, 200, 200); gCheatMgr.m_bPlayerCheated = true; - return OSDCMD_OK; + return CCMD_OK; } else if (!Bstrcasecmp(parm->parms[0], "weapons")) { SetWeapons(true); gCheatMgr.m_bPlayerCheated = true; - return OSDCMD_OK; + return CCMD_OK; } else if (!Bstrcasecmp(parm->parms[0], "ammo")) { SetAmmo(true); gCheatMgr.m_bPlayerCheated = true; - return OSDCMD_OK; + return CCMD_OK; } else if (!Bstrcasecmp(parm->parms[0], "armor")) { SetArmor(true); gCheatMgr.m_bPlayerCheated = true; - return OSDCMD_OK; + return CCMD_OK; } else if (!Bstrcasecmp(parm->parms[0], "keys")) { SetKeys(true); gCheatMgr.m_bPlayerCheated = true; - return OSDCMD_OK; + return CCMD_OK; } else if (!Bstrcasecmp(parm->parms[0], "inventory")) { SetToys(true); gCheatMgr.m_bPlayerCheated = true; - return OSDCMD_OK; + return CCMD_OK; } - return OSDCMD_SHOWHELP; + return CCMD_SHOWHELP; } static int osdcmd_god(CCmdFuncPtr UNUSED(parm)) @@ -191,7 +190,7 @@ static int osdcmd_god(CCmdFuncPtr UNUSED(parm)) else Printf("god: Not in a single-player game.\n"); - return OSDCMD_OK; + return CCMD_OK; } static int osdcmd_noclip(CCmdFuncPtr UNUSED(parm)) @@ -208,40 +207,40 @@ static int osdcmd_noclip(CCmdFuncPtr UNUSED(parm)) Printf("noclip: Not in a single-player game.\n"); } - return OSDCMD_OK; + return CCMD_OK; } static int osdcmd_activatecheat(CCmdFuncPtr parm) { FString CheatEntry; if (parm->numparms != 1) - return OSDCMD_SHOWHELP; + return CCMD_SHOWHELP; CheatEntry = (char*)(parm->parms[0]); CheatEntry.ToUpper(); if (gCheatMgr.Check((char*)(CheatEntry.GetChars()))) - return OSDCMD_OK; + return CCMD_OK; else { Printf("Unrecognized cheat!: %s\n", parm->parms[0]); - return OSDCMD_OK; + return CCMD_OK; } } static int osdcmd_levelwarp(CCmdFuncPtr parm) { if (parm->numparms != 2) - return OSDCMD_SHOWHELP; + return CCMD_SHOWHELP; int e = atoi(parm->parms[0]); int m = atoi(parm->parms[1]); if (e == 0 || m == 0) { Printf(TEXTCOLOR_RED "Invalid level!: E%sM%s\n", parm->parms[0], parm->parms[1]); - return OSDCMD_OK; + return CCMD_OK; } LevelWarp(e - 1, m - 1); - return OSDCMD_OK; + return CCMD_OK; } int32_t registerosdcommands(void) diff --git a/source/blood/src/view.cpp b/source/blood/src/view.cpp index 8597ccdd6..1705533f1 100644 --- a/source/blood/src/view.cpp +++ b/source/blood/src/view.cpp @@ -29,7 +29,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "build.h" #include "pragmas.h" #include "mmulti.h" -#include "osd.h" #include "common_game.h" #include "aihand.h" diff --git a/source/build/include/baselayer.h b/source/build/include/baselayer.h index a53de437f..f4f8fe953 100644 --- a/source/build/include/baselayer.h +++ b/source/build/include/baselayer.h @@ -8,7 +8,7 @@ #define baselayer_h_ #include "compat.h" -#include "osd.h" +#include "c_dispatch.h" #include "timer.h" #include "c_cvars.h" #include "inputstate.h" diff --git a/source/build/include/osd.h b/source/build/include/osd.h deleted file mode 100644 index e66d4e396..000000000 --- a/source/build/include/osd.h +++ /dev/null @@ -1,30 +0,0 @@ -// On-screen display (ie. console) -// for the Build Engine -// by Jonathon Fowler (jf@jonof.id.au) - -#ifndef osd_h_ -#define osd_h_ - -#include - -#include "compat.h" -#include "printf.h" -#include "c_dispatch.h" - - - -#define OSDCMD_OK CCMD_OK -#define OSDCMD_SHOWHELP CCMD_SHOWHELP - - -// void OSD_Draw(); - -// executes buffered commands -void C_RunDelayedCommands(); -inline void OSD_DispatchQueued(void) -{ - C_RunDelayedCommands(); -} - -#endif // osd_h_ - diff --git a/source/build/src/engine.cpp b/source/build/src/engine.cpp index d486f4d79..a4d675863 100644 --- a/source/build/src/engine.cpp +++ b/source/build/src/engine.cpp @@ -16,7 +16,6 @@ #include "common.h" #include "compat.h" #include "engine_priv.h" -#include "osd.h" #include "palette.h" #include "pragmas.h" #include "scriptfile.h" diff --git a/source/core/inputstate.h b/source/core/inputstate.h index 4e5b9eb71..b77261063 100644 --- a/source/core/inputstate.h +++ b/source/core/inputstate.h @@ -1,15 +1,18 @@ #pragma once #include +#include "compat.h" +#include "printf.h" +#include "c_dispatch.h" #include "tarray.h" #include "scancodes.h" #include "c_bind.h" #include "c_buttons.h" #include "d_event.h" -#include "osd.h" #include "m_joy.h" #include "gamecvars.h" + typedef uint16_t kb_scancode; // This encapsulates the entire game-readable input state which previously was spread out across several files. diff --git a/source/exhumed/src/d_menu.cpp b/source/exhumed/src/d_menu.cpp index a83d04199..3a89957a3 100644 --- a/source/exhumed/src/d_menu.cpp +++ b/source/exhumed/src/d_menu.cpp @@ -21,8 +21,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "ns.h" // Must come before everything else! #include "build.h" -#include "osd.h" -#include "osd.h" #include "exhumed.h" #include "engine.h" #include "sound.h" diff --git a/source/exhumed/src/exhumed.cpp b/source/exhumed/src/exhumed.cpp index c8eade2e1..04394063c 100644 --- a/source/exhumed/src/exhumed.cpp +++ b/source/exhumed/src/exhumed.cpp @@ -784,7 +784,7 @@ void timerhandler() } if (!bInMove) { - OSD_DispatchQueued(); + C_RunDelayedCommands(); } } @@ -2191,7 +2191,7 @@ GAMELOOP: } HandleAsync(); - OSD_DispatchQueued(); + C_RunDelayedCommands(); // Section B if (!CDplaying() && !nFreeze && !nNetPlayerCount) diff --git a/source/exhumed/src/osdcmds.cpp b/source/exhumed/src/osdcmds.cpp index a43c03a66..c2e6e230b 100644 --- a/source/exhumed/src/osdcmds.cpp +++ b/source/exhumed/src/osdcmds.cpp @@ -42,7 +42,7 @@ static int osdcmd_god(CCmdFuncPtr UNUSED(parm)) else Printf("god: Not in a single-player game.\n"); - return OSDCMD_OK; + return CCMD_OK; } static int osdcmd_noclip(CCmdFuncPtr UNUSED(parm)) @@ -58,21 +58,21 @@ static int osdcmd_noclip(CCmdFuncPtr UNUSED(parm)) Printf("noclip: Not in a single-player game.\n"); } - return OSDCMD_OK; + return CCMD_OK; } static int osdcmd_map(CCmdFuncPtr parm) { if (parm->numparms != 1) { - return OSDCMD_SHOWHELP; + return CCMD_SHOWHELP; } FString mapname = parm->parms[0]; if (!fileSystem.Lookup(mapname, "MAP")) { Printf(TEXTCOLOR_RED "map: file \"%s\" not found.\n", mapname.GetChars()); - return OSDCMD_OK; + return CCMD_OK; } // Check if the map is already defined. @@ -82,22 +82,22 @@ static int osdcmd_map(CCmdFuncPtr parm) { levelnew = i; levelnum = i; - return OSDCMD_OK; + return CCMD_OK; } } - return OSDCMD_OK; + return CCMD_OK; } static int osdcmd_changelevel(CCmdFuncPtr parm) { char* p; - if (parm->numparms != 1) return OSDCMD_SHOWHELP; + if (parm->numparms != 1) return CCMD_SHOWHELP; int nLevel = strtol(parm->parms[0], &p, 10); - if (p[0]) return OSDCMD_SHOWHELP; + if (p[0]) return CCMD_SHOWHELP; - if (nLevel < 0) return OSDCMD_SHOWHELP; + if (nLevel < 0) return CCMD_SHOWHELP; int nMaxLevels; @@ -111,13 +111,13 @@ static int osdcmd_changelevel(CCmdFuncPtr parm) if (nLevel > nMaxLevels) { Printf("changelevel: invalid level number\n"); - return OSDCMD_SHOWHELP; + return CCMD_SHOWHELP; } levelnew = nLevel; levelnum = nLevel; - return OSDCMD_OK; + return CCMD_OK; } diff --git a/source/games/duke/src/2d_d.cpp b/source/games/duke/src/2d_d.cpp index 2fd65392b..d05bf6bbc 100644 --- a/source/games/duke/src/2d_d.cpp +++ b/source/games/duke/src/2d_d.cpp @@ -39,6 +39,7 @@ Modifications for JonoF's port by Jonathon Fowler (jf@jonof.id.au) #include "texturemanager.h" #include "buildtiles.h" #include "mapinfo.h" +#include "c_dispatch.h" BEGIN_DUKE_NS diff --git a/source/games/duke/src/2d_r.cpp b/source/games/duke/src/2d_r.cpp index aff2a3f71..2e6128e51 100644 --- a/source/games/duke/src/2d_r.cpp +++ b/source/games/duke/src/2d_r.cpp @@ -37,6 +37,7 @@ Prepared for public release: 03/21/2003 - Charlie Wiederhold, 3D Realms #include "mapinfo.h" #include "screenjob.h" #include "texturemanager.h" +#include "c_dispatch.h" BEGIN_DUKE_NS diff --git a/source/games/duke/src/ccmds.cpp b/source/games/duke/src/ccmds.cpp index 9c37f77b5..d75123b2c 100644 --- a/source/games/duke/src/ccmds.cpp +++ b/source/games/duke/src/ccmds.cpp @@ -33,6 +33,7 @@ Modifications for JonoF's port by Jonathon Fowler (jf@jonof.id.au) #include "sbar.h" #include "mapinfo.h" #include "cheathandler.h" +#include "c_dispatch.h" BEGIN_DUKE_NS diff --git a/source/games/duke/src/cheats.cpp b/source/games/duke/src/cheats.cpp index 26afcee15..850968a0f 100644 --- a/source/games/duke/src/cheats.cpp +++ b/source/games/duke/src/cheats.cpp @@ -38,6 +38,7 @@ source as it is released. #include "c_cvars.h" #include "mapinfo.h" #include "cheathandler.h" +#include "c_dispatch.h" EXTERN_CVAR(Int, developer) diff --git a/source/sw/src/config.cpp b/source/sw/src/config.cpp index 66e1da5a2..7054568d4 100644 --- a/source/sw/src/config.cpp +++ b/source/sw/src/config.cpp @@ -27,7 +27,6 @@ Prepared for public release: 03/28/2005 - Charlie Wiederhold, 3D Realms #include "build.h" #include "baselayer.h" -#include "osd.h" #include "gamecvars.h" #include "settings.h" diff --git a/source/sw/src/d_menu.cpp b/source/sw/src/d_menu.cpp index 07a6127e3..dc1b8ffee 100644 --- a/source/sw/src/d_menu.cpp +++ b/source/sw/src/d_menu.cpp @@ -21,7 +21,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "ns.h" // Must come before everything else! #include "build.h" -#include "osd.h" #include "keys.h" #include "names2.h" diff --git a/source/sw/src/demo.cpp b/source/sw/src/demo.cpp index 93331f1f9..27f65ac02 100644 --- a/source/sw/src/demo.cpp +++ b/source/sw/src/demo.cpp @@ -445,7 +445,7 @@ DemoPlayBack(void) while (totalclock > totalsynctics) { handleevents(); - OSD_DispatchQueued(); + C_RunDelayedCommands(); TRAVERSE_CONNECT(pnum) { diff --git a/source/sw/src/game.cpp b/source/sw/src/game.cpp index 4689e9bba..5294a91bd 100644 --- a/source/sw/src/game.cpp +++ b/source/sw/src/game.cpp @@ -45,7 +45,6 @@ Things required to make savegames work: #include "build.h" #include "baselayer.h" -#include "osd.h" #include "baselayer.h" #include "keys.h" @@ -1629,7 +1628,7 @@ void MenuLevel(void) while (TRUE) { handleevents(); - OSD_DispatchQueued(); + C_RunDelayedCommands(); // taken from top of faketimerhandler // limits checks to max of 40 times a second @@ -2243,7 +2242,7 @@ void Control() while (!QuitFlag) { handleevents(); - OSD_DispatchQueued(); + C_RunDelayedCommands(); NewLevel(); } @@ -2445,7 +2444,7 @@ void RunLevel(void) while (TRUE) { handleevents(); - OSD_DispatchQueued(); + C_RunDelayedCommands(); D_ProcessEvents(); if (LoadGameOutsideMoveLoop) { diff --git a/source/sw/src/menus.cpp b/source/sw/src/menus.cpp index f28051ed5..ee5d2a514 100644 --- a/source/sw/src/menus.cpp +++ b/source/sw/src/menus.cpp @@ -26,7 +26,6 @@ Prepared for public release: 03/28/2005 - Charlie Wiederhold, 3D Realms #include "ns.h" #include "build.h" -#include "osd.h" #include "keys.h" #include "names2.h" diff --git a/source/sw/src/osdcmds.cpp b/source/sw/src/osdcmds.cpp index 55e4ef2ba..45a11ca85 100644 --- a/source/sw/src/osdcmds.cpp +++ b/source/sw/src/osdcmds.cpp @@ -58,14 +58,14 @@ static int osdcmd_map(CCmdFuncPtr parm) { if (parm->numparms != 1) { - return OSDCMD_SHOWHELP; + return CCMD_SHOWHELP; } FString mapname = parm->parms[0]; if (!fileSystem.Lookup(mapname, "MAP")) { Printf(TEXTCOLOR_RED "map: file \"%s\" not found.\n", mapname.GetChars()); - return OSDCMD_OK; + return CCMD_OK; } // Check if the map is already defined. @@ -75,23 +75,23 @@ static int osdcmd_map(CCmdFuncPtr parm) { FStringf cheatcode("swtrek%02d", i); WarpCheat(Player, cheatcode); - return OSDCMD_OK; + return CCMD_OK; } } - return OSDCMD_OK; + return CCMD_OK; } static int osdcmd_activatecheat(CCmdFuncPtr parm) { if (parm->numparms != 1) - return OSDCMD_SHOWHELP; + return CCMD_SHOWHELP; memset(MessageInputString, '\0', sizeof(MessageInputString)); strcpy(MessageInputString, parm->parms[0]); CheatInput(); - return OSDCMD_OK; + return CCMD_OK; } static int osdcmd_god(CCmdFuncPtr UNUSED(parm)) @@ -100,7 +100,7 @@ static int osdcmd_god(CCmdFuncPtr UNUSED(parm)) GodCheat(Player, "swgod"); - return OSDCMD_OK; + return CCMD_OK; } static int osdcmd_noclip(CCmdFuncPtr UNUSED(parm)) @@ -109,7 +109,7 @@ static int osdcmd_noclip(CCmdFuncPtr UNUSED(parm)) ClipCheat(Player, "swghost"); - return OSDCMD_OK; + return CCMD_OK; } int osdcmd_restartmap(CCmdFuncPtr UNUSED(parm)) @@ -118,12 +118,12 @@ int osdcmd_restartmap(CCmdFuncPtr UNUSED(parm)) RestartCheat(Player, "swstart"); - return OSDCMD_OK; + return CCMD_OK; } int osdcmd_levelwarp(CCmdFuncPtr parm) { - if (parm->numparms != 1) return OSDCMD_SHOWHELP; + if (parm->numparms != 1) return CCMD_SHOWHELP; char cheatcode[9] = "swtrek##"; @@ -131,7 +131,7 @@ int osdcmd_levelwarp(CCmdFuncPtr parm) cheatcode[6+i] = parm->parms[0][i]; WarpCheat(Player, cheatcode); - return OSDCMD_OK; + return CCMD_OK; } #if 0 @@ -147,7 +147,7 @@ static int osdcmd_spawn(CCmdFuncPtr parm) if (numplayers > 1 || !(g_player[myconnectindex].ps->gm & MODE_GAME)) { Printf("spawn: Can't spawn sprites in multiplayer games or demos\n"); - return OSDCMD_OK; + return CCMD_OK; } switch (parm->numparms) @@ -198,19 +198,19 @@ static int osdcmd_spawn(CCmdFuncPtr parm) if (i==g_labelCnt) { Printf("spawn: Invalid tile label given\n"); - return OSDCMD_OK; + return CCMD_OK; } } if ((uint32_t)picnum >= MAXUSERTILES) { Printf("spawn: Invalid tile number\n"); - return OSDCMD_OK; + return CCMD_OK; } break; default: - return OSDCMD_SHOWHELP; + return CCMD_SHOWHELP; } idx = A_Spawn(g_player[myconnectindex].ps->i, picnum); @@ -226,7 +226,7 @@ static int osdcmd_spawn(CCmdFuncPtr parm) } } - return OSDCMD_OK; + return CCMD_OK; } #endif @@ -234,44 +234,44 @@ static int osdcmd_give(CCmdFuncPtr parm) { int32_t i; - if (parm->numparms != 1) return OSDCMD_SHOWHELP; + if (parm->numparms != 1) return CCMD_SHOWHELP; if (!Bstrcasecmp(parm->parms[0], "all")) { ItemCheat(Player, "swgimme"); - return OSDCMD_OK; + return CCMD_OK; } else if (!Bstrcasecmp(parm->parms[0], "health")) { HealCheat(Player, "swmedic"); - return OSDCMD_OK; + return CCMD_OK; } else if (!Bstrcasecmp(parm->parms[0], "weapons")) { WeaponCheat(Player, "swguns"); - return OSDCMD_OK; + return CCMD_OK; } else if (!Bstrcasecmp(parm->parms[0], "ammo")) { AmmoCheat(Player, ""); - return OSDCMD_OK; + return CCMD_OK; } else if (!Bstrcasecmp(parm->parms[0], "armor")) { ArmorCheat(Player, ""); // this cheat did not exist before - return OSDCMD_OK; + return CCMD_OK; } else if (!Bstrcasecmp(parm->parms[0], "keys")) { KeysCheat(Player, "swkeys"); - return OSDCMD_OK; + return CCMD_OK; } else if (!Bstrcasecmp(parm->parms[0], "inventory")) { InventoryCheat(Player, ""); // this cheat did not exist before - return OSDCMD_OK; + return CCMD_OK; } - return OSDCMD_SHOWHELP; + return CCMD_SHOWHELP; } int32_t registerosdcommands(void)