mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
sdl/i_main.c: while we're here, split all the logging initialisation code into a separate function, to make main function more clean
This commit is contained in:
parent
8f776b9318
commit
d6ef2625f5
1 changed files with 88 additions and 83 deletions
|
|
@ -103,39 +103,10 @@ static inline VOID MakeCodeWritable(VOID)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef LOGMESSAGES
|
||||||
/** \brief The main function
|
static VOID InitLogging(VOID)
|
||||||
|
|
||||||
\param argc number of arg
|
|
||||||
\param *argv string table
|
|
||||||
|
|
||||||
\return int
|
|
||||||
*/
|
|
||||||
#if defined (__GNUC__) && (__GNUC__ >= 4)
|
|
||||||
#pragma GCC diagnostic ignored "-Wmissing-noreturn"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef FORCESDLMAIN
|
|
||||||
int SDL_main(int argc, char **argv)
|
|
||||||
#else
|
|
||||||
int main(int argc, char **argv)
|
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
const char *logdir = NULL;
|
const char *logdir = NULL;
|
||||||
myargc = argc;
|
|
||||||
myargv = argv; /// \todo pull out path to exe from this string
|
|
||||||
|
|
||||||
#ifdef HAVE_TTF
|
|
||||||
#ifdef _WIN32
|
|
||||||
I_StartupTTF(FONTPOINTSIZE, SDL_INIT_VIDEO|SDL_INIT_AUDIO, SDL_SWSURFACE);
|
|
||||||
#else
|
|
||||||
I_StartupTTF(FONTPOINTSIZE, SDL_INIT_VIDEO, SDL_SWSURFACE);
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef LOGMESSAGES
|
|
||||||
if (!M_CheckParm("-nolog"))
|
|
||||||
{
|
|
||||||
time_t my_time;
|
time_t my_time;
|
||||||
struct tm * timeinfo;
|
struct tm * timeinfo;
|
||||||
const char *format;
|
const char *format;
|
||||||
|
|
@ -217,6 +188,40 @@ int main(int argc, char **argv)
|
||||||
logstream = fopen("latest-log.txt", "wt+");
|
logstream = fopen("latest-log.txt", "wt+");
|
||||||
#endif/*defined (__unix__) || defined(__APPLE__) || defined (UNIXCOMMON)*/
|
#endif/*defined (__unix__) || defined(__APPLE__) || defined (UNIXCOMMON)*/
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
/** \brief The main function
|
||||||
|
|
||||||
|
\param argc number of arg
|
||||||
|
\param *argv string table
|
||||||
|
|
||||||
|
\return int
|
||||||
|
*/
|
||||||
|
#if defined (__GNUC__) && (__GNUC__ >= 4)
|
||||||
|
#pragma GCC diagnostic ignored "-Wmissing-noreturn"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef FORCESDLMAIN
|
||||||
|
int SDL_main(int argc, char **argv)
|
||||||
|
#else
|
||||||
|
int main(int argc, char **argv)
|
||||||
|
#endif
|
||||||
|
{
|
||||||
|
myargc = argc;
|
||||||
|
myargv = argv; /// \todo pull out path to exe from this string
|
||||||
|
|
||||||
|
#ifdef HAVE_TTF
|
||||||
|
#ifdef _WIN32
|
||||||
|
I_StartupTTF(FONTPOINTSIZE, SDL_INIT_VIDEO|SDL_INIT_AUDIO, SDL_SWSURFACE);
|
||||||
|
#else
|
||||||
|
I_StartupTTF(FONTPOINTSIZE, SDL_INIT_VIDEO, SDL_SWSURFACE);
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef LOGMESSAGES
|
||||||
|
if (!M_CheckParm("-nolog"))
|
||||||
|
InitLogging();
|
||||||
#endif/*LOGMESSAGES*/
|
#endif/*LOGMESSAGES*/
|
||||||
|
|
||||||
//I_OutputMsg("I_StartupSystem() ...\n");
|
//I_OutputMsg("I_StartupSystem() ...\n");
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue