On Thursday 31 May 2007 09:40:47 Steve Hosgood wrote:

> >Hi Durk ,
> >make sure the cloud cache and resolution aren't zero before enabling
> > them....
>
> Please (before 0.9.11-pre2), could someone slip in some code to the effect:
>
> if (cloud_cache == 0 || resolution == 0)
>     grey_out_menu_item(View->Render Options->Enable3DClouds);
>
> :-)
>
> This is basic, basic GUI design stuff.
> We don't want FlightGear to appear on the "interface hall of shame" page
> now, do we?

Yes, although looking at the this, I don't think the GUI is at fault.

I think, the issue is Texture Resolution, not file cache.  When you start FG, 
Texture resolution is set to 0 (even though the drop down box only allows 64|
128|256).  I cannot see where this is set to 64|128|256 anywhere.

What happens is in simgear/scene/sky/cloudfield.cxx there is a calculation 
done and as texture resolution is 0, there is a divide by 0 issue (why it 
doesn't crash I don't know.  This only happens when you first have started FG 
and never/ever set the Texture resolution up before - as then, it gets set in 
autosave.xml.

Here is a quick fix in Simgear code:

simgear/scene/sky/cloudfield.cxx (line 84):

void SGCloudField::set_CacheResolution(int resolutionPixels) {
+        if (resolutionPixels < 64)
+                resolutionPixels = 64;
        if(cacheResolution == resolutionPixels)
                return;
        cacheResolution = resolutionPixels;
        if(enable3D) {
                int count = last_cache_size * 1024 / (cacheResolution * 
cacheResolution * 4);
                if(count == 0)
                        count = 1;
                SGNewCloud::cldCache->setCacheSize(count, cacheResolution);
        }
}


Nick

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel

Reply via email to