Win32 compiles now (opendir yet to be done...)

This commit is contained in:
Anton E. Gavrilov 2000-03-11 00:46:46 +00:00
parent 54b7b1e6af
commit 1b35b7ab83

View file

@ -36,8 +36,12 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include <zone.h>
#include <common.h>
#include <draw.h>
#ifndef _WIN32 // Tonik
#include <dirent.h>
#include <fnmatch.h>
#endif
#ifdef WIN32
#include <io.h>
#endif
@ -666,6 +670,60 @@ pack_t *COM_LoadPackZipFile (char *packfile)
}
#endif
#ifdef _WIN32
// Yes i know, but at least the project does compile for Win32!
// Let's wait until someone implements Sys_FindFirst(),
// Sys_FindNext(), Sys_FindClose() for every platform.
//
// I wonder why didn't Mercury like the pak*.pak system?
//
// Or maybe taniwha will kindly mail me dirent.h and maybe
// i will port opendir etc to Win32?
// -- Tonik
void
COM_LoadGameDirectory(char *dir)
{
int i;
searchpath_t *search;
pack_t *pak;
char pakfile[MAX_OSPATH];
qboolean done = false;
for ( i=0 ; !done ; i++ ) { // Load all Pak1 files
snprintf(pakfile, sizeof(pakfile), "%s/pak%i.pak", dir, i);
pak = COM_LoadPackFile(pakfile);
if( !pak ) {
done = true;
} else {
search = Z_Malloc (sizeof(searchpath_t));
search->pack = pak;
search->next = com_searchpaths;
com_searchpaths = search;
}
}
#ifdef GENERATIONS
for (done=false, i=0 ; !done ; i++ ) { // Load all Pak3 files.
snprintf(pakfile, sizeof(pakfile), "%s/pak%i.qz", dir, i);
pak = COM_LoadPackZipFile(pakfile);
if(!pak) {
done = true;
} else {
search = Hunk_Alloc (sizeof(searchpath_t));
search->pack = pak;
search->next = com_searchpaths;
com_searchpaths = search;
}
}
#endif
}
#else // !_WIN32
void
COM_LoadGameDirectory(char *dir)
{
@ -714,6 +772,7 @@ COM_LoadGameDirectory(char *dir)
}
#endif
}
#endif // !_WIN32
/*