mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-12 06:00:48 +00:00
AGS: Read and write RoomObject's fields explicitly
From upstream bb9ae639f9e28b59af4bbc9b613cd9455ea0db3e
This commit is contained in:
parent
ee311d660f
commit
bb1d0849fa
@ -157,27 +157,54 @@ void RoomObject::ReadFromFile(Stream *in) {
|
||||
x = in->ReadInt32();
|
||||
y = in->ReadInt32();
|
||||
transparent = in->ReadInt32();
|
||||
|
||||
in->ReadArrayOfInt16(&tint_r, 15);
|
||||
cycling = in->ReadByte();
|
||||
overall_speed = in->ReadByte();
|
||||
on = in->ReadByte();
|
||||
flags = in->ReadByte();
|
||||
in->ReadArrayOfInt16(&blocking_width, 2);
|
||||
tint_r = in->ReadInt16();
|
||||
tint_g = in->ReadInt16();
|
||||
tint_b = in->ReadInt16();
|
||||
tint_level = in->ReadInt16();
|
||||
tint_light = in->ReadInt16();
|
||||
zoom = in->ReadInt16();
|
||||
last_width = in->ReadInt16();
|
||||
last_height = in->ReadInt16();
|
||||
num = in->ReadInt16();
|
||||
baseline = in->ReadInt16();
|
||||
view = in->ReadInt16();
|
||||
loop = in->ReadInt16();
|
||||
frame = in->ReadInt16();
|
||||
wait = in->ReadInt16();
|
||||
moving = in->ReadInt16();
|
||||
cycling = in->ReadInt8();
|
||||
overall_speed = in->ReadInt8();
|
||||
on = in->ReadInt8();
|
||||
flags = in->ReadInt8();
|
||||
blocking_width = in->ReadInt16();
|
||||
blocking_height = in->ReadInt16();
|
||||
}
|
||||
|
||||
void RoomObject::WriteToFile(Stream *out) const {
|
||||
out->WriteInt32(x);
|
||||
out->WriteInt32(y);
|
||||
out->WriteInt32(transparent);
|
||||
|
||||
// TODO: Split up array write to properly write fields separately
|
||||
out->WriteArrayOfInt16(&tint_r, 15);
|
||||
out->WriteByte(cycling);
|
||||
out->WriteByte(overall_speed);
|
||||
out->WriteByte(on);
|
||||
out->WriteByte(flags);
|
||||
out->WriteArrayOfInt16(&blocking_width, 2);
|
||||
out->WriteInt16(tint_r);
|
||||
out->WriteInt16(tint_g);
|
||||
out->WriteInt16(tint_b);
|
||||
out->WriteInt16(tint_level);
|
||||
out->WriteInt16(tint_light);
|
||||
out->WriteInt16(zoom);
|
||||
out->WriteInt16(last_width);
|
||||
out->WriteInt16(last_height);
|
||||
out->WriteInt16(num);
|
||||
out->WriteInt16(baseline);
|
||||
out->WriteInt16(view);
|
||||
out->WriteInt16(loop);
|
||||
out->WriteInt16(frame);
|
||||
out->WriteInt16(wait);
|
||||
out->WriteInt16(moving);
|
||||
out->WriteInt8(cycling);
|
||||
out->WriteInt8(overall_speed);
|
||||
out->WriteInt8(on);
|
||||
out->WriteInt8(flags);
|
||||
out->WriteInt16(blocking_width);
|
||||
out->WriteInt16(blocking_height);
|
||||
}
|
||||
|
||||
} // namespace AGS3
|
||||
|
Loading…
x
Reference in New Issue
Block a user