Dr. Trowel, on Jun 6 2005, 02:25 PM, said:
Yup, there's rEV's Confed Cruiser spinning smoothly in a window on my screen, with its engine glow spinning in a second window and the Escort Carrier in a third. Very nice, ZP and Bryce! Thank you!
View Post
Hey, what do you think I'm testing this app with? rEV's bigass sprites have been the basis to test my memory and CPU usage in the worst conditions possible (I don't think anyone is reasonably going to do much more than that ). In fact, with the previous versions, when I loaded all the sprites from ~Cruisers Large it was taking up more than the physical memory of my computer, which meant it was constantly in need to reload each precalculated shape from disk where it had been paged out of physical memory, as it was the least recently used... Thus, it was going at the speed of the hard drive (i.e. SLOW). Having a 800MHz iBook G3 with Jaguar sure helps supporting lower-end configs...
Didn't get time to tell what was new with this version:
- Sprites are now decoded in real-time instead of being predecoded at loading (which took some time during which no interaction was possible, and which took abusive amounts of memory). This means that CPU usage is likely more than before, but the more frugal memory usage should more than compensate for that!
- Ability to close the file currently open, open another, etc... with still only one file open at the same time. To support that, various enhancements of the controls of the main window have been done (disabling rlë-related controls when no file is opened, disabling the rlë8 popup menu when there are only rlëDs (and conversely), etc...)
- Now the app prevents you from opening a rlë that's already open, by selecting the window displaying it if you ask to load it.
I ask for your attention on the last feature: if, by any way whatsoever, you sucessfully invoke two windows containing the same rlë, then it's a bug, and I want to hear about it (note: invoking a rlëD and the corresponding rlë8 doesn't count, it's normal operation), whith instructions on how to trigger that and preferably a screenshot. This is because, when the first window would be dismissed, it would release the underlying resource in memory and the second window would cause the app to crash as it counts on the same underlying resource as the source of the data to decode when attempting to compute the next frame. Especially, the app knows a resource has already a window displaying it only by the mean of the diamond mark of the corresponding menu item! Should it be corrupted (by, say, the popup menu control which might try and add a checkmark to the currently selected menu item and remove the diamond one), then this check would no longer exist and the app wouldn't be reliable.
By the way, here are the sources, all in a zip archive - this is really to much text for IPB to cope with in a post, even in a codebox. Notice I put the actual decoding logic in a separate "decode.c" file, that has quite optimised, error-checking-less, rle parsing code. In fact, I'm now studying the assembly code that gcc generates from it to know if I can enhance it even more. The old parsing code is kept (but commented out) to be later used as a mean to debug an rle before displaying it: it will parse the rlë data, without generating an image from it, to check it when loading the resource to know if it is valid - if not, it will generate a detailed warning, which could be useful when writing rlë's by hand or an rlë encoder.
(attachment=727:attachment)
Since so many people are asking for overlaying, this is what I'll do next (instead of opening more than one file at the same time since I still don't know which UI design would be best for that). I have some things to ask first:
- Are you 100% sure that all rlë's have an even height and width? Since I need to align them with their center, this is pretty necessary, as for an odd size the center is exactly on a center pixel while for an even size the center is in the corner between 4 pixels.
- What would the best UI design for doing that be? Drag and drop (warning: not sure I can do that...), new button "overlay on existing window" (which would after clicking it let you click on the window on which to overlay the rlë currently selected in the popup menu), other? And should I allow removing one overlayed rlë from a window, instead of having to dismiss the window and start over?
- More accurately, how do the various components (light, alt frames, weapon glow, shield, engine glow) add to the base image? It seems to me light, for instance, has its color components added to the base image (otherwise, we would have some ghosting black surrounding the lights), while others may be simply applied on top, replacing the contents below.
EDIT: oh, yeah, forgot about the about box. I will put a serious one.
This post has been edited by Zacha Pedro : 06 June 2005 - 10:17 AM