by mimispa » Jan 26, 2007 @ 11:53am
Hi Edge,
About the first question.
When i try to pack the sound files the problem was when playing the file. The sound was a very long beep.
So, i was able to find the file in the EPK, read it and load it through the sound class, but when the sound class try to play the file then sound a very long beep and the application crashed.
Unfortunately i don't have right now the source code but i'm sending you a similar code (i tried this code with sound class) for load_surface_from_pack that works fine (with surfaces).
bool ClassMain::load_surface_from_pack(ClassEFile *filepack,char *filename, E2DSurface *surface,ClassEDisplay *source_display)
{
bool load_result=true;
unsigned char *filedata;
unsigned long filedatasize,fileid;
if (filepack->PackSearchFile(filename,fileid))
{
int apotelesma=filepack->PackGetFileData(filedata,filedatasize,fileid);
if (apotelesma==E_OK)
{
apotelesma=source_display->CreateSurface(surface,filedata,filedatasize,EST_DEFAULT);
if (apotelesma!=E_OK){load_result=false;}
ClassEMemory::DeAlloc(filedata);
}
else
{load_result=false;}
}
else
{load_result=false;}
return load_result;
}
Thanks for your reply!