Skip to content

Commit 2826ae6

Browse files
committed
t_stubs.cpp cleanup
1 parent 0281b0d commit 2826ae6

File tree

6 files changed

+54
-140
lines changed

6 files changed

+54
-140
lines changed

client/src/cl_game.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,6 @@ bool sendsave; // send a save event next tic
116116
bool usergame; // ok to save / end game
117117
bool sendcenterview; // send a center view event next tic
118118

119-
bool timingdemo; // if true, exit with report on completion
120119
bool longtics; // don't quantize yaw for classic vanilla demos
121120
bool nodrawers; // for comparative timing purposes
122121
bool noblit; // for comparative timing purposes

client/src/st_stuff.cpp

-2
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,6 @@ IWindowSurface* stnum_surface;
7070
void ST_initNew();
7171
void ST_unloadNew();
7272

73-
extern bool simulated_connection;
74-
7573
//
7674
// STATUS BAR DATA
7775
//

common/doomdef.h

+5-4
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,8 @@ extern bool clientside, serverside;
6060
enum baseapp_t
6161
{
6262
client, // Odamex.exe
63-
server // Odasrv.exe
63+
server, // Odasrv.exe
64+
test, // Odagtest.exe
6465
};
6566

6667
extern baseapp_t baseapp;
@@ -92,10 +93,10 @@ extern baseapp_t baseapp;
9293
#define SERVER_ONLY(expr)
9394
#endif
9495

95-
//
96+
//
9697
// Environment Platform
97-
//
98-
enum gameplatform_t
98+
//
99+
enum gameplatform_t
99100
{
100101
PF_PC,
101102
PF_XBOX,

common/g_game.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -69,4 +69,4 @@ bool G_ShouldIgnoreMouseInput();
6969

7070
extern int mapchange;
7171

72-
extern bool timingdemo;
72+
inline bool timingdemo; // if true, exit with report on completion

server/src/sv_game.cpp

-2
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,6 @@ gamestate_t gamestate = GS_STARTUP;
6161

6262
bool sendpause; // send a pause event next tic
6363

64-
bool timingdemo; // FIXME : delete this variable for odasrv ?
65-
6664
player_t nullplayer; // The null player
6765

6866
byte consoleplayer_id; // player taking events and displaying

tests/unit-tests/src/t_stubs.cpp

+48-130
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@
3636
#include "c_dispatch.h"
3737
#include "w_wad.h"
3838

39+
bool clientside = false; // don't want any rendering code called
40+
bool serverside = true;
41+
baseapp_t baseapp = test;
42+
3943
// Unnatural Level Progression. True if we've used 'map' or another command
4044
// to switch to a specific map out of order, otherwise false.
4145
bool unnatural_level_progression;
@@ -45,19 +49,25 @@ gameaction_t gameaction;
4549
bool predicting;
4650
int demostartgametic;
4751

52+
bool isFast;
53+
bool demoplayback;
54+
bool step_mode;
55+
int gametic;
56+
bool simulated_connection;
57+
gamestate_t gamestate;
58+
59+
CVAR_FUNC_IMPL (sv_allowwidescreen) {}
60+
CVAR_FUNC_IMPL (sv_sharekeys) {}
61+
CVAR_RANGE (sv_teamsinplay, "2", "Teams that are enabled", CVARTYPE_BYTE, CVAR_SERVERINFO | CVAR_LATCH | CVAR_NOENABLEDISABLE, 2.0f, 3.0f)
62+
CVAR (sv_maxplayersperteam, "0", "Maximum number of players that can be on a team", CVARTYPE_BYTE, CVAR_SERVERINFO | CVAR_LATCH | CVAR_NOENABLEDISABLE)
63+
CVAR (sv_maxplayers, "0", "maximum players who can join the game, others are spectators", CVARTYPE_BYTE, CVAR_SERVERINFO | CVAR_LATCH | CVAR_NOENABLEDISABLE)
64+
4865
void C_AddTabCommand(char const *) {}
4966
void C_RemoveTabCommand(char const *) {}
5067
void P_ShowSpawns(MapThing*) {}
5168
void G_DeathMatchSpawnPlayer(player_t&) {}
5269
player_t& consoleplayer() { static player_t fake{}; return fake; }
5370
player_t& displayplayer() { static player_t fake{}; return fake; }
54-
bool clientside;
55-
bool isFast;
56-
bool timingdemo;
57-
bool demoplayback;
58-
bool step_mode;
59-
int gametic;
60-
bool simulated_connection;
6171

6272
void BuildDefaultShademap(palette_t const *, shademap_t &) {}
6373
palindex_t V_BestColor(const argb_t* palette_colors, int r, int g, int b) { return 0; }
@@ -92,16 +102,11 @@ void CTF_SpawnFlag(team_t f) {}
92102
bool SV_AwarenessUpdate(player_t &pl, AActor* mo) { return true; }
93103
void SV_SendPackets(void) {}
94104
void SV_SendExecuteLineSpecial(byte special, line_t* line, AActor* activator, int arg0,
95-
int arg1, int arg2, int arg3, int arg4)
96-
{
97-
}
105+
int arg1, int arg2, int arg3, int arg4) {}
98106

