MCPcopy Create free account
hub / github.com/ZDoom/Raze / StaticWriteRNGState

Method StaticWriteRNGState

source/common/engine/m_random.cpp:279–303  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

277//==========================================================================
278
279void FRandom::StaticWriteRNGState (FSerializer &arc)
280{
281 FRandom *rng;
282
283 arc("rngseed", rngseed);
284
285 if (arc.BeginArray("rngs"))
286 {
287 for (rng = FRandom::RNGList; rng != NULL; rng = rng->Next)
288 {
289 // Only write those RNGs that have names
290 if (rng->NameCRC != 0)
291 {
292 if (arc.BeginObject(nullptr))
293 {
294 arc("crc", rng->NameCRC)
295 ("index", rng->idx)
296 .Array("u", rng->sfmt.u, SFMT::N32)
297 .EndObject();
298 }
299 }
300 }
301 arc.EndArray();
302 }
303}
304
305//==========================================================================
306//

Callers

nothing calls this directly

Calls 4

BeginArrayMethod · 0.45
BeginObjectMethod · 0.45
EndObjectMethod · 0.45
EndArrayMethod · 0.45

Tested by

no test coverage detected