From 8d8f708b11f47c2a45cc71e256797139e75fb847 Mon Sep 17 00:00:00 2001 From: Andrey Nazarov Date: Sun, 2 Dec 2007 10:54:41 +0000 Subject: 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. --- source/files.c | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) (limited to 'source/files.c') 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 ); -- cgit v1.2.3