extern const char *buildstring;
const char *buildstring =
#ifdef VCREVISION
-STRINGIFY(VCREVISION)
+ STRINGIFY(VCREVISION)
#else
-"-"
+ "-"
#endif
#ifndef NO_BUILD_TIMESTAMPS
-//" " __TIME__
-" " __DATE__
+// " " __TIME__
+ " " __DATE__
#endif
#ifdef BUILDTYPE
-" " STRINGIFY(BUILDTYPE)
+ " " STRINGIFY(BUILDTYPE)
+#endif
+#ifdef __clang__ // must be first because clang pretends to be GCC 4.2...
+ " Clang "
+// STRINGIFY(__clang_major__)
+// "."
+// STRINGIFY(__clang_minor__)
+#elifdef __GNUC__
+ " GCC "
+// STRINGIFY(__GNUC__)
+// "."
+// STRINGIFY(__GNUC_MINOR__)
+#elifdef _MSC_VER
+ " MSC "
+// STRINGIFY(_MSC_VER)
#endif
;
Con_Printf("\n");
Con_Printf("gamename for server filtering: %s\n", gamenetworkfiltername);
+
+ Host_UpdateVersion();
}
return ret;
}
if (PRVM_clientfunction(CSQC_Init))
{
PRVM_G_FLOAT(OFS_PARM0) = 1.0f; // CSQC_SIMPLE engines always pass 0, FTE always passes 1
- PRVM_G_INT(OFS_PARM1) = PRVM_SetEngineString(prog, gamename);
+ // always include "DarkPlaces" so it can be recognised when gamename doesn't include it
+ PRVM_G_INT(OFS_PARM1) = PRVM_SetEngineString(prog, va(vabuf, sizeof(vabuf), "DarkPlaces %s", gamename));
PRVM_G_FLOAT(OFS_PARM2) = 1.0f; // TODO DP versions...
prog->ExecuteProgram(prog, PRVM_clientfunction(CSQC_Init), "QC function CSQC_Init is missing");
}
Con_Printf("Version: %s\n", engineversion);
}
+void Host_UpdateVersion(void)
+{
+ dpsnprintf(engineversion, sizeof(engineversion), "%s %s%s %s", gamename ? gamename : "DarkPlaces", DP_OS_NAME, cls.state == ca_dedicated ? " dedicated" : "", buildstring);
+}
+
static void Host_Framerate_c(cvar_t *var)
{
if (var->value < 0.00001 && var->value != 0)
Cvar_RegisterVariable (&r_texture_jpeg_fastpicmip);
}
-char engineversion[128];
+char engineversion[128]; ///< version string for the corner of the console, crash messages, status command, etc
static qfile_t *locksession_fh = NULL;
if (Sys_CheckParm ("-dedicated") || !cl_available)
cls.state = ca_dedicated;
+ // set and print initial version string (will be updated when gamename is changed)
+ Host_UpdateVersion(); // checks for cls.state == ca_dedicated
+ Con_Printf("%s\n", engineversion);
+
// initialize console command/cvar/alias/command execution systems
Cmd_Init();
// initialize filesystem (including fs_basedir, fs_gamedir, -game, scr_screenshot_name, gamename)
FS_Init();
- // ASAP! construct a version string for the corner of the console and for crash messages
- dpsnprintf (engineversion, sizeof (engineversion), "%s %s%s, buildstring: %s", gamename, DP_OS_NAME, cls.state == ca_dedicated ? " dedicated" : "", buildstring);
- Con_Printf("%s\n", engineversion);
-
// initialize process nice level
Sys_InitProcessNice();
void Host_Main(void);
void Host_Error(const char *error, ...) DP_FUNC_PRINTF(1) DP_FUNC_NORETURN;
+void Host_UpdateVersion(void);
void Host_LockSession(void);
void Host_UnlockSession(void);
void Host_AbortCurrentFrame(void) DP_FUNC_NORETURN;
// init mempools
PRVM_MEM_Alloc(prog);
- Con_Printf("%s: program loaded (crc %i, size %iK)\n", prog->name, prog->filecrc, (int)(filesize/1024));
+ Con_Printf("%s: program loaded (crc %i, size %iK)%s\n", prog->name, prog->filecrc, (int)(filesize/1024),
+ prog == CLVM_prog ? (prog->flag & PRVM_CSQC_SIMPLE ? " CSQC_SIMPLE" : " EXT_CSQC") : "");
// Inittime is at least the time when this function finished. However,
// later events may bump it.