- removed osd.h as it was merely a minimal wrapper around c_dispatch, giving some alias names.

Nothing that's needed when cutting ties to upstream.
This commit is contained in:
Christoph Oelckers 2020-07-14 14:00:27 +02:00
parent 2e05ff532b
commit aa01adb2f1
21 changed files with 80 additions and 113 deletions

View file

@ -1259,7 +1259,7 @@ RESTART:
if (gQuitGame)
continue;
OSD_DispatchQueued();
C_RunDelayedCommands();
ctrlGetInput();

View file

@ -27,7 +27,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include <string.h>
#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();

View file

@ -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)

View file

@ -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"

View file

@ -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"

View file

@ -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 <functional>
#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_

View file

@ -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"

View file

@ -1,15 +1,18 @@
#pragma once
#include <stdint.h>
#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.

View file

@ -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"

View file

@ -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)

View file

@ -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;
}

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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)

View file

@ -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"

View file

@ -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"

View file

@ -445,7 +445,7 @@ DemoPlayBack(void)
while (totalclock > totalsynctics)
{
handleevents();
OSD_DispatchQueued();
C_RunDelayedCommands();
TRAVERSE_CONNECT(pnum)
{

View file

@ -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)
{

View file

@ -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"

View file

@ -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)