mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-11-10 23:02:03 +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,
|
||||
GAME_onshowosd);
|
||||
|
||||
wm_setapptitle(APPNAME);
|
||||
|
||||
initprintf(APPNAME " %s\n", s_buildRev);
|
||||
PrintBuildInfo();
|
||||
|
||||
memcpy(&gGameOptions, &gSingleGameOptions, sizeof(GAMEOPTIONS));
|
||||
gGameOptions.nMonsterSettings = userConfig.nomonsters;
|
||||
bQuickStart = userConfig.nologo;
|
||||
|
@ -1277,7 +1272,6 @@ int app_main()
|
|||
|
||||
initprintf("Initializing OSD...\n");
|
||||
|
||||
//Bsprintf(tempbuf, HEAD2 " %s", s_buildRev);
|
||||
OSD_SetVersion("Blood", 10, 0);
|
||||
OSD_SetParameters(0, 0, 0, 12, 2, 12, OSD_ERROR, OSDTEXT_RED, 0);
|
||||
registerosdcommands();
|
||||
|
|
|
@ -28,6 +28,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|||
#include "pragmas.h"
|
||||
#include "misc.h"
|
||||
#include "network.h"
|
||||
#include "printf.h"
|
||||
|
||||
BEGIN_BLD_NS
|
||||
|
||||
|
@ -37,7 +38,6 @@ BEGIN_BLD_NS
|
|||
#define EXEVERSION 101
|
||||
|
||||
void _SetErrorLoc(const char *pzFile, int nLine);
|
||||
void _ThrowError(const char *pzFormat, ...);
|
||||
void __dassert(const char *pzExpr, const char *pzFile, int nLine);
|
||||
void QuitGame(void);
|
||||
void _consoleSysMsg(const char* pMessage, ...);
|
||||
|
@ -45,7 +45,7 @@ void _consoleSysMsg(const char* pMessage, ...);
|
|||
#define ThrowError(...) \
|
||||
{ \
|
||||
_SetErrorLoc(__FILE__,__LINE__); \
|
||||
_ThrowError(__VA_ARGS__); \
|
||||
I_Error(__VA_ARGS__); \
|
||||
}
|
||||
|
||||
// print error to console only
|
||||
|
@ -55,7 +55,7 @@ void _consoleSysMsg(const char* pMessage, ...);
|
|||
_consoleSysMsg(__VA_ARGS__); \
|
||||
}
|
||||
|
||||
#define dassert(x) if (!(x)) __dassert(#x,__FILE__,__LINE__)
|
||||
#define dassert(x) assert(x)
|
||||
|
||||
|
||||
#define kMaxSectors MAXSECTORS
|
||||
|
|
|
@ -55,22 +55,6 @@ void _SetErrorLoc(const char *pzFile, int 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)
|
||||
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)
|
||||
{
|
||||
if (!gVersionString)
|
||||
|
|
|
@ -52,8 +52,6 @@ extern const char *s_buildRev;
|
|||
extern const char *s_buildTimestamp;
|
||||
|
||||
//// FUNCTIONS
|
||||
extern void PrintBuildInfo(void);
|
||||
|
||||
extern void clearDefNamePtr(void);
|
||||
|
||||
void G_AddDef(const char *buffer);
|
||||
|
|
|
@ -13,55 +13,6 @@
|
|||
|
||||
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
|
||||
|
||||
// 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 "gamecvars.h"
|
||||
#include "gameconfigfile.h"
|
||||
#include "printf.h"
|
||||
|
||||
#include "vfs.h"
|
||||
|
||||
|
@ -306,15 +307,13 @@ void G_GameExit(const char *msg)
|
|||
{
|
||||
if (!(msg[0] == ' ' && msg[1] == 0))
|
||||
{
|
||||
char titlebuf[256];
|
||||
Bsprintf(titlebuf,HEAD2 " %s",s_buildRev);
|
||||
wm_msgbox(titlebuf, "%s", msg);
|
||||
I_Error(msg);
|
||||
}
|
||||
}
|
||||
|
||||
Bfflush(NULL);
|
||||
|
||||
Bexit(EXIT_SUCCESS);
|
||||
throw ExitEvent(0);
|
||||
}
|
||||
|
||||
|
||||
|
@ -6228,11 +6227,6 @@ int app_main()
|
|||
BGetTime,
|
||||
GAME_onshowosd);
|
||||
|
||||
initprintf(HEAD2 " %s\n", s_buildRev);
|
||||
PrintBuildInfo();
|
||||
|
||||
//G_AddSearchPaths();
|
||||
|
||||
g_skillCnt = 4;
|
||||
ud.multimode = 1;
|
||||
ud.m_monsters_off = userConfig.nomonsters;
|
||||
|
@ -6241,10 +6235,6 @@ int app_main()
|
|||
// accesses g_player[0].
|
||||
G_MaybeAllocPlayer(0);
|
||||
|
||||
#ifdef EDUKE32_STANDALONE
|
||||
G_DeleteOldSaves();
|
||||
#endif
|
||||
|
||||
G_CheckCommandLine();
|
||||
|
||||
// This needs to happen afterwards, as G_CheckCommandLine() is where we set
|
||||
|
@ -6387,7 +6377,6 @@ int app_main()
|
|||
|
||||
initprintf("Initializing OSD...\n");
|
||||
|
||||
Bsprintf(tempbuf, HEAD2 " %s", s_buildRev);
|
||||
OSD_SetVersion(tempbuf, 10,0);
|
||||
OSD_SetParameters(0, 0, 0, 12, 2, 12, OSD_ERROR, OSDTEXT_RED, 0);
|
||||
registerosdcommands();
|
||||
|
@ -7031,7 +7020,6 @@ void A_SpawnRandomGlass(int spriteNum, int wallNum, int glassCnt)
|
|||
#endif
|
||||
|
||||
extern void faketimerhandler();
|
||||
extern int app_main();
|
||||
extern void app_crashhandler(void);
|
||||
|
||||
GameInterface Interface = {
|
||||
|
|
|
@ -44,6 +44,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|||
#include "palette.h"
|
||||
#include "gamecvars.h"
|
||||
#include "gameconfigfile.h"
|
||||
#include "printf.h"
|
||||
|
||||
|
||||
// Uncomment to prevent anything except mirrors from drawing. It is sensible to
|
||||
|
@ -393,19 +394,17 @@ void G_GameExit(const char *msg)
|
|||
if (in3dmode())
|
||||
G_Shutdown();
|
||||
|
||||
if (*msg != 0)
|
||||
{
|
||||
if (!(msg[0] == ' ' && msg[1] == 0))
|
||||
{
|
||||
char titlebuf[256];
|
||||
Bsprintf(titlebuf,HEAD2 " %s",s_buildRev);
|
||||
wm_msgbox(titlebuf, "%s", msg);
|
||||
}
|
||||
}
|
||||
if (*msg != 0)
|
||||
{
|
||||
if (!(msg[0] == ' ' && msg[1] == 0))
|
||||
{
|
||||
I_Error(msg);
|
||||
}
|
||||
}
|
||||
|
||||
Bfflush(NULL);
|
||||
Bfflush(NULL);
|
||||
|
||||
exit(0);
|
||||
throw ExitEvent(0);
|
||||
}
|
||||
|
||||
|
||||
|
@ -7598,11 +7597,6 @@ int app_main()
|
|||
BGetTime,
|
||||
GAME_onshowosd);
|
||||
|
||||
initprintf(HEAD2 " %s\n", s_buildRev);
|
||||
PrintBuildInfo();
|
||||
|
||||
//G_AddSearchPaths();
|
||||
|
||||
g_skillCnt = 4;
|
||||
ud.multimode = 1;
|
||||
ud.m_monsters_off = userConfig.nomonsters;
|
||||
|
@ -7765,7 +7759,6 @@ int app_main()
|
|||
|
||||
initprintf("Initializing OSD...\n");
|
||||
|
||||
Bsprintf(tempbuf, HEAD2 " %s", s_buildRev);
|
||||
OSD_SetVersion(tempbuf, 10,0);
|
||||
OSD_SetParameters(0, 0, 0, 12, 2, 12, OSD_ERROR, OSDTEXT_RED, 0);
|
||||
registerosdcommands();
|
||||
|
|
|
@ -91,6 +91,7 @@ Things required to make savegames work:
|
|||
#include "common.h"
|
||||
#include "common_game.h"
|
||||
#include "gameconfigfile.h"
|
||||
#include "printf.h"
|
||||
|
||||
//#include "crc32.h"
|
||||
|
||||
|
@ -845,9 +846,7 @@ int nextvoxid = 0; // JBF
|
|||
|
||||
static void SW_FatalEngineError(void)
|
||||
{
|
||||
wm_msgbox("Build Engine Initialisation Error",
|
||||
"There was a problem initialising the Build engine: %s", engineerrstr);
|
||||
exit(1);
|
||||
I_Error("There was a problem initialising the Build engine: %s", engineerrstr);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -3342,18 +3341,13 @@ int32_t app_main()
|
|||
int cnt = 0;
|
||||
uint32_t TotalMemory;
|
||||
|
||||
initprintf(APPNAME " %s\n", s_buildRev);
|
||||
PrintBuildInfo();
|
||||
|
||||
SW_ExtInit();
|
||||
|
||||
i = CONFIG_ReadSetup();
|
||||
|
||||
if (enginePreInit())
|
||||
{
|
||||
wm_msgbox("Build Engine Initialisation Error",
|
||||
"There was a problem initialising the Build engine: %s", engineerrstr);
|
||||
exit(1);
|
||||
I_Error("There was a problem initialising the Build engine: %s", engineerrstr);
|
||||
}
|
||||
|
||||
initgroupfile(G_GrpFile());
|
||||
|
|
Loading…
Reference in a new issue