Runtime problems

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
Endar
Posts: 145
Joined: Mon Jun 14, 2004 7:59 am

Runtime problems

Post by Endar »

I'm having problems when trying to run something that loads up a bsp map.

I've only tried it with the one distributed with irrlicht, and that won't load up.

I have copied the code directly from the quake map tutorial, and am using the original dll, and it won't work......it seems to have a problem during the call of "smgr->drawAll()" in the while loop.

When I try to run it within VC++, it gives an error "instruction at 0x1004f3aa referenced memory at 0xffffffff. The memory could not be read." that kind of thing, and when I run it out of VC++ (manually clicking on exe file) it gives the error:

"The value of ESP was not properly saved across a function call. This is usually a result of calling a function declared with one calling convention with a function pointer declared with a different calling convention."

Ideas?? Because things could kind of go down without being able to load bsps.
"The reputation of a thousand years may be determined by the conduct of one hour."
-Japanese Proverb
Endar
Posts: 145
Joined: Mon Jun 14, 2004 7:59 am

Post by Endar »

Hey guys, I really do need some help with this, because its gotten to the point where no irrlicht stuff (haven't tried non-irrlicht stuff) I compile doesn't work.

HELP
"The reputation of a thousand years may be determined by the conduct of one hour."
-Japanese Proverb
bal
Posts: 829
Joined: Fri Jun 18, 2004 5:19 pm
Location: Geluwe, Belgium

Post by bal »

I had this error too when the path to the bsp/pk3 was not right. So I'd advice you to check it.
General Tools List
General FAQ
System: AMD Barton 2600+, 512MB, 9600XT 256MB, WinXP + FC3
buezi
Posts: 3
Joined: Mon Apr 19, 2004 3:52 pm

Post by buezi »

Hello,
The calling convention error is also possible when you use a multithreaded library or dll in a single threaded projects in your vc++ (or vice versa?). You should make sure what kind of code you are generating. For a simple irrlicht project single threaded should work (it depends on your needs).
You can check this in "code generation" in the c/c++ folder within the project settings.
cheers buezi
Endar
Posts: 145
Joined: Mon Jun 14, 2004 7:59 am

Post by Endar »

Okay, I've checked and it seems that the irrlicht dll is multithreaded and the irrlicht things I'm doing are single threaded.

So, should I change and make my irrlicht "projects" multithreaded, even though they are small (rarely over 200-300 lines of code) ??
"The reputation of a thousand years may be determined by the conduct of one hour."
-Japanese Proverb
Endar
Posts: 145
Joined: Mon Jun 14, 2004 7:59 am

Post by Endar »

I've changed and recompiled one of my projects as single-threaded and multi-threaded and it didn't work at all.

Lets just make absolutely sure that the problem isn't in the code:

Code: Select all

int main()
{
   IrrlichtDevice* device = createDevice(video::EDT_DIRECTX8,
core::dimension2d<s32>(640,480), 16);
   video::IVideoDriver* driver = device->getVideoDriver();
   scene::ISceneManager* smgr = device->getSceneManager();

   device->getFileSystem()->addZipFileArchive("map-20kdm2.pk3");
    scene::IAnimatedMesh* mesh = smgr->getMesh("20kdm2.bsp");

    scene::ISceneNode* node = 0;
    if(mesh)
    	node = smgr->addOctTreeSceneNode(mesh->getMesh(0) );
    if(node)
    	node->setPosition(core::vector3df(-1300, -144, -1249) );
    smgr->addCameraSceneNodeFPS();

    device->getCursorControl()->setVisible(false);

    int lastFPS = -1;

    while( device->run() ){
		driver->beginScene(true, true, video::SColor(0,100,100,100) );
		smgr->drawAll();
		driver->endScene();

		int fps = driver->getFPS();

		if( lastFPS != fps ){
			wchar_t tmp[1024];
			swprintf(tmp, 1024, L"Quake 3 Map Example - Irrlicht Engine (fps:%d) Triangles:%d",
				fps, driver->getPrimitiveCountDrawn() );

			device->setWindowCaption(tmp);
			lastFPS = fps;
		}
    }
    device->drop();
return 0;
}
That's the code (without the #include, #pragma, etc, at the top). So, can anyone see anything wrong with the code? (probably not because it worked before, but now I'm getting a little desperate because I can't run anything I've compiled with irrlicht)
"The reputation of a thousand years may be determined by the conduct of one hour."
-Japanese Proverb
Endar
Posts: 145
Joined: Mon Jun 14, 2004 7:59 am

Post by Endar »

Okay I believe I have found the problem.

I was mixing and matching dll and lib files.

Hit me, really, right on the head....no its okay, I'm not actually using it! :D

Thanks for putting up with my complete stupidity guys. :oops:
"The reputation of a thousand years may be determined by the conduct of one hour."
-Japanese Proverb
Post Reply