largv[com_argc] = argvdummy;
com_argv = largv;
-#if ZYMOTIC
+#if BLOODBATH
+ gamemode = GAME_BLOODBATH;
+#elif ZYMOTIC
gamemode = GAME_ZYMOTIC;
#elif FIENDARENA
gamemode = GAME_FIENDARENA;
#elif NEHAHRA
gamemode = GAME_NEHAHRA;
#else
- if (COM_CheckParm ("-zymotic"))
+ if (COM_CheckParm ("-bloodbath"))
+ gamemode = GAME_BLOODBATH;
+ else if (COM_CheckParm ("-zymotic"))
gamemode = GAME_ZYMOTIC;
else if (COM_CheckParm ("-fiendarena"))
gamemode = GAME_FIENDARENA;
case GAME_ZYMOTIC:
gamename = "Zymotic";
break;
+ case GAME_BLOODBATH:
+ gamename = "BloodBath";
+ break;
default:
Sys_Error("COM_InitArgv: unknown gamemode %i\n", gamemode);
break;
The filename will be prefixed by the current game directory
============
*/
-void COM_WriteFile (char *filename, void *data, int len)
+qboolean COM_WriteFile (char *filename, void *data, int len)
{
int handle;
char name[MAX_OSPATH];
handle = Sys_FileOpenWrite (name);
if (handle == -1)
{
- Sys_Printf ("COM_WriteFile: failed on %s\n", name);
- return;
+ Con_Printf ("COM_WriteFile: failed on %s\n", name);
+ return false;
}
- Con_Printf ("COM_WriteFile: %s\n", name);
+ Con_DPrintf ("COM_WriteFile: %s\n", name);
Sys_FileWrite (handle, data, len);
Sys_FileClose (handle);
+ return true;
}
*/
void COM_AddGameDirectory (char *dir)
{
- int i;
- searchpath_t *search;
- pack_t *pak;
- char pakfile[MAX_OSPATH];
+ //int i;
+ stringlist_t *list, *current;
+ searchpath_t *search;
+ pack_t *pak;
+ char pakfile[MAX_OSPATH];
strcpy (com_gamedir, dir);
search->next = com_searchpaths;
com_searchpaths = search;
+ // add any paks in the directory
+ list = listdirectory(dir);
+ for (current = list;current;current = current->next)
+ {
+ if (matchpattern(current->text, "*.pak"))
+ {
+ sprintf (pakfile, "%s/%s", dir, current->text);
+ pak = COM_LoadPackFile (pakfile);
+ if (pak)
+ {
+ search = Mem_Alloc(pak_mempool, sizeof(searchpath_t));
+ search->pack = pak;
+ search->next = com_searchpaths;
+ com_searchpaths = search;
+ }
+ else
+ Con_Printf("unable to load pak \"%s\"\n", pakfile);
+ }
+ }
+ freedirectory(list);
+
+ /*
//
// add any pak files in the format pak0.pak pak1.pak, ...
//
search->next = com_searchpaths;
com_searchpaths = search;
}
+ */
//
// add the contents of the parms.txt file to the end of the command line
case GAME_ZYMOTIC:
COM_AddGameDirectory (va("%s/zymotic", basedir) );
break;
+ case GAME_BLOODBATH:
+ COM_AddGameDirectory (va("%s/bb", basedir) );
+ break;
default:
Sys_Error("COM_InitFilesystem: unknown gamemode %i\n", gamemode);
break;