mirror of
https://github.com/UberGames/lilium-voyager.git
synced 2024-11-10 06:31:47 +00:00
Remove FS_Read2().
Functionally the same as FS_Read().
Streaming functionality was removed in 672cfbf16f
but flag remained.
This commit is contained in:
parent
b173ac0599
commit
d4e1a01f33
7 changed files with 5 additions and 39 deletions
|
@ -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] );
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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] );
|
||||
|
|
Loading…
Reference in a new issue