drop obsolete cmode stuff

master
Daniel Kolesa 2020-04-25 01:28:52 +02:00
parent b35a80c962
commit e6a11d01f6
4 changed files with 1 additions and 59 deletions

View File

@ -35,13 +35,6 @@ namespace game
settexture("media/interface/radar/radar.png", 3);
}
clientmode *cmode = NULL;
void setclientmode()
{
cmode = NULL;
}
bool connected = false, remote = false;
int sessionid = 0;
string servdesc = "", servauth = "";

View File

@ -23,7 +23,6 @@ namespace game
{
if(ispaused()) return;
spawnplayer(player1);
if(cmode) cmode->respawned(player1);
}
gameent *pointatplayer()
@ -68,15 +67,13 @@ namespace game
crouchplayer(player1, 10, true);
moveplayer(player1, 10, true);
entities::checkitems(player1);
if(cmode) cmode->checkitems(player1);
}
if(player1->clientnum>=0) c2sinfo(); // do this last, to reduce the effective frame lag
}
void spawnplayer(gameent *d) // place at random spawn
{
if(cmode) cmode->pickspawn(d);
else findplayerspawn(d, -1, 0);
findplayerspawn(d, -1, 0);
spawnstate(d);
if(d==player1)
{
@ -135,7 +132,6 @@ namespace game
{
removetrackedparticles(d);
removetrackeddynlights(d);
if(cmode) cmode->removeplayer(d);
DELETEP(clients[cn]);
cleardynentcache();
}
@ -159,16 +155,8 @@ namespace game
// reset perma-state
player1->startgame();
setclientmode();
maptime = maprealtime = 0;
if(cmode)
{
cmode->preload();
cmode->setup();
}
syncplayer();
disablezoom();
@ -243,7 +231,6 @@ namespace game
if(d->state!=CS_EDITING)
{
if(d->state!=CS_SPECTATOR) drawhudicons(d);
if(cmode) cmode->drawhud(d, w, h);
}
pophudmatrix();
@ -251,7 +238,6 @@ namespace game
float clipconsole(float w, float h)
{
if(cmode) return cmode->clipconsole(w, h);
return 0;
}

View File

@ -224,28 +224,6 @@ namespace entities
namespace game
{
struct clientmode
{
virtual ~clientmode() {}
virtual void preload() {}
virtual float clipconsole(float w, float h) { return 0; }
virtual void drawhud(gameent *d, int w, int h) {}
virtual void rendergame() {}
virtual void respawned(gameent *d) {}
virtual void setup() {}
virtual void checkitems(gameent *d) {}
virtual int respawnwait(gameent *d, int delay = 0) { return 0; }
virtual void pickspawn(gameent *d) { findplayerspawn(d, -1, 0); }
virtual void senditems(packetbuf &p) {}
virtual void removeplayer(gameent *d) {}
virtual void gameover() {}
virtual bool hidefrags() { return false; }
};
extern clientmode *cmode;
extern void setclientmode();
// game
extern string clientmap;
@ -276,17 +254,10 @@ namespace game
extern void sendposition(gameent *d, bool reliable = false);
// render
struct playermodelinfo
{
const char *model[1], *hudguns[1],
*icon[1];
bool ragdoll;
};
extern void saveragdoll(gameent *d);
extern void clearragdolls();
extern void moveragdolls();
extern const playermodelinfo &getplayermodelinfo(gameent *d);
extern int getplayercolor(gameent *d, int team);
extern int chooserandomplayermodel(int seed);
extern void syncplayer();

View File

@ -26,14 +26,6 @@ namespace game
{
}
void renderplayer(gameent *d, const playermodelinfo &mdl, int color, float fade, int flags = 0, bool mainpass = true)
{
}
static inline void renderplayer(gameent *d, float fade = 1, int flags = 0)
{
}
void rendergame()
{
}