Page 1 of 1

Problem running the file

Posted: Fri Feb 09, 2007 7:37 am
by Apocalypse TH6
Hi! I'm using Irrlicht 1.2.

When I was trying to make my own version of the Quake3 Map tutorial, I always had problems. The map I was trying to load was a 3ds max file, so therefore it was too slow for the software renderer. I downloaded IrrDX v1.1 so I can be able to compile the Direct3D into my program(I use Dev-C++). After I did, though, everytime I run the program, I get an error report. Here is my code:

Code: Select all

#include <irrlicht.h>
#include <iostream>
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;

#pragma comment(lib, "Irrlicht.lib")

int main()
{
    IrrlichtDevice *device =
                   createDevice(EDT_DIRECT3D9, dimension2d<s32>(800, 600), 32,
                            false, false, false, 0);
                            
    video::IVideoDriver* driver = device->getVideoDriver();
    scene::ISceneManager* smgr = device->getSceneManager();
    
    device->getFileSystem()->addZipFileArchive("map.3ds");

    
    IAnimatedMesh* mesh = smgr->getMesh("map.3ds");
    ISceneNode* node = 0;
    if (mesh)    
       node = smgr->addOctTreeSceneNode(mesh->getMesh(0));
    
       
       smgr->addCameraSceneNodeFPS();
       
       device->getCursorControl()->setVisible(false);
       
       
       int lastFPS = -1;
       while(device->run())
       {
       driver->beginScene(true, true, SColor(0,200,200,200));
       smgr->drawAll();
       driver->endScene();
       int fps = driver->getFPS();
       if (lastFPS != fps)
       {
     stringw str = L"Irrlicht Engine - Quake 3 Map example [";     str += driver->getName();     str += "] FPS:";     str += fps;     device->setWindowCaption(str.c_str());     lastFPS = fps;
       }
     }
     device->drop();
     return 0;
     }
I linked to the new library and replaced\added the .dlls.

Posted: Fri Feb 09, 2007 1:54 pm
by Acki
What error report do you get ???

Re: Problem running the file

Posted: Fri Feb 09, 2007 2:27 pm
by sio2
Apocalypse TH6 wrote: device->getFileSystem()->addZipFileArchive("map.3ds");
3ds files are not zip files.

Posted: Fri Feb 09, 2007 3:23 pm
by Apocalypse TH6
Here are my screenshots:
Image

Image

I don't know exactly what's wrong. I played around with the code and removed "device->getFileSystem()->addZipFileArchive("map.3ds");".

Posted: Fri Feb 09, 2007 9:33 pm
by bitplane
you should get Microsoft VC++ Express, it's free and the debugger is world class. Dev-cpp is okay for an experienced C++ user who has no problem debugging using GCC, but Microsoft's debugger will show you exactly where and why your program crashed, even within Irrlicht.dll if you compiled it with VC++.
My guess is you have empty groups or surfaces without materials in your 3ds mesh which cause the OctTreeSceneNode to crash when rendering. This is a bug which has recently been fixed. If this truns out to be the problem then you've got 4 options-
Try using the latest source from SVN, or
find the fix for the bug here in the forums and apply it yourself to 1.2 and recompile, or
export to another format than 3ds, like obj for example, or
avoid using the oct-tree node until Irrlicht 1.3 is released

Posted: Fri Feb 09, 2007 11:52 pm
by Apocalypse TH6
I started using Visual C++ Express. The map didn't load right (actually almost nothing), but the Direct3D9 works. That's one of the things I wanted. Another thing, which program would be good for making maps?

Note: The Irrlicht.dll is different for Visual C++ and Dev-C++. That was a heads up.