mirror of
https://github.com/ZDoom/raze-gles.git
synced 2025-01-12 03:00:38 +00:00
- a bit more cleanup in app_init.
This commit is contained in:
parent
7aa9f53a6b
commit
39bfd64fe9
8 changed files with 19 additions and 129 deletions
|
@ -1248,11 +1248,6 @@ int app_main()
|
||||||
BGetTime,
|
BGetTime,
|
||||||
GAME_onshowosd);
|
GAME_onshowosd);
|
||||||
|
|
||||||
wm_setapptitle(APPNAME);
|
|
||||||
|
|
||||||
initprintf(APPNAME " %s\n", s_buildRev);
|
|
||||||
PrintBuildInfo();
|
|
||||||
|
|
||||||
memcpy(&gGameOptions, &gSingleGameOptions, sizeof(GAMEOPTIONS));
|
memcpy(&gGameOptions, &gSingleGameOptions, sizeof(GAMEOPTIONS));
|
||||||
gGameOptions.nMonsterSettings = userConfig.nomonsters;
|
gGameOptions.nMonsterSettings = userConfig.nomonsters;
|
||||||
bQuickStart = userConfig.nologo;
|
bQuickStart = userConfig.nologo;
|
||||||
|
@ -1277,7 +1272,6 @@ int app_main()
|
||||||
|
|
||||||
initprintf("Initializing OSD...\n");
|
initprintf("Initializing OSD...\n");
|
||||||
|
|
||||||
//Bsprintf(tempbuf, HEAD2 " %s", s_buildRev);
|
|
||||||
OSD_SetVersion("Blood", 10, 0);
|
OSD_SetVersion("Blood", 10, 0);
|
||||||
OSD_SetParameters(0, 0, 0, 12, 2, 12, OSD_ERROR, OSDTEXT_RED, 0);
|
OSD_SetParameters(0, 0, 0, 12, 2, 12, OSD_ERROR, OSDTEXT_RED, 0);
|
||||||
registerosdcommands();
|
registerosdcommands();
|
||||||
|
|
|
@ -28,6 +28,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
#include "pragmas.h"
|
#include "pragmas.h"
|
||||||
#include "misc.h"
|
#include "misc.h"
|
||||||
#include "network.h"
|
#include "network.h"
|
||||||
|
#include "printf.h"
|
||||||
|
|
||||||
BEGIN_BLD_NS
|
BEGIN_BLD_NS
|
||||||
|
|
||||||
|
@ -37,7 +38,6 @@ BEGIN_BLD_NS
|
||||||
#define EXEVERSION 101
|
#define EXEVERSION 101
|
||||||
|
|
||||||
void _SetErrorLoc(const char *pzFile, int nLine);
|
void _SetErrorLoc(const char *pzFile, int nLine);
|
||||||
void _ThrowError(const char *pzFormat, ...);
|
|
||||||
void __dassert(const char *pzExpr, const char *pzFile, int nLine);
|
void __dassert(const char *pzExpr, const char *pzFile, int nLine);
|
||||||
void QuitGame(void);
|
void QuitGame(void);
|
||||||
void _consoleSysMsg(const char* pMessage, ...);
|
void _consoleSysMsg(const char* pMessage, ...);
|
||||||
|
@ -45,7 +45,7 @@ void _consoleSysMsg(const char* pMessage, ...);
|
||||||
#define ThrowError(...) \
|
#define ThrowError(...) \
|
||||||
{ \
|
{ \
|
||||||
_SetErrorLoc(__FILE__,__LINE__); \
|
_SetErrorLoc(__FILE__,__LINE__); \
|
||||||
_ThrowError(__VA_ARGS__); \
|
I_Error(__VA_ARGS__); \
|
||||||
}
|
}
|
||||||
|
|
||||||
// print error to console only
|
// print error to console only
|
||||||
|
@ -55,7 +55,7 @@ void _consoleSysMsg(const char* pMessage, ...);
|
||||||
_consoleSysMsg(__VA_ARGS__); \
|
_consoleSysMsg(__VA_ARGS__); \
|
||||||
}
|
}
|
||||||
|
|
||||||
#define dassert(x) if (!(x)) __dassert(#x,__FILE__,__LINE__)
|
#define dassert(x) assert(x)
|
||||||
|
|
||||||
|
|
||||||
#define kMaxSectors MAXSECTORS
|
#define kMaxSectors MAXSECTORS
|
||||||
|
|
|
@ -55,22 +55,6 @@ void _SetErrorLoc(const char *pzFile, int nLine)
|
||||||
_line = nLine;
|
_line = nLine;
|
||||||
}
|
}
|
||||||
|
|
||||||
void _ThrowError(const char *pzFormat, ...)
|
|
||||||
{
|
|
||||||
char buffer[256];
|
|
||||||
va_list args;
|
|
||||||
va_start(args, pzFormat);
|
|
||||||
vsprintf(buffer, pzFormat, args);
|
|
||||||
initprintf("%s(%i): %s\n", _module, _line, buffer);
|
|
||||||
|
|
||||||
char titlebuf[256];
|
|
||||||
Bsprintf(titlebuf, APPNAME " %s", s_buildRev);
|
|
||||||
wm_msgbox(titlebuf, "%s(%i): %s\n", _module, _line, buffer);
|
|
||||||
|
|
||||||
Bfflush(NULL);
|
|
||||||
QuitGame();
|
|
||||||
}
|
|
||||||
|
|
||||||
// by NoOne: show warning msgs in game instead of throwing errors (in some cases)
|
// by NoOne: show warning msgs in game instead of throwing errors (in some cases)
|
||||||
void _consoleSysMsg(const char* pzFormat, ...) {
|
void _consoleSysMsg(const char* pzFormat, ...) {
|
||||||
|
|
||||||
|
@ -84,18 +68,6 @@ void _consoleSysMsg(const char* pzFormat, ...) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void __dassert(const char * pzExpr, const char * pzFile, int nLine)
|
|
||||||
{
|
|
||||||
initprintf("Assertion failed: %s in file %s at line %i\n", pzExpr, pzFile, nLine);
|
|
||||||
|
|
||||||
char titlebuf[256];
|
|
||||||
Bsprintf(titlebuf, APPNAME " %s", s_buildRev);
|
|
||||||
wm_msgbox(titlebuf, "Assertion failed: %s in file %s at line %i\n", pzExpr, pzFile, nLine);
|
|
||||||
|
|
||||||
Bfflush(NULL);
|
|
||||||
exit(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
const char *GetVersionString(void)
|
const char *GetVersionString(void)
|
||||||
{
|
{
|
||||||
if (!gVersionString)
|
if (!gVersionString)
|
||||||
|
|
|
@ -52,8 +52,6 @@ extern const char *s_buildRev;
|
||||||
extern const char *s_buildTimestamp;
|
extern const char *s_buildTimestamp;
|
||||||
|
|
||||||
//// FUNCTIONS
|
//// FUNCTIONS
|
||||||
extern void PrintBuildInfo(void);
|
|
||||||
|
|
||||||
extern void clearDefNamePtr(void);
|
extern void clearDefNamePtr(void);
|
||||||
|
|
||||||
void G_AddDef(const char *buffer);
|
void G_AddDef(const char *buffer);
|
||||||
|
|
|
@ -13,55 +13,6 @@
|
||||||
|
|
||||||
GrowArray<char*> g_defModules;
|
GrowArray<char*> g_defModules;
|
||||||
|
|
||||||
void PrintBuildInfo(void)
|
|
||||||
{
|
|
||||||
buildprint(
|
|
||||||
"Built ", s_buildTimestamp, ", "
|
|
||||||
|
|
||||||
#if defined __INTEL_COMPILER
|
|
||||||
"ICC ", __INTEL_COMPILER / 100, ".", __INTEL_COMPILER % 100, " " __INTEL_COMPILER_BUILD_DATE " (" __VERSION__ ")"
|
|
||||||
#elif defined __clang__
|
|
||||||
"clang "
|
|
||||||
# ifdef DEBUGGINGAIDS
|
|
||||||
__clang_version__
|
|
||||||
# else
|
|
||||||
, __clang_major__, ".", __clang_minor__, ".", __clang_patchlevel__,
|
|
||||||
# endif
|
|
||||||
#elif defined _MSC_VER
|
|
||||||
"MSVC ",
|
|
||||||
# if defined _MSC_FULL_VER
|
|
||||||
_MSC_FULL_VER / 10000000, ".", _MSC_FULL_VER % 10000000 / 100000, ".", _MSC_FULL_VER % 100000, ".", _MSC_BUILD,
|
|
||||||
# else
|
|
||||||
_MSC_VER / 100, ".", _MSC_VER % 100,
|
|
||||||
# endif
|
|
||||||
#elif defined __GNUC__
|
|
||||||
"GCC "
|
|
||||||
# ifdef DEBUGGINGAIDS
|
|
||||||
__VERSION__
|
|
||||||
# else
|
|
||||||
, __GNUC__, ".", __GNUC_MINOR__,
|
|
||||||
# if defined __GNUC_PATCHLEVEL__
|
|
||||||
".", __GNUC_PATCHLEVEL__,
|
|
||||||
# endif
|
|
||||||
# endif
|
|
||||||
#else
|
|
||||||
"Unknown"
|
|
||||||
#endif
|
|
||||||
", "
|
|
||||||
#ifdef BITNESS64
|
|
||||||
"64"
|
|
||||||
#else
|
|
||||||
"32"
|
|
||||||
#endif
|
|
||||||
"-bit "
|
|
||||||
#if B_BIG_ENDIAN == 1
|
|
||||||
"big-endian"
|
|
||||||
#endif
|
|
||||||
"\n");
|
|
||||||
|
|
||||||
// TODO: architecture, OS, maybe build and feature settings
|
|
||||||
}
|
|
||||||
|
|
||||||
// def/clipmap handling
|
// def/clipmap handling
|
||||||
|
|
||||||
// g_defNamePtr can ONLY point to a malloc'd block (length BMAX_PATH)
|
// g_defNamePtr can ONLY point to a malloc'd block (length BMAX_PATH)
|
||||||
|
|
|
@ -44,6 +44,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
#include "palette.h"
|
#include "palette.h"
|
||||||
#include "gamecvars.h"
|
#include "gamecvars.h"
|
||||||
#include "gameconfigfile.h"
|
#include "gameconfigfile.h"
|
||||||
|
#include "printf.h"
|
||||||
|
|
||||||
#include "vfs.h"
|
#include "vfs.h"
|
||||||
|
|
||||||
|
@ -306,15 +307,13 @@ void G_GameExit(const char *msg)
|
||||||
{
|
{
|
||||||
if (!(msg[0] == ' ' && msg[1] == 0))
|
if (!(msg[0] == ' ' && msg[1] == 0))
|
||||||
{
|
{
|
||||||
char titlebuf[256];
|
I_Error(msg);
|
||||||
Bsprintf(titlebuf,HEAD2 " %s",s_buildRev);
|
|
||||||
wm_msgbox(titlebuf, "%s", msg);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Bfflush(NULL);
|
Bfflush(NULL);
|
||||||
|
|
||||||
Bexit(EXIT_SUCCESS);
|
throw ExitEvent(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -6228,11 +6227,6 @@ int app_main()
|
||||||
BGetTime,
|
BGetTime,
|
||||||
GAME_onshowosd);
|
GAME_onshowosd);
|
||||||
|
|
||||||
initprintf(HEAD2 " %s\n", s_buildRev);
|
|
||||||
PrintBuildInfo();
|
|
||||||
|
|
||||||
//G_AddSearchPaths();
|
|
||||||
|
|
||||||
g_skillCnt = 4;
|
g_skillCnt = 4;
|
||||||
ud.multimode = 1;
|
ud.multimode = 1;
|
||||||
ud.m_monsters_off = userConfig.nomonsters;
|
ud.m_monsters_off = userConfig.nomonsters;
|
||||||
|
@ -6241,10 +6235,6 @@ int app_main()
|
||||||
// accesses g_player[0].
|
// accesses g_player[0].
|
||||||
G_MaybeAllocPlayer(0);
|
G_MaybeAllocPlayer(0);
|
||||||
|
|
||||||
#ifdef EDUKE32_STANDALONE
|
|
||||||
G_DeleteOldSaves();
|
|
||||||
#endif
|
|
||||||
|
|
||||||
G_CheckCommandLine();
|
G_CheckCommandLine();
|
||||||
|
|
||||||
// This needs to happen afterwards, as G_CheckCommandLine() is where we set
|
// This needs to happen afterwards, as G_CheckCommandLine() is where we set
|
||||||
|
@ -6387,7 +6377,6 @@ int app_main()
|
||||||
|
|
||||||
initprintf("Initializing OSD...\n");
|
initprintf("Initializing OSD...\n");
|
||||||
|
|
||||||
Bsprintf(tempbuf, HEAD2 " %s", s_buildRev);
|
|
||||||
OSD_SetVersion(tempbuf, 10,0);
|
OSD_SetVersion(tempbuf, 10,0);
|
||||||
OSD_SetParameters(0, 0, 0, 12, 2, 12, OSD_ERROR, OSDTEXT_RED, 0);
|
OSD_SetParameters(0, 0, 0, 12, 2, 12, OSD_ERROR, OSDTEXT_RED, 0);
|
||||||
registerosdcommands();
|
registerosdcommands();
|
||||||
|
@ -7031,7 +7020,6 @@ void A_SpawnRandomGlass(int spriteNum, int wallNum, int glassCnt)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
extern void faketimerhandler();
|
extern void faketimerhandler();
|
||||||
extern int app_main();
|
|
||||||
extern void app_crashhandler(void);
|
extern void app_crashhandler(void);
|
||||||
|
|
||||||
GameInterface Interface = {
|
GameInterface Interface = {
|
||||||
|
|
|
@ -44,6 +44,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
#include "palette.h"
|
#include "palette.h"
|
||||||
#include "gamecvars.h"
|
#include "gamecvars.h"
|
||||||
#include "gameconfigfile.h"
|
#include "gameconfigfile.h"
|
||||||
|
#include "printf.h"
|
||||||
|
|
||||||
|
|
||||||
// Uncomment to prevent anything except mirrors from drawing. It is sensible to
|
// Uncomment to prevent anything except mirrors from drawing. It is sensible to
|
||||||
|
@ -397,15 +398,13 @@ void G_GameExit(const char *msg)
|
||||||
{
|
{
|
||||||
if (!(msg[0] == ' ' && msg[1] == 0))
|
if (!(msg[0] == ' ' && msg[1] == 0))
|
||||||
{
|
{
|
||||||
char titlebuf[256];
|
I_Error(msg);
|
||||||
Bsprintf(titlebuf,HEAD2 " %s",s_buildRev);
|
|
||||||
wm_msgbox(titlebuf, "%s", msg);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Bfflush(NULL);
|
Bfflush(NULL);
|
||||||
|
|
||||||
exit(0);
|
throw ExitEvent(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -7598,11 +7597,6 @@ int app_main()
|
||||||
BGetTime,
|
BGetTime,
|
||||||
GAME_onshowosd);
|
GAME_onshowosd);
|
||||||
|
|
||||||
initprintf(HEAD2 " %s\n", s_buildRev);
|
|
||||||
PrintBuildInfo();
|
|
||||||
|
|
||||||
//G_AddSearchPaths();
|
|
||||||
|
|
||||||
g_skillCnt = 4;
|
g_skillCnt = 4;
|
||||||
ud.multimode = 1;
|
ud.multimode = 1;
|
||||||
ud.m_monsters_off = userConfig.nomonsters;
|
ud.m_monsters_off = userConfig.nomonsters;
|
||||||
|
@ -7765,7 +7759,6 @@ int app_main()
|
||||||
|
|
||||||
initprintf("Initializing OSD...\n");
|
initprintf("Initializing OSD...\n");
|
||||||
|
|
||||||
Bsprintf(tempbuf, HEAD2 " %s", s_buildRev);
|
|
||||||
OSD_SetVersion(tempbuf, 10,0);
|
OSD_SetVersion(tempbuf, 10,0);
|
||||||
OSD_SetParameters(0, 0, 0, 12, 2, 12, OSD_ERROR, OSDTEXT_RED, 0);
|
OSD_SetParameters(0, 0, 0, 12, 2, 12, OSD_ERROR, OSDTEXT_RED, 0);
|
||||||
registerosdcommands();
|
registerosdcommands();
|
||||||
|
|
|
@ -91,6 +91,7 @@ Things required to make savegames work:
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
#include "common_game.h"
|
#include "common_game.h"
|
||||||
#include "gameconfigfile.h"
|
#include "gameconfigfile.h"
|
||||||
|
#include "printf.h"
|
||||||
|
|
||||||
//#include "crc32.h"
|
//#include "crc32.h"
|
||||||
|
|
||||||
|
@ -845,9 +846,7 @@ int nextvoxid = 0; // JBF
|
||||||
|
|
||||||
static void SW_FatalEngineError(void)
|
static void SW_FatalEngineError(void)
|
||||||
{
|
{
|
||||||
wm_msgbox("Build Engine Initialisation Error",
|
I_Error("There was a problem initialising the Build engine: %s", engineerrstr);
|
||||||
"There was a problem initialising the Build engine: %s", engineerrstr);
|
|
||||||
exit(1);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -3342,18 +3341,13 @@ int32_t app_main()
|
||||||
int cnt = 0;
|
int cnt = 0;
|
||||||
uint32_t TotalMemory;
|
uint32_t TotalMemory;
|
||||||
|
|
||||||
initprintf(APPNAME " %s\n", s_buildRev);
|
|
||||||
PrintBuildInfo();
|
|
||||||
|
|
||||||
SW_ExtInit();
|
SW_ExtInit();
|
||||||
|
|
||||||
i = CONFIG_ReadSetup();
|
i = CONFIG_ReadSetup();
|
||||||
|
|
||||||
if (enginePreInit())
|
if (enginePreInit())
|
||||||
{
|
{
|
||||||
wm_msgbox("Build Engine Initialisation Error",
|
I_Error("There was a problem initialising the Build engine: %s", engineerrstr);
|
||||||
"There was a problem initialising the Build engine: %s", engineerrstr);
|
|
||||||
exit(1);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
initgroupfile(G_GrpFile());
|
initgroupfile(G_GrpFile());
|
||||||
|
|
Loading…
Reference in a new issue