mirror of
https://github.com/ZDoom/raze-gles.git
synced 2025-01-11 18:50:46 +00:00
git-svn-id: https://svn.eduke32.com/eduke32@1479 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
b04b42be23
commit
e5d6d9694f
3 changed files with 12 additions and 34 deletions
|
@ -20,7 +20,7 @@
|
||||||
static intptr_t kzipopen(char *filnam)
|
static intptr_t kzipopen(char *filnam)
|
||||||
{
|
{
|
||||||
uint32_t i;
|
uint32_t i;
|
||||||
char newst[BMAX_PATH];
|
char newst[BMAX_PATH+8];
|
||||||
|
|
||||||
newst[0] = '|';
|
newst[0] = '|';
|
||||||
for (i=0; filnam[i] && (i < sizeof(newst)-2); i++) newst[i+1] = filnam[i];
|
for (i=0; filnam[i] && (i < sizeof(newst)-2); i++) newst[i+1] = filnam[i];
|
||||||
|
@ -979,7 +979,7 @@ CACHE1D_FIND_REC *klistpath(const char *_path, const char *mask, int32_t type)
|
||||||
|
|
||||||
if (!pathsearchmode) // next, zip files
|
if (!pathsearchmode) // next, zip files
|
||||||
{
|
{
|
||||||
char buf[BMAX_PATH];
|
char buf[BMAX_PATH+4];
|
||||||
int32_t i, j, ftype;
|
int32_t i, j, ftype;
|
||||||
strcpy(buf,path);
|
strcpy(buf,path);
|
||||||
if (*path) strcat(buf,"/");
|
if (*path) strcat(buf,"/");
|
||||||
|
|
|
@ -54,7 +54,7 @@ static uint32_t LSWAPIL(uint32_t a) { return(((a>>8)&0xff00)+((a&0xff00)<<8)+(a<
|
||||||
static uint16_t SSWAPIL(uint16_t a) { return((a>>8)+(a<<8)); }
|
static uint16_t SSWAPIL(uint16_t a) { return((a>>8)+(a<<8)); }
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !defined(_WIN32) && !defined(__DOS__)
|
#if !defined(_WIN32)
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <dirent.h>
|
#include <dirent.h>
|
||||||
typedef long long __int64;
|
typedef long long __int64;
|
||||||
|
@ -71,9 +71,7 @@ static __inline int32_t filelength(int h)
|
||||||
#include <io.h>
|
#include <io.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(__DOS__)
|
#if defined(_WIN32)
|
||||||
#include <dos.h>
|
|
||||||
#elif defined(_WIN32)
|
|
||||||
#define WIN32_LEAN_AND_MEAN
|
#define WIN32_LEAN_AND_MEAN
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#endif
|
#endif
|
||||||
|
@ -2836,7 +2834,7 @@ intptr_t kzopen(const char *filnam)
|
||||||
j = strlen(tempbuf);
|
j = strlen(tempbuf);
|
||||||
if (strlen(filnam)+1+j >= sizeof(tempbuf)) continue; //don't allow int32_t filenames to buffer overrun
|
if (strlen(filnam)+1+j >= sizeof(tempbuf)) continue; //don't allow int32_t filenames to buffer overrun
|
||||||
if ((j) && (tempbuf[j-1] != '/') && (tempbuf[j-1] != '\\') && (filnam[0] != '/') && (filnam[0] != '\\'))
|
if ((j) && (tempbuf[j-1] != '/') && (tempbuf[j-1] != '\\') && (filnam[0] != '/') && (filnam[0] != '\\'))
|
||||||
#if (defined(__DOS__) || defined(_WIN32))
|
#if defined(_WIN32)
|
||||||
strcat(tempbuf,"\\");
|
strcat(tempbuf,"\\");
|
||||||
#else
|
#else
|
||||||
strcat(tempbuf,"/");
|
strcat(tempbuf,"/");
|
||||||
|
@ -2859,10 +2857,7 @@ intptr_t kzopen(const char *filnam)
|
||||||
|
|
||||||
// --------------------------------------------------------------------------
|
// --------------------------------------------------------------------------
|
||||||
|
|
||||||
#if defined(__DOS__)
|
#if defined(_WIN32)
|
||||||
#define MAX_PATH 260
|
|
||||||
static struct find_t findata;
|
|
||||||
#elif defined(_WIN32)
|
|
||||||
static HANDLE hfind = INVALID_HANDLE_VALUE;
|
static HANDLE hfind = INVALID_HANDLE_VALUE;
|
||||||
static WIN32_FIND_DATA findata;
|
static WIN32_FIND_DATA findata;
|
||||||
#else
|
#else
|
||||||
|
@ -2883,8 +2878,7 @@ static char wildst[MAX_PATH] = "", newildst[MAX_PATH] = "";
|
||||||
|
|
||||||
void kzfindfilestart(const char *st)
|
void kzfindfilestart(const char *st)
|
||||||
{
|
{
|
||||||
#if defined(__DOS__)
|
#if defined(_WIN32)
|
||||||
#elif defined(_WIN32)
|
|
||||||
if (hfind != INVALID_HANDLE_VALUE)
|
if (hfind != INVALID_HANDLE_VALUE)
|
||||||
{ FindClose(hfind); hfind = INVALID_HANDLE_VALUE; }
|
{ FindClose(hfind); hfind = INVALID_HANDLE_VALUE; }
|
||||||
#else
|
#else
|
||||||
|
@ -2915,15 +2909,7 @@ kzfindfile_beg:;
|
||||||
|
|
||||||
Bmemcpy(filnam,newildst,wildstpathleng);
|
Bmemcpy(filnam,newildst,wildstpathleng);
|
||||||
|
|
||||||
#if defined(__DOS__)
|
#if defined(_WIN32)
|
||||||
if (_dos_findfirst(newildst,_A_SUBDIR,&findata))
|
|
||||||
{ if (!kzhashbuf) return(0); srchstat = 2; continue; }
|
|
||||||
i = wildstpathleng;
|
|
||||||
if (findata.attrib&16)
|
|
||||||
if ((findata.name[0] == '.') && (!findata.name[1])) continue;
|
|
||||||
strcpy(&filnam[i],findata.name);
|
|
||||||
if (findata.attrib&16) strcat(&filnam[i],"\\");
|
|
||||||
#elif defined(_WIN32)
|
|
||||||
hfind = FindFirstFile(newildst,&findata);
|
hfind = FindFirstFile(newildst,&findata);
|
||||||
if (hfind == INVALID_HANDLE_VALUE)
|
if (hfind == INVALID_HANDLE_VALUE)
|
||||||
{ if (!kzhashbuf) return(0); srchstat = 2; continue; }
|
{ if (!kzhashbuf) return(0); srchstat = 2; continue; }
|
||||||
|
@ -2956,17 +2942,9 @@ kzfindfile_beg:;
|
||||||
while (1)
|
while (1)
|
||||||
{
|
{
|
||||||
Bmemcpy(filnam,newildst,wildstpathleng);
|
Bmemcpy(filnam,newildst,wildstpathleng);
|
||||||
#if defined(__DOS__)
|
#if defined(_WIN32)
|
||||||
if (_dos_findnext(&findata))
|
|
||||||
{ if (!kzhashbuf) return(0); srchstat = 2; break; }
|
|
||||||
i = wildstpathleng;
|
|
||||||
if (findata.attrib&16)
|
|
||||||
if ((findata.name[0] == '.') && (!findata.name[1])) continue;
|
|
||||||
strcpy(&filnam[i],findata.name);
|
|
||||||
if (findata.attrib&16) strcat(&filnam[i],"\\");
|
|
||||||
#elif defined(_WIN32)
|
|
||||||
if (!FindNextFile(hfind,&findata))
|
if (!FindNextFile(hfind,&findata))
|
||||||
{ FindClose(hfind); if (!kzhashbuf) return(0); srchstat = 2; break; }
|
{ FindClose(hfind); hfind = INVALID_HANDLE_VALUE; if (!kzhashbuf) return(0); srchstat = 2; break; }
|
||||||
if (findata.dwFileAttributes&FILE_ATTRIBUTE_HIDDEN) continue;
|
if (findata.dwFileAttributes&FILE_ATTRIBUTE_HIDDEN) continue;
|
||||||
i = wildstpathleng;
|
i = wildstpathleng;
|
||||||
if (findata.dwFileAttributes&FILE_ATTRIBUTE_DIRECTORY)
|
if (findata.dwFileAttributes&FILE_ATTRIBUTE_DIRECTORY)
|
||||||
|
@ -3007,7 +2985,7 @@ kzfindfile_beg:;
|
||||||
strcpy(newildst,&kzhashbuf[srchdoff+4]);
|
strcpy(newildst,&kzhashbuf[srchdoff+4]);
|
||||||
i = strlen(newildst);
|
i = strlen(newildst);
|
||||||
if ((i) && (newildst[i-1] != '/') && (newildst[i-1] != '\\') && (filnam[0] != '/') && (filnam[0] != '\\'))
|
if ((i) && (newildst[i-1] != '/') && (newildst[i-1] != '\\') && (filnam[0] != '/') && (filnam[0] != '\\'))
|
||||||
#if (defined(__DOS__) || defined(_WIN32))
|
#if defined(_WIN32)
|
||||||
strcat(newildst,"\\");
|
strcat(newildst,"\\");
|
||||||
#else
|
#else
|
||||||
strcat(newildst,"/");
|
strcat(newildst,"/");
|
||||||
|
|
|
@ -46,5 +46,5 @@ $(JFAUDIOLIB): $(OBJECTS)
|
||||||
lib $(flags_lib) /out:$@ /nologo $**
|
lib $(flags_lib) /out:$@ /nologo $**
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
-del /Q $(OBJECTS) $(JFAUDIOLIB)
|
-del /Q $(OBJ)\* $(JFAUDIOLIB)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue