fixed endian bug

This commit is contained in:
aap 2020-12-20 19:11:34 +01:00
parent ed9cb45ee9
commit 9c578580ec

View File

@ -931,7 +931,10 @@ Material::streamRead(Stream *stream)
RWERROR((ERR_CHUNK, "STRUCT"));
return nil;
}
stream->read32(&buf, sizeof(buf));
stream->read8(&buf, sizeof(buf));
RGBA col = buf.color;
memNative32(&buf, sizeof(buf));
buf.color = col;
Material *mat = Material::create();
if(mat == nil)
return nil;
@ -973,7 +976,9 @@ Material::streamWrite(Stream *stream)
buf.flags = 0;
buf.unused = 0;
buf.textured = this->texture != nil;
stream->write32(&buf, sizeof(buf));
memLittle32(&buf, sizeof(buf));
buf.color = this->color;
stream->write8(&buf, sizeof(buf));
if(rw::version >= 0x30400){
float32 surfaceProps[3];