You are not logged in.
Thanks to the excellent tutorial found here I have been working on level graphics and my first level. When editing the brick files (themes/*.brk) I was getting an access violation. It was because I misspelled the image file name.
Right now there doesn't seem to be a clean exit from the load_sprite() function (looking at revision 13, line 329 of src/sprite.c) for when a call to image_load() returns a null object. I wrote a little check which may be added after the call to image_load() which prevents the subsequent code from doing their random read stuff.
The code looks like this:
if (sheet == NULL)
{
logfile_message("load_sprite(): Failed to load the image file for the sprite.");
allegro_message("An image file error occured while loading a sprite.");
exit(2);
}
An SVN patch file written against revision 13 is located here.
Down the road I suspect there will be something better implemented, but this could be clean enough to hold over a few revisions.
Have a nice day
Last edited by Celdecea (2009-03-03 10:46:29)
Offline
Thanks for both patches.
If the user misspells an image filepath, the program must not continue. However, a fatal error message is certainly better than a crash.
Offline