Page 1 of 1

[Fixed for V0.42] maximum bitmap height reached

Posted: Wed Aug 09, 2006 5:43 pm
by linflas
It seems that a 400px+ height custom bitmap makes RTC engine crash.

RTC (V0.41) Diagnostic file - Wed Aug 09 17:42:43 2006

Error:
an access violation exception.

Stack Dump:
RTCMediaGraphics.ScaleBitmapAntiAliasA(pointer 0x0B502F20, pointer 0x00A70EA8, pointer 0x0A03DFB0, int 0, int 0, double 0.676923, double 0.679545, int 0, int 0, int 88, int 299);
RTCMediaGraphics.ScaleBitmap(pointer 0x0B502F20, pointer 0x0A03DFB0, int 0, int 0, int 130, int 440, int 0, int 0, int 88, int 299, int 51, int 51, int 12698553, bool FALSE, bool TRUE);
RTC.AutoScaleSingleFloorBitmap(pointer 0x0B734900, pointer 0x0A03DEB0, int 6);
RTC.AddAutoScaleFloorBitmap(pointer 0x0B70DD82, int 6);
RTC.DrawDungeonItem(int 621, int 6, int 8);
RTC.DrawDungeonTile(int 6, char 5, char 36, char 0);
RTC.DrawDungeonView(char 7, char 35, char 0, char 3);
RTC.ProgStateInDungeon();
RTC.DoFrame(int 50);
RTC.WinMain();

Posted: Wed Aug 09, 2006 5:47 pm
by George Gilbert
Are you *sure* that that is the root cause of the problem? Ie, if you used a different bitmap, but kept everything else the same it doesn't crash?

If so, can you send me the compiled RTC file that you're using with instructions on how to get to the place that causes the crash (or even better, a tiny test dungeon with just one object in it that causes the crash).

Posted: Wed Aug 09, 2006 6:08 pm
by linflas
Yes, sure about it. The bitmap was 440 px height, i resized it to 400 and it works fine.
I sent you an example by mail.

Posted: Wed Aug 09, 2006 6:43 pm
by George Gilbert
Thats great thanks - what's happening is that it's not actually crashing in RTC, but instead in DirectX because your bitmap is bigger than the maximum screen size specified in the config.txt file (as opposed to the 400 being hard-coded into RTC).

I've fixed this in V0.42 so that your huge image is still displayed properly, even in a 640x400 resolution game.

Posted: Wed Aug 09, 2006 7:05 pm
by linflas
excellent ! avoiding crashes is cool, even if these huge bitmaps are finally not necessary : i will have to crop them to gain some kilo(mega?)bytes in the RTC file ! :oops:

Posted: Wed Aug 09, 2006 8:23 pm
by Gambit37
Out of interest Linflas, are you creating all your bitmaps as 24-bit? Because if you are, you can save a lot of disk space by dithering most down to 8-bit adaptive palettes -- these are usually more than adequate for most images. You only really need 24-bit for very complex imagery with lots of subtle shading that wouldn't translate well in a dither.

Of course, you may know all this, in which case I'll shut up.

Posted: Wed Aug 09, 2006 10:32 pm
by linflas
nope, i'm not a compression specialist, so... thanks for your remarks :)

oh btw, i crop the parts that will never be displayed by the engine of course