Mappy packages the data you've loaded about each tile, the tile's placement on the map, and the single .png file holding all of the map data into it's own format. It's not terribly huge, I don't think, but it isn't compressed. And it's like a 0.5 second delay when my player reaches a door before the next room pops into existence.
What may ultimately be cool is having some kind of screen transition effect that masks the load time, but as you say, I suspect that involves learning multithreading. I'll get to that... but not any time soon.
@Gleeok: So, if I follow the logic of that code you posted,it -- whatever "it" is -- holds an index of filenames. Then, when I want to to draw a sprite to the screen, I call it by the filename. "It" then looks to see if that name is already loaded, and if it is, just returns it. If not, it loads it and stores it forever and then returns it. So, the first time you encounter, say, a kind of enemy, it will load from the HD, but thereafter it'll be already existing in RAM and ready to go. Since I doubt I'll have more than a few hundred sprites loading even throughout the whole game, that should be managable.
Now, as to the "it." My rudimentary understanding of C++ is that you can have your main.cpp and you can put global functions and variables there after your void main() function. But, I thought everything was really supposed to be a class. What is your code snippet? Is it a class, a global function, or...?
Is this similar to what allegro and mappy provide? That is, I have functions in both of those libraries I can call wherever, without regard to what the object knows.
Edited by C-Dawg, 13 October 2015 - 10:15 AM.