Sure, I'm actually working in a Debug mode with the debug libraries. Where can I get you the information you need from MSVC 8? Also am I doing it the right way? Here is the code pieces:
First map load:
// Set up the application
bool Phage::Application()
{
...
if (!LoadLevel1 ()) return ReportError ("Failed to load beginning level!");
// Set the camera to our current sector and our maps start position
view->GetCamera ()->SetSector (room);
view->GetCamera ()->GetTransform ().SetOrigin (pos)
// Initialize our collider actor.
if (!phageHero->SpawnHero(cdsys, engine, view)) return ReportError ("Failed to load Hero!");
..
}
Map init function:
// Load a level
bool Phage::LoadMap (csString level)
{
// Clear the engine to load the new map
engine->DeleteAll();
// Change the VFS to the passed level string
VFS->ChDir (level);
// Report level loading
Report (CS_REPORTER_SEVERITY_NOTIFY, "Level Loading ...");
// Load the level file which is called 'world'.
if (!loader->LoadMapFile ("world", false))
ReportError("Error couldn't load level!");
engine->Prepare();// (meter);
// Determine starting position from the placement of the camera in the world map
CamStartPos();
return true;
}
1st map:
// Load the 1st map
bool Phage::LoadLevel1()
{
...
// Load up the 1st level
level_name = "/lev/Phage_map1";
if (!LoadMap (level_name)) return false;
// Compute collision detection
Report (CS_REPORTER_SEVERITY_NOTIFY, "Computing collision detection ...");
csColliderHelper::InitializeCollisionWrappers (cdsys, engine);
// Initialize the Muck monster
phageMuck = new Muck();
if(!phageMuck->CreateMuckFactory(GetObjectRegistry(), engine))
return ReportError("Failed to load the Muck factory!");
phageMuck->SpawnMuck(cdsys, engine, view, (pos + csVector3(0,0,5)), 1);
...
}
Load the 2nd map:
// Process the current frame
void Phage::ProcessFrame ()
{
...
if (LevelFlag)
{
...
// Move the character if the console is closed
if (!console->IsVisible())
{
...
if (phageKeyboard->randSteps == 50)
{
battleFlag = true;
if (!LoadLevel2 ()) return ReportError ("Failed to load second level!");
}
...
}
// Load the 2nd map
// Load the 1st map
bool Phage::LoadLevel1()
{
...
// Load up the 1st level
level_name = "/lev/Phage_battle_1";
if (!LoadMap (level_name)) return false;
...
}
When I try to load the 2nd map from within the 1st map, it crashes on 'iRenderLoop* rl = s->GetRenderLoop ();' here in engine.cpp:
void csEngine::Draw (iCamera *c, iClipper2D *view, iMeshWrapper* mesh)
{
...
iSector *s = c->GetSector ();
if (s)
{
iRenderLoop* rl = s->GetRenderLoop ();
if (!rl) rl = defaultRenderLoop;
rl->Draw (rview, s, mesh);
}
...
}