Reloading a Map

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
java_man
Posts: 6
Joined: Wed Jun 15, 2005 6:46 pm

Reloading a Map

Post by java_man »

How do you load in another Map? Does anybody have any example code on how to do this? Thanks
Games are fun to play but great to create.
area51
Posts: 338
Joined: Thu Mar 18, 2004 10:20 pm
Location: UK
Contact:

Post by area51 »

The same way as you loaded the first map.

Make sure you do a

Code: Select all

smgr->clear();

before loading the second, that's all.
________
DC MEDICAL MARIJUANA DISPENSARY
Last edited by area51 on Tue Feb 22, 2011 1:06 pm, edited 1 time in total.
java_man
Posts: 6
Joined: Wed Jun 15, 2005 6:46 pm

Post by java_man »

area51 wrote:The same way as you loaded the first map.

Make sure you do a

Code: Select all

smgr->clear();

before loading the second, that's all.
I tried it but got a compile error:

Compiling...
CDemo.cpp
C:\irrct\examples\Techdemo\CDemo.cpp(398) : error C2039: 'clear' : is not a member of 'ISceneManager'
C:\IRRCT\INCLUDE\ISceneManager.h(87) : see declaration of 'ISceneManager'
Error executing cl.exe.

Here's the code I used, thanks.

Code: Select all

void CDemo::loadSceneData()
{
	// load quake level

	video::IVideoDriver* driver = device->getVideoDriver();
	scene::ISceneManager* sm = device->getSceneManager();

	++Level_count;
	if (Level_count == 1) {
		quakeLevelMesh = sm->getMesh("complex.bsp");
	} else {
		sm->clear();
		quakeLevelMesh = sm->getMesh("20kdm2.bsp");

	}
Games are fun to play but great to create.
puh
Posts: 356
Joined: Tue Aug 26, 2003 3:53 pm

Post by puh »

Hm, in my app smgr->clear() works like a charm.
What version of Irr do you use?
area51
Posts: 338
Joined: Thu Mar 18, 2004 10:20 pm
Location: UK
Contact:

Post by area51 »

Thanks puh, yes, the code compiles without error.

It makes it's first appearance in 0.9.0 (To my surprise, thought its been in for a lot longer than that)

Try upgrading to 0.10.0
________
CAODAISM DICUSSION
Post Reply