Remove Gamegauge and -timetest command-line argument

Gamegauge is an outdated 3D performance benchmark tool. The -timetest command was used to activate it. Read more about about it here: https://www.gamespot.com/articles/3d-gamegauge-explained/1100-2463688/
This commit is contained in:
Louis Gombert 2024-05-12 18:32:46 +02:00
parent 6a3e3060ed
commit 196c155895
17 changed files with 10 additions and 1434 deletions

View File

@ -927,20 +927,9 @@ bool Rendering_main_view = false;
bool Skip_render_game_frame = false;
bool Menu_interface_mode = false;
// #ifdef GAMEGAUGE
int frames_one_second = 0;
int min_one_second = 0x7fffffff;
int max_one_second = 0;
float gamegauge_start_time;
int gamegauge_total_frame_seconds = 0;
int gamegauge_total_frames = 0;
float gamegauge_total_time = 0.0;
short gamegauge_fpslog[GAMEGAUGE_MAX_LOG];
bool Game_gauge_do_time_test = false;
char Game_gauge_usefile[_MAX_PATH] = "gg.dem";
// #endif
longlong last_timer = 0;
@ -2409,14 +2398,6 @@ void DemoCheats(int key);
// Get and handle all pending keys
void ProcessKeys() {
int key;
#ifdef GAMEGAUGE
if (1)
#else
if (Game_gauge_do_time_test)
#endif
{
return;
}
if (Dedicated_server)
return; // No key processing for dedicated server!
@ -2697,10 +2678,8 @@ void GameRenderFrame(void) {
// Increment frame count
FrameCount++;
// #ifdef GAMEGAUGE
frames_one_second++;
gamegauge_total_frames++;
// #endif
// Update our glows
PostUpdateAllLightGlows();
@ -2796,30 +2775,6 @@ void CalcFrameTime(void) {
}
Frames_counted++;
Avg_frametime += (Frametime - Demo_frame_ofs);
#ifdef GAMEGAUGE
if (1)
#else
if (Game_gauge_do_time_test)
#endif
{
if (gamegauge_total_frames == 0)
gamegauge_start_time = timer_GetTime();
if ((timer_GetTime() - gamegauge_start_time) > 1.0) {
// Skip the first frame, it's always more than one second
if (gamegauge_total_frames > 1) {
if (frames_one_second < min_one_second)
min_one_second = frames_one_second;
if (frames_one_second > max_one_second)
max_one_second = frames_one_second;
if (gamegauge_total_frame_seconds < GAMEGAUGE_MAX_LOG)
gamegauge_fpslog[gamegauge_total_frame_seconds] = frames_one_second;
}
gamegauge_total_frame_seconds++;
frames_one_second = 0;
gamegauge_start_time = timer_GetTime();
}
gamegauge_total_time += Frametime;
}
}
// called before first call to StopTime, StartTime or CalcFrameTime

View File

@ -331,8 +331,6 @@ extern float Avg_frametime;
extern unsigned int Frames_counted;
extern bool Game_paused;
extern bool Game_gauge_do_time_test;
static bool Demo_play_fast = false;
extern void PageInAllData(void);
@ -1168,7 +1166,7 @@ void DemoFrame() {
DoScreenshot();
}
// This code slows down demo playback
if ((!Game_gauge_do_time_test) && (!Demo_play_fast)) {
if (!Demo_play_fast) {
float tdelta = timer_GetTime();
// if(Gametime<Demo_next_frame)

View File

@ -426,7 +426,6 @@ oeAppDatabase *Database = NULL; // Application database.
bool Descent_overrided_intro = false;
extern bool Game_gauge_do_time_test;
bool Katmai = true;
char Descent3_temp_directory[_MAX_PATH]; // temp directory to put temp files
@ -548,16 +547,7 @@ void Descent3() {
// Init a bunch more stuff
InitD3Systems2(false);
#ifdef GAMEGAUGE
if (0)
#else
if (!Game_gauge_do_time_test)
#endif
{
SetFunctionMode(MENU_MODE);
} else {
SetFunctionMode(GAMEGAUGE_MODE);
}
SetFunctionMode(MENU_MODE);
MainLoop();
@ -577,14 +567,9 @@ void Descent3() {
// Otherwise this should be called from the main function.
// ---------------------------------------------------------------------------
// #ifdef GAMEGAUGE
extern int frames_one_second;
extern int min_one_second;
extern int max_one_second;
extern float gamegauge_start_time;
extern int gamegauge_total_frames;
extern float gamegauge_total_time;
extern short gamegauge_fpslog[GAMEGAUGE_MAX_LOG];
// #endif
@ -619,16 +604,8 @@ void MainLoop() {
Credits_Display();
Function_mode = MENU_MODE;
break;
// #ifdef GAMEGAUGE
case GAMEGAUGE_MODE: {
int c;
for (c = 0; c < GAMEGAUGE_MAX_LOG; c++)
gamegauge_fpslog[c] = 0;
SetGameState(GAMESTATE_GAMEGAUGEDEMO);
PlayGame();
// exit_game = 1;
} break;
// #endif
case GAMEGAUGE_MODE:
break;
#ifdef EDITOR
case EDITOR_GAME_MODE: // run level and then instead of menus, go to editor.
QuickPlayGame();
@ -652,33 +629,6 @@ void MainLoop() {
Players[a].counter_measures.Reset(false, INVRESET_ALL);
}
#ifdef GAMEGAUGE
if (1)
#else
if (Game_gauge_do_time_test)
#endif
{
char fpsfile[_MAX_PATH * 2];
CFILE *cfp;
ddio_MakePath(fpsfile, Base_directory, "fps.txt", NULL);
cfp = cfopen(fpsfile, "wt");
if (cfp) {
char szline[200];
snprintf(szline, sizeof(szline), "%.2f Descent3 v%d.%d", gamegauge_total_frames / gamegauge_total_time,
(int)Program_version.major, (int)Program_version.minor);
cf_WriteString(cfp, szline);
snprintf(szline, sizeof(szline), "%d Min", min_one_second);
cf_WriteString(cfp, szline);
snprintf(szline, sizeof(szline), "%d Max", max_one_second);
cf_WriteString(cfp, szline);
for (int b = 1; ((b < GAMEGAUGE_MAX_LOG) && (gamegauge_fpslog[b])); b++) {
snprintf(szline, sizeof(szline), "%d Second %d", gamegauge_fpslog[b], b);
cf_WriteString(cfp, szline);
}
cfclose(cfp);
}
}
#if defined(OEM)
if (!Dedicated_server)
ShowStaticScreen("oemupsell.ogf");

View File

@ -164,15 +164,12 @@ typedef enum function_mode {
MENU_MODE,
QUIT_MODE,
LOADDEMO_MODE,
GAMEGAUGE_MODE,
GAMEGAUGE_MODE, // Unused
CREDITS_MODE
} function_mode;
extern bool Descent_overrided_intro;
// Maximum samples to save for gamegauge graph info
#define GAMEGAUGE_MAX_LOG 1000
// This is the default FOV
#define D3_DEFAULT_FOV 72.0
// This is the default zoom factor to be used for the game 3D view.

View File

@ -1167,10 +1167,10 @@ bool GameSequencer() {
case MENU_MODE:
case QUIT_MODE:
case CREDITS_MODE:
case GAMEGAUGE_MODE:
break;
case RESTORE_GAME_MODE:
case LOADDEMO_MODE:
case GAMEGAUGE_MODE:
SetFunctionMode(GAME_MODE); // need to do so sequencer thiks we're in game.
break;
}
@ -1230,15 +1230,6 @@ bool GameSequencer() {
SetFunctionMode(MENU_MODE);
}
break;
case GAMESTATE_GAMEGAUGEDEMO: {
char ggdemopath[_MAX_PATH * 2];
ddio_MakePath(ggdemopath, Base_directory, "demo", Game_gauge_usefile, NULL);
if (DemoPlaybackFile(ggdemopath)) {
SetGameState(GAMESTATE_LVLPLAYING);
} else {
SetFunctionMode(MENU_MODE);
}
} break;
case GAMESTATE_LOADGAME:
if (Game_mode & GM_MULTI) {
DoMessageBox(TXT_ERROR, TXT_CANT_LOAD_MULTI, MSGBOX_OK);
@ -1445,10 +1436,6 @@ void SetCurrentLevel(int level) {
void StartLevelSounds();
// #ifdef GAMEGAUGE
extern float gamegauge_start_time;
// #endif
// Get rid of any viewer objects in the level
void ClearViewerObjects() {
int i;
@ -1643,9 +1630,7 @@ void StartLevel() {
Gametime = 0.0f;
// Start the clock
InitFrameTime();
// #ifdef GAMEGAUGE
gamegauge_start_time = timer_GetTime();
// #endif
LoadLevelProgress(LOAD_PROGRESS_DONE, 0);
}
@ -2194,14 +2179,7 @@ void RunGameMenu() {
break;
case GAME_POST_DEMO:
#ifdef GAMEGAUGE
if (0)
#else
if (!Game_gauge_do_time_test)
#endif
{
DemoPostPlaybackMenu();
}
DemoPostPlaybackMenu();
SetFunctionMode(MENU_MODE);
break;
case GAME_DEMO_LOOP:

View File

@ -123,7 +123,6 @@ typedef enum tGameState {
GAMESTATE_LVLFAILED, // a level was unsuccessfully ended
GAMESTATE_LVLWARP, // warp to a new level
GAMESTATE_LOADDEMO, // Load whatever demo was chosen in the UI
GAMESTATE_GAMEGAUGEDEMO // Play a gamegauge demo and exit
} tGameState;
// top level interfaces for game.

View File

@ -1218,9 +1218,6 @@ void SaveGameSettings() {
Database->write("Default_pilot", " ", 2);
}
extern bool Game_gauge_do_time_test;
extern char Game_gauge_usefile[_MAX_PATH];
/*
Read game variables from the registry
*/
@ -1235,12 +1232,6 @@ void LoadGameSettings() {
Lighting_on = true;
#endif
int tt_arg = FindArg("-timetest");
if (tt_arg) {
Game_gauge_do_time_test = true;
strcpy(Game_gauge_usefile, GameArgs[tt_arg + 1]);
}
Detail_settings.Specular_lighting = false;
Detail_settings.Dynamic_lighting = true;
Detail_settings.Fast_headlight_on = true;

View File

@ -94,7 +94,6 @@ static cmdLineArg d3ArgTable[] = {
{"deadzone0", 'D', "Specify a joystick deadzone (0.0 to 1.0)"},
{"gspyfile", 'S', "Specify a GameSpy config file."},
{"timetest", 'T', "Run a demo benchmark."},
{"fastdemo", 'Q', "Run demos as fast as possible."},
{"framecap", 'F', "Specify a framecap (for dedicated server)."},

View File

@ -711,8 +711,6 @@ extern bool Mem_quick_exit;
bool IsRestoredGame = false;
//////////////////////////////////////////////////////////////////////////////
extern bool Demo_looping;
extern bool Game_gauge_do_time_test;
extern char Game_gauge_usefile[_MAX_PATH];
bool FirstGame = false;
int MainMenu() {
@ -721,15 +719,6 @@ int MainMenu() {
bool exit_game = false;
bool exit_menu = false;
#ifdef GAMEGAUGE
if (1)
#else
if (Game_gauge_do_time_test)
#endif
{
Mem_quick_exit = 1;
return 1;
}
// okay over here, we'll decide whether we've finished the training mission and are going into game.
if (!Demo_looping && !Demo_restart && !MultiDLLGameStarting) {
if (FirstGame) {

View File

@ -209,8 +209,6 @@ oeD3Win32Database::oeD3Win32Database() : oeWin32AppDatabase() {
lstrcat(m_Basepath, "\\Descent3_OEM_A2");
#elif defined(OEM_KATMAI)
lstrcat(m_Basepath, "\\Descent3_OEM_KM");
#elif defined(GAMEGAUGE)
lstrcat(m_Basepath, "\\Descent3GG");
#elif defined(OEM)
lstrcat(m_Basepath, "\\Descent3_OEM");
#else

View File

@ -1230,7 +1230,7 @@ int __cdecl RecordExceptionInfo(PEXCEPTION_POINTERS data, const char *Message) {
wsprintf(callstack, "Username: %s\r\nMachineName: %s\r\n", Username, Machinename);
WriteFile(LogFile, callstack, lstrlen(callstack), &NumBytes, 0);
#if (defined(RELEASE) && (!defined(DEMO)) && (!defined(GAMEGAUGE)))
#if (defined(RELEASE) && (!defined(DEMO)))
wsprintf(callstack, "Descent 3 Release build %s\r\n", D3_GIT_HASH);
WriteFile(LogFile, callstack, lstrlen(callstack), &NumBytes, 0);
#endif

View File

@ -16,7 +16,6 @@ set(SCRIPTS
CellTestLevel
ChrisTest
clutter
GameGauge
generic
Geodomes
HalfPipe

File diff suppressed because it is too large Load Diff

View File

@ -1,11 +0,0 @@
//////////////////////////////////////////////
// D.A.L.L.A.S. Generated Message Table File
//////////////////////////////////////////////
NEXT_MESSAGE_ID_NUMBER 7
// Message List
DisableMatcen=Materialization Center disabled!
Intro=Proceed with caution.| Security alert level 3 in effect!
WeatherControl=Lightning control system activated.
WindThing=Magnetic generator core destroyed!

View File

@ -66,7 +66,6 @@ CanyonsCTF.so
CellTestLevel.so
ChrisTest.so
clutter.so
GameGauge.so
generic.so
Geodomes.so
HalfPipe.so

View File

@ -66,7 +66,6 @@ CanyonsCTF.dylib
CellTestLevel.dylib
ChrisTest.dylib
clutter.dylib
GameGauge.dylib
generic.dylib
Geodomes.dylib
HalfPipe.dylib

View File

@ -161,11 +161,6 @@ bool oeWin32AppDatabase::read(const char *label, char *entry, int *entrylen) {
assert(entry != NULL);
assert(entrylen != NULL);
#ifdef GAMEGAUGE
// We don't want to read the registry for game gauge
return 0;
#endif
lres = RegQueryValueEx((HKEY)hCurKey, label, NULL, &type, (LPBYTE)entry, (LPDWORD)entrylen);
assert(type != REG_DWORD);
@ -188,11 +183,6 @@ bool oeWin32AppDatabase::read(const char *label, void *entry, int wordsize) {
assert(label != NULL);
assert(entry != NULL);
#ifdef GAMEGAUGE
// We don't want to read the registry for game gauge
return 0;
#endif
lres = RegQueryValueEx((HKEY)hCurKey, label, NULL, &type, (LPBYTE)&t, &len);
assert(len == 4);
@ -225,11 +215,6 @@ bool oeWin32AppDatabase::read(const char *label, void *entry, int wordsize) {
bool oeWin32AppDatabase::read(const char *label, bool *entry) {
int t;
#ifdef GAMEGAUGE
// We don't want to read the registry for game gauge
return 0;
#endif
if (read(label, &t, sizeof(t))) {
*entry = (t != 0);
return 1;