fix issue loading binary pbm
This commit is contained in:
parent
e212058841
commit
9e8f647440
1 changed files with 5 additions and 2 deletions
|
@ -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');
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue