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.
HighBuddha
Posts: 11 Joined: Thu Jun 15, 2006 12:46 am
Post
by HighBuddha » Tue Jun 20, 2006 2:25 am
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 » Tue Jun 20, 2006 6:16 am
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 » Sun Jul 09, 2006 8:04 pm
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 » Sun Jul 09, 2006 9:32 pm
Good call, counter123.
system-independent, adj.:
Works equally poorly on all systems.
-- unknown