Game Development Community

Crash "Failed to create the bitmap" when opening Particle Edit

by Bryan Edds · in Torque Game Builder · 05/30/2005 (8:30 pm) · 10 replies

I have a crash on assert on line 92 in guiScrollCtrl.cc when I open the particle editor.

There have always been rendering errors in the particle editor, so I never thought much about it...

I can get past the crash by commenting out the assert that it crashes on, and there are no further problems that I notice at all...

Here's my stats -

AMD Duron 1.8GHz
512 MB DRAM
64 MB ATI RADEON 7500
WinXP (no service pack)

Crashes in full and windowed modes.

Here's my console log for the relevant parts -
Entering toggleParticleEditor()
   Entering showParticleEditor()
      Entering [CanvasCursor]GuiCanvas::pushDialog(Canvas, particleEditorScreenGui)
         Variable referenced before assignment: %layer
          *** Accessed undefined variable '$statsButtonFlag'
          *** Accessed undefined variable '$rotateButtonFlag'
         Fatal: (C:\Torque 2D\SDK\engine\gui\containers\guiScrollCtrl.cc @ 92) Failed to create the bitmap array
          *** Accessed undefined variable '$FP::DisableAsserts'
         keyboard0 input device unacquired.
         DirectInput deactivated.
         Activating DirectInput...

Anyways, I hope this is enough data and that I'm not the only having this problem.

#1
05/31/2005 (12:29 am)
Bryan,

Quote:There have always been rendering errors in the particle editor, so I never thought much about it...
Could you ellaborate?

Quote:Variable referenced before assignment: %layer
*** Accessed undefined variable '$statsButtonFlag'
*** Accessed undefined variable '$rotateButtonFlag'
These are not standard responses so you must have changed the code? Is this the variable declaration check mod? I presume it's this that's causing the problem here.

- Melv.
#2
05/31/2005 (12:59 am)
$Con::warnUndefinedVariables is on, so hopefully that explains the warns which you are not used to seeing.

I'll snap a pic tomarrow so you can see the rendering errors on the gui components in the particle editor.

But I've not made any change at all to the particle editor or the tile editor mods at all - though I have messed with some Canvas code in common (arbitrary stuff, really), and I've also just implemented multiple inheritance in script as well... so who knows. Mainly I reported this bug to find out if anyone else if having problems. If not... ugh... it could take days to find the bug...

Thanks for taking a look so far Melv! It honestly could be my code, so don't strain your brain too much about it.
#3
05/31/2005 (2:47 am)
Bryan,

Not a problem Bryan but it does look like some stock TGE problem. Does it do this with that warning off?

The guiScrollCtrl is stock TGE so I wonder if there's a known unfixed problem with it. Any chance of you running a debug-version and looking to see where it crashes?

If not, let me know how you get on and if I can help somehow.

- Melv.
#4
05/31/2005 (1:44 pm)
Hey, I turned off the warns, and still get the seemingly unecessary assert crash.

There's some GuiScrollCtrl rendering errors in the particle editor as well as the gui editor. Here are some respective screen shots -

