Opened 13 years ago

Closed 13 years ago

Last modified 6 years ago

#5782 closed defect (fixed)

tsage savecode is non portable

Reported by: fingolfin Owned by: dreammaster
Priority: normal Component: Engine: TsAGE
Version: 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 by digitall, 13 years ago

Owner: set to dreammaster

comment:2 by digitall, 13 years ago

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 by dreammaster, 13 years ago

Resolution: fixed
Status: newclosed

comment:4 by digitall, 6 years ago

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