Problem running the file

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
Apocalypse TH6
Posts: 16
Joined: Sat Jan 27, 2007 10:24 pm
Location: San Mateo, CA

Problem running the file

Post 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.
Acki
Posts: 3496
Joined: Tue Jun 29, 2004 12:04 am
Location: Nobody's Place (Venlo NL)
Contact:

Post by Acki »

What error report do you get ???
while(!asleep) sheep++;
IrrExtensions:Image
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
sio2
Competition winner
Posts: 1003
Joined: Thu Sep 21, 2006 5:33 pm
Location: UK

Re: Problem running the file

Post by sio2 »

Apocalypse TH6 wrote: device->getFileSystem()->addZipFileArchive("map.3ds");
3ds files are not zip files.
Apocalypse TH6
Posts: 16
Joined: Sat Jan 27, 2007 10:24 pm
Location: San Mateo, CA

Post 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");".
bitplane
Admin
Posts: 3204
Joined: Mon Mar 28, 2005 3:45 am
Location: England
Contact:

Post 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
Submit bugs/patches to the tracker!
Need help right now? Visit the chat room
Apocalypse TH6
Posts: 16
Joined: Sat Jan 27, 2007 10:24 pm
Location: San Mateo, CA

Post 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.
Post Reply