i got a little problem with my app. when i try to load a map, it crashes cause the filename is mixed up.
first i started based on the gui-tutorial, where there is a button for a filebrowser which should give an output:
Code: Select all
//i have declared the variables const wchar_t* so;
//const c8* map; in the beginning of the code
if (id == 103)
{
listbox->addItem(L"File open");
IGUIFileOpenDialog* dia =env->addFileOpenDialog(L"Please choose a file.");
so = dia->getFilename();
stringc temp(so);
map = temp.c_str();
return true;
}
Code: Select all
// taste_a is set when the user presses a
if (taste_a == 1 && lvgeladen == 0 && map != 0)
{
scene::IAnimatedMesh* levelmesh = smgr->getMesh(map);
node = smgr->addOctTreeSceneNode(levelmesh->getMesh(0));
node->setMaterialFlag(video::EMF_LIGHTING, false);
lvgeladen = 1;
}
There are no errors while compiling, but the games crashes when i have chosen a file and then press a. luckily the console gives out
"file could not be opened: p||$%§ "
or something like that so i think the mapname got damaged in the type conversation.
i took a look in the other threads about types like the one of the messagebox and they brought me at least to being able to compile, but i think i got another mistake as well...