Erik,

Very interesting ... I see that here, the initialization is called 5
times.  Ahhh ... look in the constructer ... each time you construct a
cloud layer, it initializes the layer states to NULL.  (This is
probably so that the check that the first layer state = NULL is
valid.)

Thanks for catching this !!!! we were wasting a *lot* of texture
memory.

I'll massage the code a bit and commit a fix.

Curt.



Erik Hofman writes:
> I have discovered that the cloud textures gets loaded 4 times to many, 
> adding about 25 Mb of unnecessary textures. But unfortunately I can't 
> find the reason for that and need some help.
> 
> What happens is that in cloud.cxx the SGCloudLayer::rebuild() loads the 
> texture if they weren't loaded already. But somehow the layer_states[] 
> gets cleared after leaving this function!
> 
> Try adding this test at the very beginning of the function to see that 
> the pointer gets lost every time the functions is called:
> 
> cout << "layer_states[SG_CLOUD_OVERCAST] = " << 
> layer_states[SG_CLOUD_OVERCAST] << endl;
> 
> But I have no idea why and where this happens.
> :-(
> 
> Does anybody have any idea?
> 
> Erik
> 
> 
> _______________________________________________
> Flightgear-devel mailing list
> [EMAIL PROTECTED]
> http://mail.flightgear.org/mailman/listinfo/flightgear-devel

-- 
Curtis Olson   IVLab / HumanFIRST Program       FlightGear Project
Twin Cities    curt 'at' me.umn.edu             curt 'at' flightgear.org
Minnesota      http://www.menet.umn.edu/~curt   http://www.flightgear.org

_______________________________________________
Flightgear-devel mailing list
[EMAIL PROTECTED]
http://mail.flightgear.org/mailman/listinfo/flightgear-devel

Reply via email to