Applied Thad Ward's patch to make win32 locase filenames. Also a few

cleanups, mostly whitespace.
This commit is contained in:
Jeff Teunissen 2000-04-01 09:59:35 +00:00
parent 955c3d03a2
commit b619de9c05
4 changed files with 53 additions and 60 deletions

View file

@ -83,6 +83,10 @@ fnmatch (pattern, string, flags)
/* Note that this evalutes C many times. */ /* Note that this evalutes C many times. */
#define FOLD(c) ((flags & FNM_CASEFOLD) && isupper (c) ? tolower (c) : (c)) #define FOLD(c) ((flags & FNM_CASEFOLD) && isupper (c) ? tolower (c) : (c))
#ifdef _WIN32
flags |= FNM_CASEFOLD;
#endif
while ((c = *p++) != '\0') while ((c = *p++) != '\0')
{ {
c = FOLD (c); c = FOLD (c);

View file

@ -1954,32 +1954,33 @@ void VID_MenuDraw (void)
/* /*
================ VID_MenuKey
VID_MenuKey
================
*/
void VID_MenuKey (int key)
{
switch (key)
{
case K_ESCAPE:
S_LocalSound ("misc/menu1.wav");
M_Menu_Options_f ();
break;
default: Process menu keystrokes
break; */
void
VID_MenuKey ( int key )
{
switch (key) {
case K_ESCAPE:
S_LocalSound ("misc/menu1.wav");
M_Menu_Options_f ();
break;
default:
break;
} }
} }
void VID_ExtraOptionDraw(unsigned int options_draw_cursor) void
VID_ExtraOptionDraw ( unsigned int options_draw_cursor )
{ {
// Windowed Mouse // Windowed Mouse
M_Print (16, options_draw_cursor+=8, " Use Mouse"); M_Print (16, options_draw_cursor+=8, " Use Mouse");
M_DrawCheckbox (220, options_draw_cursor, _windowed_mouse->value); M_DrawCheckbox (220, options_draw_cursor, _windowed_mouse->value);
} }
void VID_ExtraOptionCmd(int option_cursor) void
VID_ExtraOptionCmd ( int option_cursor )
{ {
switch(option_cursor) { switch(option_cursor) {
case 1: // _windowed_mouse case 1: // _windowed_mouse
@ -1989,17 +1990,20 @@ void VID_ExtraOptionCmd(int option_cursor)
} }
} }
void VID_InitCvars() void
VID_InitCvars( void )
{ {
// It may not look it, but this is important // It may not look it, but this is important
} }
void VID_LockBuffer (void) void
VID_LockBuffer ( void )
{ {
// need empty function, because the #define method was just silly // Empty function, locking not necessary here.
} }
void VID_UnlockBuffer (void) void
VID_UnlockBuffer ( void )
{ {
// need empty function, because the #define method was just silly // Empty function, locking not necessary here.
} }

View file

@ -191,20 +191,19 @@ void COM_Path_f (void)
} }
/* /*
============ COM_Maplist_f
COM_Maplist_f
============ List map files in gamepaths.
*/ */
void
void COM_Maplist_f (void) COM_Maplist_f ( void )
{ {
searchpath_t *search; searchpath_t *search;
DIR *dir_ptr; DIR *dir_ptr;
struct dirent *dirent; struct dirent *dirent;
char buf[MAX_OSPATH]; char buf[MAX_OSPATH];
for (search = com_searchpaths ; search ; search = search->next) { for (search = com_searchpaths ; search != NULL ; search = search->next) {
if (search->pack) { if (search->pack) {
int i; int i;
pack_t *pak = search->pack; pack_t *pak = search->pack;
@ -222,8 +221,8 @@ void COM_Maplist_f (void)
if (!dir_ptr) if (!dir_ptr)
continue; continue;
while ((dirent = readdir (dir_ptr))) while ((dirent = readdir (dir_ptr)))
if (!fnmatch ("*.bsp", dirent->d_name, FNMATCH_FLAGS) if (!fnmatch ("*.bsp", dirent->d_name, 0)
|| !fnmatch ("*.bsp.gz", dirent->d_name, FNMATCH_FLAGS)) || !fnmatch ("*.bsp.gz", dirent->d_name, 0))
Con_Printf ("%s\n", dirent->d_name); Con_Printf ("%s\n", dirent->d_name);
closedir (dir_ptr); closedir (dir_ptr);
} }
@ -231,13 +230,12 @@ void COM_Maplist_f (void)
} }
/* /*
============ COM_WriteFile
COM_WriteFile
The filename will be prefixed by the current game directory The filename will be prefixed by the current game directory
============
*/ */
void COM_WriteFile (char *filename, void *data, int len) void
COM_WriteFile ( char *filename, void *data, int len )
{ {
QFile *f; QFile *f;
char name[MAX_OSPATH]; char name[MAX_OSPATH];
@ -259,20 +257,17 @@ void COM_WriteFile (char *filename, void *data, int len)
/* /*
============ COM_CreatePath
COM_CreatePath
Only used for CopyFile and download Only used for CopyFile and download
============
*/ */
void COM_CreatePath (char *path) void
COM_CreatePath ( char *path )
{ {
char *ofs; char *ofs;
for (ofs = path+1 ; *ofs ; ofs++) for (ofs = path+1 ; *ofs ; ofs++) {
{ if (*ofs == '/') { // create the directory
if (*ofs == '/')
{ // create the directory
*ofs = 0; *ofs = 0;
Sys_mkdir (path); Sys_mkdir (path);
*ofs = '/'; *ofs = '/';
@ -742,7 +737,7 @@ COM_LoadGameDirectory(char *dir)
return; return;
while ((dirent = readdir(dir_ptr))) { while ((dirent = readdir(dir_ptr))) {
if (!fnmatch("*.pak", dirent->d_name, FNMATCH_FLAGS)) { if (!fnmatch("*.pak", dirent->d_name, 0)) {
if (count >= bufsize) { if (count >= bufsize) {
bufsize += FBLOCK_SIZE; bufsize += FBLOCK_SIZE;
pakfiles = realloc(pakfiles, bufsize * sizeof(char *)); pakfiles = realloc(pakfiles, bufsize * sizeof(char *));

View file

@ -3481,18 +3481,8 @@ void VID_ExtraOptionCmd(int option_cursor)
} }
} }
void VID_InitCvars() void
VID_InitCvars( void )
{ {
// It may not look like it, but this is important // It may not look like it, but this is important
} }
void
VID_LockBuffer ( void )
{
}
void
VID_UnlockBuffer ( void )
{
}