Game Development Community

where in code is sprite loaded?

by PeterB · in Torque Game Builder · 04/12/2009 (1:23 pm) · 0 replies

I want to both take advantage of TGB's level editor and only load textures into memory soon before they're needed.

Looking at levelmanagement.cs, I see where levels are loaded, but I'm missing something.
I'm trying to track down where the individual sprites are actually loaded and given their properites - position, size, and in particular their imagemap.
------

My plan: I want to load my level, but set every sprite to the same dummy imagemap (before it loads the imagemap specified by the level file), and store the proper imagemap in a variable.

Then, when the camera comes near a given sprite, it switches (setImageMap) to its correct imagemap. In doing so, that imagemap's texture will be loaded into memory. This definitely depends on my setting all imagemaps' (in datablocks.cs) preload field to false.

So exactly where is the imagemap applied to the sprite?