Tuesday, September 21, 2010

Image Loading Bug Fixed!

Since the beginning of the project, a minor bug has been nagging at me:  Images that come built in to the MHFramework engine (in this case, the splash screen) have not been loading when running the game as an executable JAR file.  I have discovered the source of the problem.  For future reference, here's the fix:
 
I was loading images like this, using a relative path from the image loading code to the location of the image files:
MHResourceManager.loadImage("../images/imageFile.jpg");

This approach works great as long as you aren't running from a JAR file.  However, if the images are contained in a JAR file, you must use the entire path name beginning with a slash, like this:
MHResourceManager.loadImage("/mhframework/images/imageFile.jpg");

Now, no matter how we run the program, we have the comforting familiarity of the good old MHFramework splash screen.

This issue is now resolved and will be removed from the issue tracking spreadsheet.  Consequently, this also means a new version number for the engine, but I will address that later after I officially check in some other recent upgrades.

Monday, September 20, 2010

MHFramework Deserves a Blog

It occurs to me that, aside from the MHFramework page on my website and the API documentation generated from the source code, I haven't really bothered to organize and communicate the work that goes into my beloved pet game engine.  I've been working on it since the turn of the century and documenting it in a piecemeal fashion as I go -- notes and diagrams sketched onto scratch paper, text files here and there, the occasional white board photograph...you know, the kinds of "documentation" typical of us programmers.

I feel that such practices, while certainly useful, are inadequate to capture the detail and complexity of the intricate structures that constitute a game engine.  That is why I'm dedicating a blog to this subject alone.  It's all part of my ongoing effort to improve my software engineering processes and the products that result from them.

After all, isn't that what engineering is all about?