From: <bal...@us...> - 2003-11-10 18:15:56
|
Update of /cvsroot/gemrb/gemrb/gemrb/plugins/BAMImporter In directory sc8-pr-cvs1:/tmp/cvs-serv9694/gemrb/plugins/BAMImporter Modified Files: BAMImp.cpp Log Message: Bug Fixed: BAMImp.cpp: * Fixed a bug while loading fonts, BAMImp was calling GetFrame(i, 0), must use GetFrame(cycle[i].FirstFrame, 0) * Fixed a bug with wrong Frame Index in Cycles, use frame 0 instead of the wrong Frame Index * Fixed a bug with the RLE Size estimation, must use Ceil approximation Index: BAMImp.cpp =================================================================== RCS file: /cvsroot/gemrb/gemrb/gemrb/plugins/BAMImporter/BAMImp.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** BAMImp.cpp 2 Nov 2003 16:02:37 -0000 1.4 --- BAMImp.cpp 10 Nov 2003 18:15:53 -0000 1.5 *************** *** 140,143 **** --- 140,145 ---- Sprite2D * BAMImp::GetFrame(unsigned short findex, unsigned char mode) { + if(findex >= frames.size()) + findex = 0; str->Seek((frames[findex].FrameData & 0x7FFFFFFF), GEM_STREAM_START); unsigned long pixelcount = frames[findex].Width * frames[findex].Height; *************** *** 150,154 **** else RLESize = (frames[findex+1].FrameData & 0x7FFFFFFF) - (frames[findex].FrameData & 0x7FFFFFFF);*/ ! RLESize = (unsigned long)(frames[findex].Width * frames[findex].Height * 1.5); void * inpix = malloc(RLESize); unsigned char * p = (unsigned char*)inpix; --- 152,156 ---- else RLESize = (frames[findex+1].FrameData & 0x7FFFFFFF) - (frames[findex].FrameData & 0x7FFFFFFF);*/ ! RLESize = (unsigned long)ceil(frames[findex].Width * frames[findex].Height * 1.5); void * inpix = malloc(RLESize); unsigned char * p = (unsigned char*)inpix; *************** *** 225,229 **** Font * fnt = new Font(); for(int i = 0; i < 255; i++) { ! fnt->AddChar(GetFrame(i, 0)); } printf("Font Created\n"); --- 227,231 ---- Font * fnt = new Font(); for(int i = 0; i < 255; i++) { ! fnt->AddChar(GetFrame(cycles[i].FirstFrame, 0)); } printf("Font Created\n"); |