]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - common.c
fix cs_project and cs_unproject builtins, they were completely ignoring
[xonotic/darkplaces.git] / common.c
index 399984bb57e7f6ea0e26bf95fe9b47f12144d1ab..c9248464517a1642835cd06effb11b7af39b76c5 100644 (file)
--- a/common.c
+++ b/common.c
@@ -1417,8 +1417,8 @@ typedef struct gamemode_info_s
        const char* gameuserdirname;
 } gamemode_info_t;
 
-static const gamemode_info_t gamemode_info [] =
-{// prog_name          cmdline                 gamename                                gamedirname     gamescreenshotname
+static const gamemode_info_t gamemode_info [GAME_COUNT] =
+{// prog_name          cmdline                 gamename                                basegame        modgame                 screenshotprefix        userdir
 
 // GAME_NORMAL
 // COMMANDLINEOPTION: Game: -quake runs the game Quake (default)
@@ -1485,7 +1485,13 @@ static const gamemode_info_t gamemode_info [] =
 { "contagiontheory",           "-contagiontheory",     "Contagion Theory",                     "ctdata",       NULL,                   "ct",                   "contagiontheory" },
 // GAME_EDU2P
 // COMMANDLINEOPTION: Game: -edu2p runs the game Edu2 prototype
-{ "edu2p", "-edu2p", "EDU2 Prototype", "id1", "data", "edu2_p", "edu2prototype" },
+{ "edu2p", "-edu2p", "EDU2 Prototype", "id1", "edu2", "edu2_p", "edu2prototype" },
+// GAME_BLADEMASTER
+// COMMANDLINEOPTION: Game: -blademaster runs the game Prophecy: Return of the BladeMaster
+{ "blademaster", "-blademaster", "Prophecy: Return of the BladeMaster", "basebm", NULL, "blademaster", "blademaster" },
+// GAME_PROPHECY
+// COMMANDLINEOPTION: Game: -prophecy runs the game Quake (default)
+{ "prophecy",                          "-prophecy",            "Prophecy",             "data",         NULL,                   "prophecy",                     "prophecy" },
 };
 
 void COM_InitGameType (void)
@@ -1617,7 +1623,11 @@ int dpvsnprintf (char *buffer, size_t buffersize, const char *format, va_list ar
 {
        int result;
 
+#if _MSC_VER >= 1400
+       result = _vsnprintf_s (buffer, buffersize, _TRUNCATE, format, args);
+#else
        result = vsnprintf (buffer, buffersize, format, args);
+#endif
        if (result < 0 || (size_t)result >= buffersize)
        {
                buffer[buffersize - 1] = '\0';
@@ -2020,7 +2030,7 @@ void InfoString_SetValue(char *buffer, size_t bufferlength, const char *key, con
                // set the key/value and append the remaining text
                char tempbuffer[4096];
                strlcpy(tempbuffer, buffer + pos2, sizeof(tempbuffer));
-               sprintf(buffer + pos, "\\%s\\%s%s", key, value, tempbuffer);
+               dpsnprintf(buffer + pos, bufferlength - pos, "\\%s\\%s%s", key, value, tempbuffer);
        }
        else
        {