99107
void SV_UpdateMonsterRespawnCount() {}
100108
void SV_Sound(AActor* mo, byte channel, const char* name, byte attenuation) {}
101109

102-
103-
CVAR_FUNC_IMPL(sv_sharekeys) {}
104-
105110
void R_ExitLevel() {}
106111
void D_SetupUserInfo (void) {}
107112
void D_UserInfoChanged (cvar_t *cvar) {}
@@ -120,14 +125,8 @@ void RefreshPalettes (void) {}
120125

121126
void V_RefreshColormaps() {}
122127

123-
CVAR_FUNC_IMPL (sv_allowwidescreen) {}
124-
125128
size_t C_BasePrint(const int printlevel, const char* color_code, const std::string& str) { return 0; }
126129

127-
bool serverside;
128-
gamestate_t gamestate;
129-
baseapp_t baseapp;
130-
131130
#define NORM_PITCH 128
132131
#define NORM_PRIORITY 64
133132
#define NORM_SEP 128
@@ -158,84 +157,30 @@ void S_Init(float sfxVolume, float musicVolume)
158157
//NumSequences = 0;
159158
}
160159

161-
void S_Start()
162-
{
163-
}
164-
165-
void S_Stop()
166-
{
167-
}
168-
169-
void S_SoundID(int channel, int sound_id, float volume, int attenuation)
170-
{
171-
}
172-
173-
void S_SoundID(AActor *ent, int channel, int sound_id, float volume, int attenuation)
174-
{
175-
}
176-
177-
void S_SoundID(fixed_t *pt, int channel, int sound_id, float volume, int attenuation)
178-
{
179-
}
180-
181-
void S_LoopedSoundID(AActor *ent, int channel, int sound_id, float volume, int attenuation)
182-
{
183-
}
184-
185-
void S_LoopedSoundID(fixed_t *pt, int channel, int sound_id, float volume, int attenuation)
186-
{
187-
}
160+
void S_Start() {}
161+
void S_Stop() {}
162+
void S_SoundID(int channel, int sound_id, float volume, int attenuation) {}
163+
void S_SoundID(AActor *ent, int channel, int sound_id, float volume, int attenuation) {}
164+
void S_SoundID(fixed_t *pt, int channel, int sound_id, float volume, int attenuation) {}
165+
void S_LoopedSoundID(AActor *ent, int channel, int sound_id, float volume, int attenuation) {}
166+
void S_LoopedSoundID(fixed_t *pt, int channel, int sound_id, float volume, int attenuation) {}
188167

189168
// [Russell] - Hack to stop multiple plat stop sounds
190-
void S_PlatSound(fixed_t *pt, int channel, const char *name, float volume, int attenuation)
191-
{
192-
}
193-
194-
void S_Sound(int channel, const char *name, float volume, int attenuation)
195-
{
196-
}
197-
198-
void S_Sound(AActor *ent, int channel, const char *name, float volume, int attenuation)
199-
{
200-
}
201-
202-
void S_Sound(fixed_t *pt, int channel, const char *name, float volume, int attenuation)
203-
{
204-
}
205-
206-
void S_LoopedSound(AActor *ent, int channel, const char *name, float volume, int attenuation)
207-
{
208-
}
209-
210-
void S_LoopedSound(fixed_t *pt, int channel, const char *name, float volume, int attenuation)
211-
{
212-
}
213-
214-
void S_Sound(fixed_t x, fixed_t y, int channel, const char *name, float volume, int attenuation)
215-
{
216-
}
217-
218-
void S_StopSound(fixed_t *pt)
219-
{
220-
}
221-
222-
void S_StopSound(fixed_t *pt, int channel)
223-
{
224-
}
225-
226-
void S_StopSound(AActor *ent, int channel)
227-
{
228-
}
229-
230-
void S_StopAllChannels()
231-
{
232-
}
169+
void S_PlatSound(fixed_t *pt, int channel, const char *name, float volume, int attenuation) {}
170+
void S_Sound(int channel, const char *name, float volume, int attenuation) {}
171+
void S_Sound(AActor *ent, int channel, const char *name, float volume, int attenuation) {}
172+
void S_Sound(fixed_t *pt, int channel, const char *name, float volume, int attenuation) {}
173+
void S_LoopedSound(AActor *ent, int channel, const char *name, float volume, int attenuation) {}
174+
void S_LoopedSound(fixed_t *pt, int channel, const char *name, float volume, int attenuation) {}
175+
void S_Sound(fixed_t x, fixed_t y, int channel, const char *name, float volume, int attenuation) {}
176+
void S_StopSound(fixed_t *pt) {}
177+
void S_StopSound(fixed_t *pt, int channel) {}
178+
void S_StopSound(AActor *ent, int channel) {}
179+
void S_StopAllChannels() {}
233180

