A little V2.7 question.
Displaying 1-4 of 4 total.
1
Please enter a numerical value for the importance of this sticky.
Enter 0 to unsticky.
FlameRainCaptain

I am currently working on a 3D system using MANY .PNG images as "textures" for walls, floors, characters and ceilings.

It is not true 3D, but it will make use of the VERGE layers and try to draw it all in 3D.

I have just started, but I was wondering, just to be on the safe side, would it be safe to load ALL the "texture" images at the same time? (I'm using V27. All the images are compressed.)

If you have any other tips that I may use, say so.

And thanks for help if you give any.
Thanks for comments too! :)



Posted on 2001-06-14 16:49:07

Kazier989

it all depends on the memory available on a system. If each image is 50k but you have like 200 images then you have a lot of information to load into the memory. Also remember that when you load them they are decompressed (I think) so in reality you would be using W-A-Y too much memory. I say use dynamic caching and stuff (beyond the scope of this short blurb) to load all the tiles you have a chance of seeing in a short period of time.



Check out my homepage.

Posted on 2001-06-14 17:30:50

andy

I don't think it would cause too many problems.

What I would do, though, to keep the RAM footprint smaller, is reference count all the resources.

Keep all the images under the control of a central image controller which keeps track of which images are being used, and which can be destroyed.

Basically, you would 'ask' the controller for an image. The controller would first check to see if it's already loaded. If not, it loads it, and sets its reference counter to one. If it is already, it simply increments the reference counter.

Similarly, when you free it, you also go through the controller. The controller would simply decrement the reference counter, and delete the resource if the counter reached zero.
Hope that made sense. ;)



'Never confuse a single defeat with a final defeat.' -F. Scott Fitzgerald

Posted on 2001-06-17 20:05:09

JL

I believe that you can implement a pretty simple reference-counting resource manager using Python 2.0's new weak-reference system. I haven't played around with it much myself, but you can read more about it under the documentation for the "weakref" library.



Posted on 2001-06-19 14:39:57


Displaying 1-4 of 4 total.
1
 
Newest messages

Ben McGraw's lovingly crafted this website from scratch for years.
It's a lot prettier this go around because of Jon Wofford.
Verge-rpg.com is a member of the lunarnet irc network, and would like to take this opportunity to remind you that regardless how babies taste, it is wrong to eat them.