From: <ave...@us...> - 2003-12-02 19:57:34
|
Update of /cvsroot/gemrb/gemrb/gemrb/plugins/AREImporter In directory sc8-pr-cvs1:/tmp/cvs-serv32266 Modified Files: AREImp.cpp Log Message: Add: Using default sounds Index: AREImp.cpp =================================================================== RCS file: /cvsroot/gemrb/gemrb/gemrb/plugins/AREImporter/AREImp.cpp,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** AREImp.cpp 30 Nov 2003 19:13:34 -0000 1.19 --- AREImp.cpp 2 Dec 2003 19:57:31 -0000 1.20 *************** *** 29,36 **** --- 29,53 ---- #include "../Core/ImageMgr.h" + #define DEF_OPEN 0 + #define DEF_CLOSE 1 + + #define DEF_COUNT 2 + static char Sounds[DEF_COUNT][9]={-1}; + AREImp::AREImp(void) { autoFree = false; str = NULL; + if(Sounds[0][0]==-1) { + memset(Sounds,0,sizeof(Sounds) ); + int SoundTable = core->LoadTable("defsound"); + TableMgr * at = core->GetTable(SoundTable); + if(at) { + for(int i=0; i<DEF_COUNT;i++) { + strncpy(Sounds[i],at->QueryField(i,0),8); + } + } + core->DelTable(SoundTable); + } } *************** *** 188,192 **** --- 205,211 ---- //Leave the default sound untouched if(OpenResRef[0]) memcpy(door->OpenSound, OpenResRef, 9); + else memcpy(door->OpenSound,Sounds[DEF_OPEN],9); if(CloseResRef[0]) memcpy(door->CloseSound, CloseResRef, 9); + else memcpy(door->CloseSound,Sounds[DEF_CLOSE],9); } //Loading Containers |