Try and avoid problem reported by users like RDChrisco with cards that only support 512 texture size, and disable backgrounds. Also, reorganise the rq flags sprite loading a bit. Needs testing to make sure it matches the sprite uses. It should though.
authornemo
Mon, 23 May 2011 11:25:37 -0400 (2011-05-23)
changeset 5215 d4c529624460
parent 5214 d2ad737891b0
child 5216 e69bf244a127
Try and avoid problem reported by users like RDChrisco with cards that only support 512 texture size, and disable backgrounds. Also, reorganise the rq flags sprite loading a bit. Needs testing to make sure it matches the sprite uses. It should though.
hedgewars/uStore.pas
--- a/hedgewars/uStore.pas	Sun May 22 19:44:53 2011 +0400
+++ b/hedgewars/uStore.pas	Mon May 23 11:25:37 2011 -0400
@@ -273,10 +273,11 @@
 AddProgress;
 for ii:= Low(TSprite) to High(TSprite) do
     with SpritesData[ii] do
-        // FIXME - add a sprite attribute
-        if ((cReducedQuality and rqNoBackground) = 0) or // FIXME: should check for both rqNoBackground and rqKillFlakes
-            (not (ii in [sprSky, sprSkyL, sprSkyR, sprHorizont, sprHorizontL, sprHorizontR, sprFlake, sprSplash, sprDroplet, sprSDSplash, sprSDDroplet]) or
-            (((Theme = 'Snow') or (Theme = 'Christmas')) and ((ii = sprFlake) or (ii = sprSDFlake)))) then // FIXME: hack; also should checked against rqLowRes
+        // FIXME - add a sprite attribute to match on rq flags?
+        if (((cReducedQuality and (rqNoBackground or rqLowRes)) = 0) or   // why rqLowRes?
+                (not (ii in [sprSky, sprSkyL, sprSkyR, sprHorizont, sprHorizontL, sprHorizontR]))) and
+           (((cReducedQuality and rqPlainSplash) = 0) or ((not (ii in [sprSplash, sprDroplet, sprSDSplash, sprSDDroplet])))) and
+           (((cReducedQuality and rqKillFlakes) = 0) or (Theme = 'Snow') or (Theme = 'Christmas') or ((not (ii in [sprFlake, sprSDFlake])))) then
         begin
             if AltPath = ptNone then
                 if ii in [sprHorizontL, sprHorizontR, sprSkyL, sprSkyR] then // FIXME: hack
@@ -547,10 +548,15 @@
     AddFileLog('  \----- GL_MAX_TEXTURE_SIZE: ' + inttostr(MaxTextureSize));
 
     if MaxTextureSize <= 0 then
-    begin
+        begin
         MaxTextureSize:= 1024;
         AddFileLog('OpenGL Warning - driver didn''t provide any valid max texture size; assuming 1024');
-    end;
+        end
+    else if (MaxTextureSize < 1024) and (MaxTextureSize >= 512) then
+        begin
+        cReducedQuality := cReducedQuality or rqNoBackground;  
+        AddFileLog('Texture size too small for backgrounds, disabling.');
+        end;
 
 {$IFDEF IPHONEOS}
     cGPUVendor:= gvApple;