234181
// Moves all the sounds from one thing to another. If the destination is
235182
// NULL, then the sound becomes a positioned sound.
236-
void S_RelinkSound(AActor *from, AActor *to)
237-
{
238-
}
183+
void S_RelinkSound(AActor *from, AActor *to) {}
239184

240185
bool S_GetSoundPlayingInfo(fixed_t *pt, int sound_id)
241186
{
@@ -250,49 +195,31 @@ bool S_GetSoundPlayingInfo(AActor *ent, int sound_id)
250195
//
251196
// Stop and resume music, during game PAUSE.
252197
//
253-
void S_PauseSound()
254-
{
255-
}
198+
void S_PauseSound() {}
256199

257-
void S_ResumeSound()
258-
{
259-
}
200+
void S_ResumeSound() {}
260201

261202
//
262203
// Updates music & sounds
263204
//
264-
void S_UpdateSounds(void *listener_p)
265-
{
266-
}
205+
void S_UpdateSounds(void *listener_p) {}
267206

268-
void S_UpdateMusic()
269-
{
270-
}
207+
void S_UpdateMusic() {}
271208

272-
void S_SetMusicVolume(float volume)
273-
{
274-
}
209+
void S_SetMusicVolume(float volume) {}
275210

276-
void S_SetSfxVolume(float volume)
277-
{
278-
}
211+
void S_SetSfxVolume(float volume) {}
279212

280213
//
281214
// Starts some music with the music id found in sounds.h.
282215
//
283-
void S_StartMusic(const char *m_id)
284-
{
285-
}
216+
void S_StartMusic(const char *m_id) {}
286217

287218
// [RH] S_ChangeMusic() now accepts the name of the music lump.
288219
// It's up to the caller to figure out what that name is.
289-
void S_ChangeMusic(std::string musicname, bool looping)
290-
{
291-
}
220+
void S_ChangeMusic(std::string musicname, bool looping) {}
292221

293-
void S_StopMusic()
294-
{
295-
}
222+
void S_StopMusic() {}
296223

297224

298225
// [RH] ===============================
@@ -614,13 +541,8 @@ void S_ParseSndInfo()
614541
S_HashSounds();
615542
}
616543

617-
void A_Ambient(AActor *actor)
618-
{
619-
}
620-
621-
void S_ActivateAmbient(AActor *origin, int ambient)
622-
{
623-
}
544+
void A_Ambient(AActor *actor) {}
545+
void S_ActivateAmbient(AActor *origin, int ambient) {}
624546

625547
void AM_SetBaseColorDoom() {}
626548
void AM_SetBaseColorRaven() {}
@@ -643,10 +565,6 @@ void UV_SoundAvoidPlayer(AActor *mo, byte channel, const char *name, byte attenu
643565
void OnChangedSwitchTexture (line_t *line, int useAgain) {}
644566
void C_MidPrint (const char *msg, player_t *p, int msgtime) {}
645567

646-
CVAR_RANGE (sv_teamsinplay, "2", "Teams that are enabled", CVARTYPE_BYTE, CVAR_SERVERINFO | CVAR_LATCH | CVAR_NOENABLEDISABLE, 2.0f, 3.0f)
647-
CVAR (sv_maxplayersperteam, "0", "Maximum number of players that can be on a team", CVARTYPE_BYTE, CVAR_SERVERINFO | CVAR_LATCH | CVAR_NOENABLEDISABLE)
648-
CVAR (sv_maxplayers, "0", "maximum players who can join the game, others are spectators", CVARTYPE_BYTE, CVAR_SERVERINFO | CVAR_LATCH | CVAR_NOENABLEDISABLE)
649-
650568
#define R_P2ATHRESHOLD (INT_MAX / 4)
651569

652570
angle_t R_PointToAngle2(fixed_t viewx, fixed_t viewy, fixed_t x, fixed_t y)

0 commit comments

Comments
 (0)