TGB 1.7.2 Problem with T2DProject::newLevel()
by Randy Condon · in Torque Game Builder · 05/12/2008 (4:55 pm) · 0 replies
I created a non-default camera size (100 x 75) and saved my project.
When I create a new level, I get an assert in my debug build. (Nothing on release). Inside function LevelBuilderSceneEdit::removeXGuide, specifically mXGuides.erase_fast( i );
Digging around, I find this in the script file levelManagemante.ed.cs, function T2DProject::newLevel( %this ):
From what I can tell, %lastWindow.endLevel() deletes the %lastWindow scenegraph. Thus the if statement never reads true.
Back inside the code, removeXGuide doesn't find the xGuide and the iterator goes to the end. When that iterator is feed to the erase_fast, the assert hits for index not being < the element count.
I made this change, and all was well again.
Hopefully I've been accurate in my investigation. Thanks.
When I create a new level, I get an assert in my debug build. (Nothing on release). Inside function LevelBuilderSceneEdit::removeXGuide, specifically mXGuides.erase_fast( i );
Digging around, I find this in the script file levelManagemante.ed.cs, function T2DProject::newLevel( %this ):
%lastWindow.endLevel();
%oldPosition = "0 0";
%oldSize = "0 0";
if( isObject( %lastWindow.getScenegraph() ) )
{
%oldPosition = %lastWindow.getScenegraph().cameraPosition;
%oldSize = %lastWindow.getScenegraph().cameraSize;
}From what I can tell, %lastWindow.endLevel() deletes the %lastWindow scenegraph. Thus the if statement never reads true.
Back inside the code, removeXGuide doesn't find the xGuide and the iterator goes to the end. When that iterator is feed to the erase_fast, the assert hits for index not being < the element count.
I made this change, and all was well again.
//%lastWindow.endLevel();
%oldPosition = "0 0";
%oldSize = "0 0";
if( isObject( %lastWindow.getScenegraph() ) )
{
%oldPosition = %lastWindow.getScenegraph().cameraPosition;
%oldSize = %lastWindow.getScenegraph().cameraSize;
}
%lastWindow.endLevel();Hopefully I've been accurate in my investigation. Thanks.