MCPcopy Create free account
hub / github.com/OpenXcom/OpenXcom / saveBinary

Method saveBinary

src/Savegame/Tile.cpp:173–191  ·  view source on GitHub ↗

* Saves the tile to binary. * @param buffer pointer to buffer. */

Source from the content-addressed store, hash-verified

171 * @param buffer pointer to buffer.
172 */
173void Tile::saveBinary(Uint8** buffer) const
174{
175 serializeInt(buffer, serializationKey._mapDataID, _mapDataID[0]);
176 serializeInt(buffer, serializationKey._mapDataID, _mapDataID[1]);
177 serializeInt(buffer, serializationKey._mapDataID, _mapDataID[2]);
178 serializeInt(buffer, serializationKey._mapDataID, _mapDataID[3]);
179 serializeInt(buffer, serializationKey._mapDataSetID, _mapDataSetID[0]);
180 serializeInt(buffer, serializationKey._mapDataSetID, _mapDataSetID[1]);
181 serializeInt(buffer, serializationKey._mapDataSetID, _mapDataSetID[2]);
182 serializeInt(buffer, serializationKey._mapDataSetID, _mapDataSetID[3]);
183
184 serializeInt(buffer, serializationKey._smoke, _smoke);
185 serializeInt(buffer, serializationKey._fire, _fire);
186
187 Uint8 boolFields = (_discovered[0]?1:0) + (_discovered[1]?2:0) + (_discovered[2]?4:0);
188 boolFields |= isUfoDoorOpen(1) ? 8 : 0; // west
189 boolFields |= isUfoDoorOpen(2) ? 0x10 : 0; // north?
190 serializeInt(buffer, serializationKey.boolFields, boolFields);
191}
192
193/**
194 * Set the MapData references of part 0 to 3.

Callers 1

saveMethod · 0.80

Calls 1

serializeIntFunction · 0.85

Tested by

no test coverage detected