mirror of
https://git.code.sf.net/p/quake/quakeforge-old
synced 2025-03-21 00:11:24 +00:00
common/gl_vidglx.c:
some tweeks in an attempt to improve shutdown. NOT the final say qw_server/sv_ccmds.c: comment correction common/quakefs.c uquake/host_cmd.c: knghtbrd's gamedir patch, plus some Hunk_Alloc -> Z_Malloc changes.
This commit is contained in:
parent
d6143f645f
commit
592b054f82
4 changed files with 57 additions and 8 deletions
|
@ -141,10 +141,12 @@ void D_EndDirectRect (int x, int y, int width, int height)
|
|||
void
|
||||
VID_Shutdown(void)
|
||||
{
|
||||
if (!ctx) return;
|
||||
Con_Printf("VID_Shutdown\n");
|
||||
|
||||
glXDestroyContext(x_disp, ctx);
|
||||
ctx = NULL;
|
||||
if (x_disp && ctx) {
|
||||
glXDestroyContext(x_disp, ctx);
|
||||
ctx = NULL;
|
||||
}
|
||||
#ifdef HAS_DGA
|
||||
if (hasvidmode) {
|
||||
int i;
|
||||
|
@ -162,8 +164,10 @@ VID_Shutdown(void)
|
|||
}
|
||||
#endif
|
||||
|
||||
XCloseDisplay(x_disp);
|
||||
x_disp = NULL;
|
||||
if (x_disp) {
|
||||
XCloseDisplay(x_disp);
|
||||
x_disp = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -689,7 +689,7 @@ COM_LoadGameDirectory(char *dir)
|
|||
if( !pak ) {
|
||||
done = true;
|
||||
} else {
|
||||
search = Hunk_Alloc (sizeof(searchpath_t));
|
||||
search = Z_Malloc (sizeof(searchpath_t));
|
||||
search->pack = pak;
|
||||
search->next = com_searchpaths;
|
||||
com_searchpaths = search;
|
||||
|
@ -737,7 +737,7 @@ void COM_AddGameDirectory (char *dir)
|
|||
//
|
||||
// add the directory to the search path
|
||||
//
|
||||
search = Hunk_Alloc (sizeof(searchpath_t));
|
||||
search = Z_Malloc (sizeof(searchpath_t));
|
||||
strcpy (search->filename, dir);
|
||||
search->next = com_searchpaths;
|
||||
com_searchpaths = search;
|
||||
|
@ -802,10 +802,18 @@ void COM_Gamedir (char *dir)
|
|||
//
|
||||
// add the directory to the search path
|
||||
//
|
||||
#if 1
|
||||
//search = Hunk_Alloc (sizeof(searchpath_t));
|
||||
search = Z_Malloc (sizeof(searchpath_t));
|
||||
strcpy (search->filename, dir);
|
||||
search->next = com_searchpaths;
|
||||
com_searchpaths = search;
|
||||
#else
|
||||
search = Z_Malloc (sizeof(searchpath_t));
|
||||
strcpy (search->filename, com_gamedir);
|
||||
search->next = com_searchpaths;
|
||||
com_searchpaths = search;
|
||||
#endif
|
||||
|
||||
//
|
||||
// add any pak files in the format pak0.pak pak1.pak, ...
|
||||
|
|
|
@ -685,7 +685,6 @@ void SV_Gamedir (void)
|
|||
================
|
||||
SV_Floodport_f
|
||||
|
||||
Sets the gamedir and path to a different directory.
|
||||
================
|
||||
*/
|
||||
|
||||
|
|
|
@ -192,6 +192,43 @@ void Host_Noclip_f (void)
|
|||
}
|
||||
}
|
||||
|
||||
/*
|
||||
================
|
||||
Host_Gamedir_f
|
||||
|
||||
Sets the gamedir and path to a different directory.
|
||||
================
|
||||
*/
|
||||
char gamedirfile[MAX_OSPATH];
|
||||
void
|
||||
Host_Gamedir_f (void)
|
||||
{
|
||||
char *dir;
|
||||
|
||||
if (Cmd_Argc() == 1)
|
||||
{
|
||||
Con_Printf ("Current gamedir: %s\n", com_gamedir);
|
||||
return;
|
||||
}
|
||||
|
||||
if (Cmd_Argc() != 2)
|
||||
{
|
||||
Con_Printf ("Usage: gamedir <newdir>\n");
|
||||
return;
|
||||
}
|
||||
|
||||
dir = Cmd_Argv(1);
|
||||
|
||||
if (strstr(dir, "..") || strstr(dir, "/")
|
||||
|| strstr(dir, "\\") || strstr(dir, ":") )
|
||||
{
|
||||
Con_Printf ("Gamedir should be a single filename, not a path\n");
|
||||
return;
|
||||
}
|
||||
|
||||
COM_Gamedir (dir);
|
||||
}
|
||||
|
||||
/*
|
||||
==================
|
||||
Host_Fly_f
|
||||
|
@ -1917,4 +1954,5 @@ void Host_InitCommands (void)
|
|||
Cmd_AddCommand ("viewprev", Host_Viewprev_f);
|
||||
|
||||
Cmd_AddCommand ("mcache", Mod_Print);
|
||||
Cmd_AddCommand ("gamedir", Host_Gamedir_f);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue