...and logging of texture size limits.

git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@3192 127b21dd-08f5-0310-b4b7-95ae10353056
This commit is contained in:
Jens Ayton 2010-04-22 13:54:23 +00:00
parent 889c86aa47
commit 66fbfc1c1c
2 changed files with 4 additions and 0 deletions

View File

@ -391,6 +391,7 @@
texture.load.noName = $error;
texture.load.queueTask.inconsistency = $error;
texture.load.rescale = $textureDebug;
texture.load.rescale.maxSize = inherit;
texture.load.unknownType = $error;

View File

@ -249,12 +249,15 @@ static BOOL sHaveSetUp = NO;
GLint maxSize;
glGetIntegerv(GL_MAX_TEXTURE_SIZE, &maxSize);
sGLMaxSize = MAX(maxSize, 64);
OOLog(@"texture.load.rescale.maxSize", @"GL maximum texture size: %u", sGLMaxSize);
// Why 0x80000000? Because it's the biggest number OORoundUpToPowerOf2() can handle.
sUserMaxSize = [[NSUserDefaults standardUserDefaults] oo_unsignedIntForKey:@"max-texture-size" defaultValue:0x80000000];
if (sUserMaxSize < 0x80000000) OOLog(@"texture.load.rescale.maxSize", @"User maximum texture size: %u", sUserMaxSize);
sUserMaxSize = OORoundUpToPowerOf2(sUserMaxSize);
sUserMaxSize = MAX(sUserMaxSize, 64U);
sHaveSetUp = YES;
}