Can't Load Quake 3 Maps

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
IKE

Can't Load Quake 3 Maps

Post by IKE »

I have tried o create a function that loads Quake 3 Maps, but the program crashes. Here is the Source Code:

Code: Select all

void LoadLevel(IAnimatedMesh* Mesh,ISceneNode* Node,ITriangleSelector* Selector,const c8* ZipFile,const c8* BspFile,ICameraSceneNode* Camera,ISceneNodeAnimator* Anim)
{
	Device->getFileSystem()->addZipFileArchive(ZipFile);


	if(Mesh)
	{
	

	Mesh=Smgr->getMesh(BspFile);
	}
	
	if(Node)
	{
		Node->setPosition(vector3df(-1370,-130,-1400));
		Selector=Smgr->createOctTreeTriangleSelector(Mesh->getMesh(0),Node,128);
		Node->setTriangleSelector(Selector);
		Selector->drop();
	}

	Anim=Smgr->createCollisionResponseAnimator(Selector,Camera,vector3df(30,50,30),vector3df(0,-50,0),19000.0f,vector3df(0,50,0));

	Camera->addAnimator(Anim);
	Anim->drop();



}
Here is how i Call it

Code: Select all

IAnimatedMesh* Level;
	ISceneNode* NodeLevel;
	ITriangleSelector* TriangleSelector;

	ISceneNodeAnimator* LevelAnim;




	LoadLevel(Level,NodeLevel,TriangleSelector,"../../media/map-20kdm2.pk3","20kdm2.bsp",Camera,LevelAnim);
disanti
Posts: 367
Joined: Sat Jan 17, 2004 1:36 am
Location: California, US
Contact:

Post by disanti »

I'm having the EXACT same problem. It crashes at this line:

Device->getFileSystem()->addZipFileArchive(ZipFile);

Good luck fixing it! :P I tried with Niko but he wasn't very helpful. He said to debug the library, I did so and it is crashing at this point in Irrlicht's code:


bool drop()
{
--ReferenceCounter; //CRASH
if (!ReferenceCounter)
{
delete this;
return true;
}

return false;
}

I REALLY hope this gets fixed... :(
________
CHF50
Post Reply