I have a major refactoring job to do, and I think I might know how to do it, but I thought it would be a good idea to get different opinions and suggestions.
I’m using REALStudio2011r3 but that doesn’t matter, and I’m writing xplat. I develop on the Mac and compile both Win and Mac on Mac.
It’s easy but vast. Basically I am taking a large project and changing how I deal with graphical resources. From Day One I dropped in my graphics into the IDE, and making it more complicated I split them into TWO: the graphic and the mask, the pair being XXX.png and the mask always being XXX_mask.png. I only use PNG. Then I take the XXX object and set the Transparent property to White (1), and the Mask property to the XXX_mask file.
I did all this for older version reasons, when Alpha channels of PNG’s wasn’t supported, et. al.
Now, my programs take too long to start up, probably because they are loading up all these graphics and setting them up. Not only that, it’s very ineffecient because most of the graphics are not seen immediately. Most of the are menu-item things and icons for hundreds of different objects.
I’d like to switch to deleting all these graphical objects and changing to a “load-as-needed” basis, where the graphics are files outside the app and loaded and persistant when necessary.
Another benefit of this would be that REAL Win dithers larger graphics pretty badly. For example, all my graphics are done 128x128, and frequently they are dithered to 16x16 in my app. OSX is very nice with it but Win is uglier than crap. Using the off-world system, I can make different versions much easier without loading down the app with too many objects on-world.
I’ve heard plenty of people have already abandoned putting graphics as objects in the IDE. How do you do it? Could I ask, how would you approach this refactoring? What functions would you write and how would you implement this? (I’m not asking anyone to code it but I’m asking for a basic idea-map, but with more specifics.)
Thanks!