parent
e7f6bbf867
commit
501ae1161d
|
@ -101,6 +101,26 @@ void compat_makepath(char* path, const char* drive, const char* dir, const char*
|
|||
#endif
|
||||
}
|
||||
|
||||
int compat_read(int fileHandle, void* buf, unsigned int size)
|
||||
{
|
||||
return read(fileHandle, buf, size);
|
||||
}
|
||||
|
||||
int compat_write(int fileHandle, const void* buf, unsigned int size)
|
||||
{
|
||||
return write(fileHandle, buf, size);
|
||||
}
|
||||
|
||||
long compat_lseek(int fileHandle, long offset, int origin)
|
||||
{
|
||||
return lseek(fileHandle, offset, origin);
|
||||
}
|
||||
|
||||
long compat_tell(int fd)
|
||||
{
|
||||
return lseek(fd, 0, SEEK_CUR);
|
||||
}
|
||||
|
||||
long compat_filelength(int fd)
|
||||
{
|
||||
long originalOffset = lseek(fd, 0, SEEK_CUR);
|
||||
|
|
|
@ -24,6 +24,10 @@ char* compat_strlwr(char* string);
|
|||
char* compat_itoa(int value, char* buffer, int radix);
|
||||
void compat_splitpath(const char* path, char* drive, char* dir, char* fname, char* ext);
|
||||
void compat_makepath(char* path, const char* drive, const char* dir, const char* fname, const char* ext);
|
||||
int compat_read(int fileHandle, void* buf, unsigned int size);
|
||||
int compat_write(int fileHandle, const void* buf, unsigned int size);
|
||||
long compat_lseek(int fileHandle, long offset, int origin);
|
||||
long compat_tell(int fileHandle);
|
||||
long compat_filelength(int fd);
|
||||
int compat_mkdir(const char* path);
|
||||
unsigned int compat_timeGetTime();
|
||||
|
|
17
src/sound.cc
17
src/sound.cc
|
@ -4,10 +4,17 @@
|
|||
#include "memory.h"
|
||||
#include "platform_compat.h"
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <io.h>
|
||||
#else
|
||||
#include <fcntl.h>
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
#include <limits.h>
|
||||
#include <math.h>
|
||||
#ifdef HAVE_DSOUND
|
||||
#include <mmsystem.h>
|
||||
#endif
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
|
@ -35,10 +42,10 @@ FreeProc* gSoundFreeProc = soundFreeProcDefaultImpl;
|
|||
SoundFileIO gSoundDefaultFileIO = {
|
||||
open,
|
||||
close,
|
||||
read,
|
||||
write,
|
||||
lseek,
|
||||
tell,
|
||||
compat_read,
|
||||
compat_write,
|
||||
compat_lseek,
|
||||
compat_tell,
|
||||
compat_filelength,
|
||||
-1,
|
||||
};
|
||||
|
@ -1718,10 +1725,12 @@ void _fadeSounds()
|
|||
}
|
||||
}
|
||||
|
||||
#ifdef HAVE_DSOUND
|
||||
if (_fadeHead == NULL && _fadeEventHandle != -1) {
|
||||
timeKillEvent(_fadeEventHandle);
|
||||
_fadeEventHandle = -1;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
// 0x4AE988
|
||||
|
|
Loading…
Reference in New Issue