kill annoying warnings. remove commented pakfile/progs.dat testing code from Modlist_Init().

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1464 af15c1b1-3010-417e-b628-4374ebc0bcbd
This commit is contained in:
Ozkan Sezer 2017-08-04 20:36:59 +00:00
parent 6b2affaebc
commit 10ed2c85dc
3 changed files with 12 additions and 42 deletions

View file

@ -578,7 +578,9 @@ static qboolean VID_SetMode (int width, int height, int refreshrate, int bpp, qb
char caption[50]; char caption[50];
int depthbits, stencilbits; int depthbits, stencilbits;
int fsaa_obtained; int fsaa_obtained;
#if defined(USE_SDL2)
int previous_display; int previous_display;
#endif
// so Con_Printfs don't mess us up by forcing vid and snd updates // so Con_Printfs don't mess us up by forcing vid and snd updates
temp = scr_disabled_for_loading; temp = scr_disabled_for_loading;
@ -1758,7 +1760,9 @@ void VID_Toggle (void)
// keep all the mode changing code in one place. // keep all the mode changing code in one place.
static qboolean vid_toggle_works = false; static qboolean vid_toggle_works = false;
qboolean toggleWorked; qboolean toggleWorked;
#if defined(USE_SDL2)
Uint32 flags = 0; Uint32 flags = 0;
#endif
S_ClearBuffer (); S_ClearBuffer ();
@ -1777,8 +1781,7 @@ void VID_Toggle (void)
} }
#if defined(USE_SDL2) #if defined(USE_SDL2)
if (!VID_GetFullscreen()) if (!VID_GetFullscreen()) {
{
flags = vid_desktopfullscreen.value ? SDL_WINDOW_FULLSCREEN_DESKTOP : SDL_WINDOW_FULLSCREEN; flags = vid_desktopfullscreen.value ? SDL_WINDOW_FULLSCREEN_DESKTOP : SDL_WINDOW_FULLSCREEN;
} }

View file

@ -228,8 +228,8 @@ void Modlist_Add (const char *name)
#ifdef _WIN32 #ifdef _WIN32
void Modlist_Init (void) void Modlist_Init (void)
{ {
WIN32_FIND_DATA fdat, mod_fdat; WIN32_FIND_DATA fdat;
HANDLE fhnd, mod_fhnd; HANDLE fhnd;
DWORD attribs; DWORD attribs;
char dir_string[MAX_OSPATH], mod_string[MAX_OSPATH]; char dir_string[MAX_OSPATH], mod_string[MAX_OSPATH];
@ -242,30 +242,12 @@ void Modlist_Init (void)
{ {
if (!strcmp(fdat.cFileName, ".") || !strcmp(fdat.cFileName, "..")) if (!strcmp(fdat.cFileName, ".") || !strcmp(fdat.cFileName, ".."))
continue; continue;
#if 1
// treat all subdirectories as mods
q_snprintf (mod_string, sizeof(mod_string), "%s/%s", com_basedir, fdat.cFileName); q_snprintf (mod_string, sizeof(mod_string), "%s/%s", com_basedir, fdat.cFileName);
attribs = GetFileAttributes (mod_string); attribs = GetFileAttributes (mod_string);
if (attribs != INVALID_FILE_ATTRIBUTES && (attribs & FILE_ATTRIBUTE_DIRECTORY)) if (attribs != INVALID_FILE_ATTRIBUTES && (attribs & FILE_ATTRIBUTE_DIRECTORY)) {
{ /* don't bother testing for pak files / progs.dat */
Modlist_Add(fdat.cFileName); Modlist_Add(fdat.cFileName);
} }
#else
q_snprintf (mod_string, sizeof(mod_string), "%s/%s/progs.dat", com_basedir, fdat.cFileName);
mod_fhnd = FindFirstFile(mod_string, &mod_fdat);
if (mod_fhnd != INVALID_HANDLE_VALUE) {
FindClose(mod_fhnd);
Modlist_Add(fdat.cFileName);
}
else {
q_snprintf (mod_string, sizeof(mod_string), "%s/%s/*.pak", com_basedir, fdat.cFileName);
mod_fhnd = FindFirstFile(mod_string, &mod_fdat);
if (mod_fhnd != INVALID_HANDLE_VALUE) {
FindClose(mod_fhnd);
Modlist_Add(fdat.cFileName);
}
}
#endif
} while (FindNextFile(fhnd, &fdat)); } while (FindNextFile(fhnd, &fdat));
FindClose(fhnd); FindClose(fhnd);
@ -292,23 +274,8 @@ void Modlist_Init (void)
mod_dir_p = opendir(mod_string); mod_dir_p = opendir(mod_string);
if (mod_dir_p == NULL) if (mod_dir_p == NULL)
continue; continue;
#if 0 /* don't bother testing for pak files / progs.dat */
// find progs.dat and pak file(s)
while ((mod_dir_t = readdir(mod_dir_p)) != NULL)
{
if (!q_strcasecmp(mod_dir_t->d_name, "progs.dat")) {
Modlist_Add(dir_t->d_name);
break;
}
if (!q_strcasecmp(COM_FileGetExtension(mod_dir_t->d_name), "pak")) {
Modlist_Add(dir_t->d_name);
break;
}
}
#else
// don't bother testing for pak files / progs.dat
Modlist_Add(dir_t->d_name); Modlist_Add(dir_t->d_name);
#endif
closedir(mod_dir_p); closedir(mod_dir_p);
} }

View file

@ -374,7 +374,7 @@ const char *Sys_ConsoleInput (void)
if (GetNumberOfConsoleInputEvents(hinput, &numevents) == 0) if (GetNumberOfConsoleInputEvents(hinput, &numevents) == 0)
Sys_Error ("Error getting # of console events"); Sys_Error ("Error getting # of console events");
if (numevents <= 0) if (! numevents)
break; break;
if (ReadConsoleInput(hinput, recs, 1, &numread) == 0) if (ReadConsoleInput(hinput, recs, 1, &numread) == 0)