Page 1 of 1

Changing bitmap sizes but not TXT file does odd stuff

Posted: Mon May 26, 2008 1:59 am
by Gambit37
If you change the size of a bitmap, but forget to update your TXT file, RTC generates a critical warning (as expected).

However, it's an unusable error. RTC loads as usual then presents the error using an in-game dialogue box that has no text and nothing on the button!!!

Posted: Mon May 26, 2008 10:43 am
by George Gilbert
This works for me fine - Which bitmap was it (the font bitmap?)?

Also, was the error text correctly written to the text file?

Posted: Mon May 26, 2008 2:35 pm
by Gambit37
Ah, that's interesting... nope, it wasn't the font, it was one of the interface elements -- I forget which one, probably the runes.

But I'm using a custom main font -- maybe there's an issue with that not being loaded before these messages are shown?

Note that the loading messages in the bottom left during startup still display using the normal font, so I guess RTC uses the internal one for those then tries to switch to the custom one and something goes wrong?

Posted: Mon May 26, 2008 9:23 pm
by George Gilbert
The key thing is whether or not the error was written out to the text log file. If not then that's a serious problem (as there would be no way of identifying what was wrong).

The text file is the master source of error messages, and therefore that is the most important thing. Anything else is just a bonus and the engine tries to struggle on and do its best with what it has got to hand - I suspect it didn't have the resources to be able to print the error message to screen...

Posted: Mon May 26, 2008 9:32 pm
by Gambit37
OK, so I just forced it to crash by externally changing the size of a bitmap but not updating the text file. I made my background images to 640x479 instead of 640x480.

The game displays an in game dialogue box that's empty with a button containing no text. The mouse disappears too. If you click anywhere in the window, RTC crashes and popups a Windows dialogue with info about the diagnostic file error, which was written thus:

Code: Select all

Error:
  an integer divide by zero exception.

Stack Dump:
  utilMemory.utilVerifyClassFoundLeak(pointer 0x042F8D68, string "RTCMediaGraphics", string "LoadTileFromMemory", int 94);
  utilMemory.utilVerifyClass();
  RTC.RTC_DeInit();
  RTC.DisplayTerminalError(string "Critical Error - Terminating Program\n\nLoading dungeon object\nDimensions invalid\nGiven 640,480\nShould be 640,479?");
  RTC.TerminalError(int 9, string "CRITICAL ERROR - TERMINATING PROGRAM\\\\LOADING DUNGEON OBJECT\\DIMENSIONS INVALID\\GIVEN 640,480\\SHOULD BE 640,479?\\\\\\ATTEMPTING TO TERMINATE IN  0 SECONDS");
  RTC.LoadSingleBitmapEx(pointer 0x0012D748, pointer 0x00000000, int 0, pointer 0x0437B7E8, int 640, int 480, bool FALSE);
  RTC.RestoreBitmap(int 5678, int 1);
  RTC.CacheBitmap(int 5678, int 0);
  RTC.DrawBitmap(pointer 0x00BBBE98, int 5678, int 0, int 0, int 0, word 1, float 0, int 0, bool FALSE);
  RTC.DrawBackgroundView();
  RTC.ProgStateInDungeon();
  RTC.DoFrame(int 50);
  RTC.WinMain();

Posted: Sun Jun 01, 2008 2:51 pm
by George Gilbert
Hmmm - still can't reproduce the problem, even doing exactly the same steps as you suggest.

Looking at the diagnostic file, it's exactly what I would expect it to be (i.e. it's spotted that the file size doesn't match the text) though, so I would hope that it's correctly written out the error to your log file.

In fact, all the symptoms point to the fact that you've somehow managed to corrupt your font; and the bug is nothing whatsoever to do with the wrong sized bitmap.

Can you test this - for example, how about deliberately introducing some other type of error into your text file - say using a character twice in two different mirrors. What happens then (I'm guessing you'll get the same problem)?

Posted: Sat Jun 07, 2008 4:57 pm
by Gambit37
OK, some more info:

If I do as you suggest, and duplicate a mirror character, I get the CRITICAL ERROR during compilation -- the error shows up fine with my custom dialogue images and custom font.

If I introduce the size problem again, by resizing a graphics file but not updating the TXT file, a CRITICAL ERROR is NOT generated during compilation.

What happens is that RTC will load normally but at the point the background image is to be displayed, it bombs with an in-game dialogue box. This box is completely empty of any text, but it does display using my custom dialogue box graphics.

After some time, RTC closes automatically, a big Windows error is generated, and the diagnostic file contains the long error specified above.