Opened 8 years ago

Closed 8 years ago

Last modified 9 months ago

#5782 closed defect (fixed)

tsage savecode is non portable

Reported by: fingolfin Owned by: dreammaster
Priority: normal Component: Engine: TsAGE
Keywords: Cc:
Game:

Description

void Scene6100::Object::synchronize(Serializer &s) does this:

s.syncBytes((byte *)&_floats._float1, sizeof(double));
s.syncBytes((byte *)&_floats._float2, sizeof(double));
s.syncBytes((byte *)&_floats._float3, sizeof(double));
s.syncBytes((byte *)&_floats._float4, sizeof(double));

which is clearly not portable. (endianess and sizeof may differ)

Ticket imported from: #3346394. Ticket imported from: bugs/5782.

Change History (4)

comment:1 Changed 8 years ago by digitall

Owner: set to dreammaster

comment:2 Changed 8 years ago by digitall

dreammaster: Checked with git blame and this code is attributed to you. Could you take a look please?

To me, looking at this code in ringworld_scenes1.cpp, this looks like the floatset is saving the parameters (position?) of Probe and Rocks.
1. Does this need to be saved in a floating point format for original savegame compatibilty? (I'm assuming not)
2. Assuming no, then could this be changed to save as a fixed point or Common::Rational type value i.e. 1 or 2 Uint32LE which are then converted to and from the _floats on sync?

Thanks.

comment:3 Changed 8 years ago by dreammaster

Resolution: fixed
Status: newclosed

comment:4 Changed 9 months ago by digitall

Component: Engine: TsAGE
Note: See TracTickets for help on using tickets.