[DYNRPG] BUG: MISSING/WRONG IMAGE
Posts
Pages:
1
Here's a really weird bug I've encountered, which unfortunately I think may be a bug in DynRPG itself. I've been trying to incorporate my DynWardrobe plugin into my game project, and I got an error message saying "Access violation in module 'DynWardrobe.dll' in with address 680478B4 and offset 00000000 of type Read occured." I used message popups to trace where the error was happening, and found that it happened on an RPG::Image::draw function call when the Image pointer passed into the function as a source for drawing came from loading a file called Shield.png.
After spending quite a while examining the code for potential problems and getting info on everything I could think of using message popups, I finally tried using a different image file, just as an experiment. That worked just fine, so I tried saving a copy of the working image file as Shield.png and using that. That caused the error again. So I decided maybe the name of the file had something to do with it, and I tried renaming my backup of the original Shield.png to Shields.png and using that. Here's where it gets really weird -- the error doesn't show up, but now it's using the image data from Shield.png when it should be using Shields.png.
I suppose I could just leave both image files in there as a workaround, but it really disturbs me that this bug is in there. Has anybody encountered something like this before or have any ideas how to fix it? In case anyone wants to take a closer look, here's a link to my project in its current form, and the code for DynWardrobe is included in its main download. For testing, I'd suggest going to the M. Groups tab in the project database, selecting the FG_Battle monster group, and doing a Test Battle. If this is a bug in DynRPG, I suspect it has to do with RPG::Image::loadFromFile having difficulty with the file name.
After spending quite a while examining the code for potential problems and getting info on everything I could think of using message popups, I finally tried using a different image file, just as an experiment. That worked just fine, so I tried saving a copy of the working image file as Shield.png and using that. That caused the error again. So I decided maybe the name of the file had something to do with it, and I tried renaming my backup of the original Shield.png to Shields.png and using that. Here's where it gets really weird -- the error doesn't show up, but now it's using the image data from Shield.png when it should be using Shields.png.
I suppose I could just leave both image files in there as a workaround, but it really disturbs me that this bug is in there. Has anybody encountered something like this before or have any ideas how to fix it? In case anyone wants to take a closer look, here's a link to my project in its current form, and the code for DynWardrobe is included in its main download. For testing, I'd suggest going to the M. Groups tab in the project database, selecting the FG_Battle monster group, and doing a Test Battle. If this is a bug in DynRPG, I suspect it has to do with RPG::Image::loadFromFile having difficulty with the file name.
loadFromFile is a very thin wrapper around the corresponding rpg maker function, in fact its source is:
void Image::loadFromFile(std::string filename, bool throwErrors, bool autoResize) {
this->autoResize = autoResize;
DStringPtr s(filename);
asm volatile("call *%%esi" : "=a" (_eax), "=d" (_edx), "=c" (_ecx) : "S" (0x467ABC), "a" (this), "d" (s.str), "c" (throwErrors) : "cc", "memory");
}
Pages:
1