i5.photobucket.com/albums/y162/bryanedds/screenshot_012-00001.png
i5.photobucket.com/albums/y162/bryanedds/screenshot_012-00002.png
Here's the stack trace for the crash -
PlatformAssert::processAssert(...)
PlatformAssert::process(...)
NTDLL! 77f7f570()
PlatformAssert::process(PlatformAssert::Type Fatal, const char * 0x007dd61c 'string', unsigned int 92, const char * 0x007ddb74 'string') line 84
PlatformAssert::processAssert(PlatformAssert::Type Fatal, const char * 0x007dd61c 'string', unsigned int 92, const char * 0x007ddb74 'string') line 103
GuiScrollCtrl::onWake() line 92 + 41 bytes
GuiControl::awaken() line 367 + 13 bytes
GuiControl::awaken() line 362
GuiControl::addObject(SimObject * 0x0b414fd0) line 140
GuiCanvas::pushDialogControl(GuiControl * 0x0b414fd0, int 0, unsigned char 0) line 860 + 17 bytes
cGuiCanvaspushDialog(GuiCanvas * 0x0119cc10, int 4, const char * * 0x0083e480) line 72
cGuiCanvaspushDialogcaster(SimObject * 0x0119cc10, int 4, const char * * 0x0083e480) line 53 + 104 bytes
CodeBlock::exec(unsigned int 275, const char * 0x0113215c, Namespace * 0x011a5774, unsigned int 2, const char * * 0x0083e480, unsigned char 0, const char * 0x0119b8d8) line 1216 + 23 bytes // CanvasCursor::pushDialog(...)
CodeBlock::exec(unsigned int 204, const char * 0x0b1e62a8, Namespace * 0x011412e8, unsigned int 0, const char * * 0x0083e480, unsigned char 0, const char * 0x00000000) line 1147 // showParticleEditor(...)
CodeBlock::exec(unsigned int 288, const char * 0x0b1e624c, Namespace * 0x011412e8, unsigned int 0, const char * * 0x0083e480, unsigned char 0, const char * 0x00000000) line 1147 // toggleParticleEditor(...)
CodeBlock::exec(unsigned int 5, const char * 0x00000000, Namespace * 0x00000000, unsigned int 0, const char * * 0x00000000, unsigned char 0, const char * 0x00000000) line 1147 // ""
CodeBlock::compileExec(const char * 0x00000000, const char * 0x0b446a90, unsigned char 0) line 523 // "toggleParticleEditor();"
Con::evaluate(const char * 0x0b446a90, unsigned char 0, const char * 0x00000000) line 785 // "toggleParticleEditor();"
ActionMap::processAction(const InputEvent * 0x0012f0e8) line 1093 + 16 bytes
ActionMap::handleEventGlobal(const InputEvent * 0x0012f0e8) line 1316
DemoGame::processInputEvent(InputEvent * 0x0012f0e8) line 548 + 9 bytes
GameInterface::processEvent(Event * 0x0012f0e8) line 65 + 17 bytes
GameInterface::postEvent(Event & {...}) line 153 + 17 bytes
DInputDevice::buildEvent(unsigned long 84, int 128, int 128) line 1047 + 23 bytes
DInputDevice::processAsync() line 636 + 68 bytes
DInputDevice::process() line 573 + 8 bytes
DInputManager::process() line 184 + 13 bytes
Input::process() line 430 + 19 bytes
Platform::process() line 715
DemoGame::main(int 1, const char * * 0x00e2ef00) line 422
run(int 1, const char * * 0x00e2ef00) line 1142 + 26 bytes
WinMain(HINSTANCE__ * 0x00400000, HINSTANCE__ * 0x00000000, char * 0x00141f1e, HINSTANCE__ * 0x00000000) line 1208 + 23 bytes
T2D_DEBUG! WinMainCRTStartup + 224 bytes
KERNEL32! 77e962b6()
#5
05/31/2005 (3:08 pm)
Some of those rendering 'errors' just look like a resloution problem. If you increase T2Ds res to 1024x768 or higher how does it look?
#6
05/31/2005 (3:35 pm)
They persist even in the highest resolutions :/
#7
06/01/2005 (12:30 am)
Bryan,

Seems like those rendering errors on the scrollBars are related somehow. I'm wondering if the GuiControl profiles are foobar'd. This and the fact that the bail is being caused because the 'GuiScrollCtrl' cannot create the bitmap-array (skin) via...
bool result = mProfile->constructBitmapArray() >= BmpStates * BmpCount;
... definately leads to the gui-control profile being a problem.

I would check the profile that is assigned to that control (if you've changed it). If not, I believe it should be "GuiTransparentScrollProfile" as defined in "example\common\ui\defaultProfiles.cs"" which is assigned to load either of the OS bitmaps "./osxScroll" or "./darkScroll". Maybe even those bitmaps being trash.

You could try deleting all the DSOs or if this doesn't happen in a clean install, copy the relevant files from that.

Probably not but if this is running on-top of T3D then you need to ensure (if you want to also use the editors) that you copy the appropriate profiles as well.

You could try a complete clean/rebuild just as a sanity check as well.

That's about all I can think of for now. Let me know how you get on.

- Melv.
#8
06/01/2005 (9:01 am)
Hey Melv, thanks to your help, I've figured it out!

I searched the defaultProfiles.cs file for the "GuiTransparentScrollProfile", but it was not in there!

A while back I had accidentally delete some .cs files when I meant to delete the .dso files only. When I realized I needed to restore the .cs files, I copied them from another Torque/common directory...

The only problems was that I copied them accidentally from my TGE build, not the T2D build!

So what has happened is that I had a truncated defaultProfiles.cs file, and without the new profiles defined in T2D, the assert was properly being thrown and the rendering errors occured.

But now that everything's situated properly, all the problems are gone! No asserts and everything is rendering great!

Thanks Melv!
#9
06/01/2005 (10:42 am)
Too bad I didn't catch this before, I've hit this a bunch of times integrating different parts of T2D into TGE and TGE into T2D =/ (so I know the error well lol)
glad you figured it out though
#10
06/02/2005 (12:04 am)
Glad it's working. :)

- Melv.