summaryrefslogtreecommitdiff
path: root/source/files.c
diff options
context:
space:
mode:
authorAndrey Nazarov <skuller@skuller.net>2007-12-02 10:54:41 +0000
committerAndrey Nazarov <skuller@skuller.net>2007-12-02 10:54:41 +0000
commit8d8f708b11f47c2a45cc71e256797139e75fb847 (patch)
treeac2b916b2b3bf3c390295ebbc9d148ee38da01f5 /source/files.c
parente73c5000d53a37a1700862d270ea78723afec686 (diff)
Avoid black bars along sides of OpenGL window.
This also prevents GL_Screenshot_f crash due to underestimating amount of memory to be allocated for pixel data.
Diffstat (limited to 'source/files.c')
-rw-r--r--source/files.c19
1 files changed, 1 insertions, 18 deletions
diff --git a/source/files.c b/source/files.c
index 6520f2e..8be2bac 100644
--- a/source/files.c
+++ b/source/files.c
@@ -1038,7 +1038,6 @@ int FS_LoadFileEx( const char *path, void **buffer, uint32 flags ) {
path = FS_ExpandLinks( path );
if( !FS_ValidatePath( path ) ) {
- // Sys_DebugBreak();
FS_DPrintf( "FS_LoadFile: refusing invalid path: %s\n", path );
return -1;
}
@@ -1058,25 +1057,9 @@ int FS_LoadFileEx( const char *path, void **buffer, uint32 flags ) {
length = FS_GetFileLength( f );
if( buffer ) {
- if( loadInuse + length < MAX_LOAD_BUFFER && !( fs_restrict_mask->integer & 16 ) ) {
- // Com_Printf(S_COLOR_MAGENTA"static: %s: %d\n",path,length);
- buf = &loadBuffer[loadInuse];
- loadLast = buf;
- loadSaved = loadInuse;
- loadInuse += length + 1;
- loadInuse = ( loadInuse + 3 ) & ~3;
- loadStack++;
- loadCountStatic++;
- } else {
-// Com_Printf(S_COLOR_MAGENTA"alloc: %s: %d\n",path,length);
- buf = FS_Malloc( length + 1 );
- loadCount++;
- }
- *buffer = buf;
-
+ *buffer = buf = FS_AllocTempMem( length + 1 );
FS_Read( buf, length, f );
buf[length] = 0;
-
}
FS_FCloseFile( f );