Welcome!

Hey, I'm Skylar, a kid aspiring to become a competent programmer. This blog is here to detail my dabbles in development.

My dream is to one day become a professional programmer and do some game development in my spare time.

Thanks for visiting my blog, and I hope you'll come back!

Pages

Resource System Mostly Done =D




So really, the Resource System is just a front to access the ImageBank and SoundBank. I've finished the ImageBank, and have it exactly how I want it =D.

So basically, when you want a surface you do this:

FF::Surface* pSurf = FF_ResourceSystem->GetImageBank().GetSurface("Ship");

So then I have it loop through each file extension I support, in a certain order. If the load fails, then it moves on to the next one.

If it happens to get through all the extensions, and doesn't load any of them, then instead of returning you the image you probably expected, it will give you a bitmap that says the word "Error".

So this ImageBank guaruntees that only one of each image is loaded, and that it's all cleaned up =D.

Oh, it also has a cap of 100 images as of now. But that can be easily adjusted =D.


The SoundBank isn't finished yet. Really the code will be the same, I just need to look at the Mixer Documentation and find out what formats I need to support.

The only other thing I really think I may need, is something to manage Music. I'm not sure if it needs it's own bank, because there can only be one piece of music playing at a time. But then again, when music changes, I don't really want lag from loading the new piece.

But that's yet to be decided. At the moment, I'm thinking I'll make a bank for it, but with a much lower cap, like 25 or something.

But all I have to say is, it may have taken a while to get this resource management stuff figured out, but it is WELL worth it =D.

So now to explain the picture really quickly. Well I added another player character, but purposely passed in an image that didn't exist. So it returned the Error surface. It may be hard to see, but the Error is right next to the red star.

Well, I believe I'm going to make a video, hopefully it isn't super laggy like the last one I made =D

0 Response to "Resource System Mostly Done =D"

Post a Comment