Getting bmp tiles from a zip folder

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
HighBuddha
Posts: 11
Joined: Thu Jun 15, 2006 12:46 am

Getting bmp tiles from a zip folder

Post by HighBuddha »

I am trying to load a zip file which has all my game tiles in it. I've gone over the tutorials and looked around the forum for some answers, but this is the best i could come up with. Could someone help me out?

Code: Select all

io::IFileSystem* filesystem = device->getFileSystem();
    filesystem->addZipFileArchive("../../MEV2/TILES/tiles.zip", true, true);
    io::IFileList* filelist = filesystem->createFileList();
    
    if(filelist->getFileCount() == 0)
    {
    }
    else
    {
        
        for(int i = 0; i<= filelist->getFileCount(); i++)
        {
                           CTile temp;
   					           temp.settilename(filelist->getFileName(i));
   					       video::ITexture* temp2 = driver->getTexture(temp.gettilename());
   					       driver->makeColorKeyTexture(temp2, core::position2d<s32>(0,0));
                           temp.setImage(temp2);
                           tilelist.push_back(temp);
        }
        filelist->drop();
    }
I keep getting access violation errors on the first line when i try to debug. I am very confused at this point and could really use some help. Thank you to anyone who can give some information.
jam
Posts: 409
Joined: Fri Nov 04, 2005 3:52 am

Post by jam »

what is the value of the variable called device? I suspect the pointer is invalid.
counter123
Posts: 6
Joined: Sat Jul 08, 2006 8:39 am

Post by counter123 »

for(int i = 0; i<= filelist->getFileCount(); i++)
I think you need a < instead of a <= here.
jam
Posts: 409
Joined: Fri Nov 04, 2005 3:52 am

Post by jam »

Good call, counter123.
system-independent, adj.:
Works equally poorly on all systems.
-- unknown
Post Reply