From: <ave...@us...> - 2003-11-15 15:20:47
|
Update of /cvsroot/gemrb/gemrb/gemrb/plugins/BMPImporter In directory sc8-pr-cvs1:/tmp/cvs-serv12568 Modified Files: BMPImp.cpp Log Message: Fixed BMP importer (corrected scanline length calculation) Index: BMPImp.cpp =================================================================== RCS file: /cvsroot/gemrb/gemrb/gemrb/plugins/BMPImporter/BMPImp.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** BMPImp.cpp 30 Oct 2003 09:24:24 -0000 1.3 --- BMPImp.cpp 15 Nov 2003 15:20:38 -0000 1.4 *************** *** 73,85 **** switch(BitCount) { case 24: ! PaddedRowLength = ((Width*3)+((Width*3)%4)); break; case 16: ! PaddedRowLength = ((Width*2)+((Width*2)%4)); break; case 8: ! PaddedRowLength = (Width+(Width%4)); break; --- 73,85 ---- switch(BitCount) { case 24: ! PaddedRowLength = Width*3; break; case 16: ! PaddedRowLength = Width*2; break; case 8: ! PaddedRowLength = Width; break; *************** *** 88,91 **** --- 88,92 ---- return false; } + if(PaddedRowLength&3) PaddedRowLength+=4-(PaddedRowLength&3); void * rpixels = malloc(PaddedRowLength*Height); str->Read(rpixels, PaddedRowLength*Height); |