From 66fbfc1c1c8ea80a65fb06247674a8f622eee380 Mon Sep 17 00:00:00 2001 From: Jens Ayton Date: Thu, 22 Apr 2010 13:54:23 +0000 Subject: [PATCH] ...and logging of texture size limits. git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@3192 127b21dd-08f5-0310-b4b7-95ae10353056 --- Resources/Config/logcontrol.plist | 1 + src/Core/Materials/OOTextureLoader.m | 3 +++ 2 files changed, 4 insertions(+) diff --git a/Resources/Config/logcontrol.plist b/Resources/Config/logcontrol.plist index a75a990e..3d5a4af4 100644 --- a/Resources/Config/logcontrol.plist +++ b/Resources/Config/logcontrol.plist @@ -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; diff --git a/src/Core/Materials/OOTextureLoader.m b/src/Core/Materials/OOTextureLoader.m index eccaf642..0e6d3a55 100644 --- a/src/Core/Materials/OOTextureLoader.m +++ b/src/Core/Materials/OOTextureLoader.m @@ -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; }