fix issue loading binary pbm

This commit is contained in:
Juan Linietsky 2016-01-11 11:44:53 -03:00
parent e212058841
commit 9e8f647440

View file

@ -170,12 +170,15 @@ RES ResourceFormatPBM::load(const String &p_path,const String& p_original_path,E
}
DVector<uint8_t>::Read r=token.read();
int bitwidth = width;
if (bidtwidth % 8)
bitwidth+=8-(bitwidth%8);
for(int i=0;i<height;i++) {
for(int j=0;j<width;j++) {
char num = r[i*width+j];
char num = r[i*bitwidth+j];
bm->set_bit(Point2i(j,i),num=='0');
}