diff --git a/code/client/cl_cgame.c b/code/client/cl_cgame.c index d69ae752..157c7bd9 100644 --- a/code/client/cl_cgame.c +++ b/code/client/cl_cgame.c @@ -440,7 +440,7 @@ intptr_t CL_CgameSystemCalls( intptr_t *args ) { case CG_FS_FOPENFILE: return FS_FOpenFileByMode( VMA(1), VMA(2), args[3] ); case CG_FS_READ: - FS_Read2( VMA(1), args[2], args[3] ); + FS_Read( VMA(1), args[2], args[3] ); return 0; case CG_FS_WRITE: FS_Write( VMA(1), args[2], args[3] ); diff --git a/code/client/cl_ui.c b/code/client/cl_ui.c index 67ec918d..f3fca928 100644 --- a/code/client/cl_ui.c +++ b/code/client/cl_ui.c @@ -780,7 +780,7 @@ intptr_t CL_UISystemCalls( intptr_t *args ) { return FS_FOpenFileByMode( VMA(1), VMA(2), args[3] ); case UI_FS_READ: - FS_Read2( VMA(1), args[2], args[3] ); + FS_Read( VMA(1), args[2], args[3] ); return 0; case UI_FS_WRITE: diff --git a/code/qcommon/files.c b/code/qcommon/files.c index 27f5713d..e4d22d37 100644 --- a/code/qcommon/files.c +++ b/code/qcommon/files.c @@ -280,7 +280,6 @@ typedef struct { int zipFilePos; int zipFileLen; qboolean zipFile; - qboolean streamed; char name[MAX_ZPATH]; } fileHandleData_t; @@ -1510,25 +1509,6 @@ FS_Read Properly handles partial reads ================= */ -int FS_Read2( void *buffer, int len, fileHandle_t f ) { - if ( !fs_searchpaths ) { - Com_Error( ERR_FATAL, "Filesystem call made without initialization" ); - } - - if ( !f ) { - return 0; - } - if (fsh[f].streamed) { - int r; - fsh[f].streamed = qfalse; - r = FS_Read( buffer, len, f ); - fsh[f].streamed = qtrue; - return r; - } else { - return FS_Read( buffer, len, f); - } -} - int FS_Read( void *buffer, int len, fileHandle_t f ) { int block, remaining; int read; @@ -1655,14 +1635,6 @@ int FS_Seek( fileHandle_t f, long offset, int origin ) { return -1; } - if (fsh[f].streamed) { - int r; - fsh[f].streamed = qfalse; - r = FS_Seek( f, offset, origin ); - fsh[f].streamed = qtrue; - return r; - } - if (fsh[f].zipFile == qtrue) { //FIXME: this is really, really crappy //(but better than what was here before) @@ -4119,11 +4091,6 @@ int FS_FOpenFileByMode( const char *qpath, fileHandle_t *f, fsMode_t mode ) { if ( *f ) { fsh[*f].fileSize = r; - fsh[*f].streamed = qfalse; - - if (mode == FS_READ) { - fsh[*f].streamed = qtrue; - } } fsh[*f].handleSync = sync; diff --git a/code/qcommon/md5.c b/code/qcommon/md5.c index d47560e4..cee93a32 100644 --- a/code/qcommon/md5.c +++ b/code/qcommon/md5.c @@ -290,7 +290,7 @@ char *Com_MD5File( const char *fn, int length, const char *prefix, int prefix_le MD5Update(&md5 , (unsigned char *)prefix, prefix_len); for(;;) { - r = FS_Read2(buffer, sizeof(buffer), f); + r = FS_Read(buffer, sizeof(buffer), f); if(r < 1) break; if(r + total > length) diff --git a/code/qcommon/qcommon.h b/code/qcommon/qcommon.h index f8cd035c..feeca186 100644 --- a/code/qcommon/qcommon.h +++ b/code/qcommon/qcommon.h @@ -659,7 +659,6 @@ int FS_FileIsInPAK(const char *filename, int *pChecksum ); int FS_Write( const void *buffer, int len, fileHandle_t f ); -int FS_Read2( void *buffer, int len, fileHandle_t f ); int FS_Read( void *buffer, int len, fileHandle_t f ); // properly handles partial reads and reads from other dlls diff --git a/code/server/sv_bot.c b/code/server/sv_bot.c index d92dfcaf..58503542 100644 --- a/code/server/sv_bot.c +++ b/code/server/sv_bot.c @@ -543,7 +543,7 @@ void SV_BotInitBotLib(void) { // file system access botlib_import.FS_FOpenFile = FS_FOpenFileByMode; - botlib_import.FS_Read = FS_Read2; + botlib_import.FS_Read = FS_Read; botlib_import.FS_Write = FS_Write; botlib_import.FS_FCloseFile = FS_FCloseFile; botlib_import.FS_Seek = FS_Seek; diff --git a/code/server/sv_game.c b/code/server/sv_game.c index ebfa726c..81f47933 100644 --- a/code/server/sv_game.c +++ b/code/server/sv_game.c @@ -325,7 +325,7 @@ intptr_t SV_GameSystemCalls( intptr_t *args ) { case G_FS_FOPEN_FILE: return FS_FOpenFileByMode( VMA(1), VMA(2), args[3] ); case G_FS_READ: - FS_Read2( VMA(1), args[2], args[3] ); + FS_Read( VMA(1), args[2], args[3] ); return 0; case G_FS_WRITE: FS_Write( VMA(1), args[2], args[3] );