mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-11 15:22:16 +00:00
This commit is contained in:
commit
4ec2db43a4
12 changed files with 28 additions and 23 deletions
|
@ -331,6 +331,10 @@ void FRandom::StaticReadRNGState(FSerializer &arc)
|
|||
FRandom *rng;
|
||||
|
||||
arc("rngseed", rngseed);
|
||||
|
||||
// Call StaticClearRandom in order to ensure that SFMT is initialized
|
||||
FRandom::StaticClearRandom ();
|
||||
|
||||
if (arc.BeginArray("rngs"))
|
||||
{
|
||||
int count = arc.ArraySize();
|
||||
|
|
|
@ -1616,7 +1616,7 @@ void FBehavior::StaticSerializeModuleStates (FSerializer &arc)
|
|||
{
|
||||
if (arc.isReading())
|
||||
{
|
||||
int modnum = arc.ArraySize();
|
||||
auto modnum = arc.ArraySize();
|
||||
if (modnum != StaticModules.Size())
|
||||
{
|
||||
I_Error("Level was saved with a different number of ACS modules. (Have %d, save has %d)", StaticModules.Size(), modnum);
|
||||
|
@ -2933,7 +2933,7 @@ void DACSThinker::Serialize(FSerializer &arc)
|
|||
if (arc.BeginArray("runningscripts"))
|
||||
{
|
||||
auto cnt = arc.ArraySize();
|
||||
for (int i = 0; i < cnt; i++)
|
||||
for (unsigned i = 0; i < cnt; i++)
|
||||
{
|
||||
SavingRunningscript srs;
|
||||
arc(nullptr, srs);
|
||||
|
|
|
@ -890,10 +890,10 @@ void G_SerializeLevel(FSerializer &arc, bool hubload)
|
|||
// deep down in the deserializer or just a crash if the few insufficient safeguards were not triggered.
|
||||
BYTE chk[16] = { 0 };
|
||||
arc.Array("checksum", chk, 16);
|
||||
if (arc.GetSize("linedefs") != numlines ||
|
||||
arc.GetSize("sidedefs") != numsides ||
|
||||
arc.GetSize("sectors") != numsectors ||
|
||||
arc.GetSize("polyobjs") != po_NumPolyobjs ||
|
||||
if (arc.GetSize("linedefs") != (unsigned)numlines ||
|
||||
arc.GetSize("sidedefs") != (unsigned)numsides ||
|
||||
arc.GetSize("sectors") != (unsigned)numsectors ||
|
||||
arc.GetSize("polyobjs") != (unsigned)po_NumPolyobjs ||
|
||||
memcmp(chk, level.md5, 16))
|
||||
{
|
||||
I_Error("Savegame is from a different level");
|
||||
|
|
|
@ -392,7 +392,8 @@ int FZipLump::FillCache()
|
|||
int FZipLump::GetFileOffset()
|
||||
{
|
||||
if (Method != METHOD_STORED) return -1;
|
||||
if (Flags & LUMPFZIP_NEEDFILESTART) SetLumpAddress(); return Position;
|
||||
if (Flags & LUMPFZIP_NEEDFILESTART) SetLumpAddress();
|
||||
return Position;
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
|
|
|
@ -381,7 +381,7 @@ void FSerializer::Close()
|
|||
//
|
||||
//==========================================================================
|
||||
|
||||
int FSerializer::ArraySize()
|
||||
unsigned FSerializer::ArraySize()
|
||||
{
|
||||
if (r != nullptr && r->mObjects.Last().mObject->IsArray())
|
||||
{
|
||||
|
@ -709,7 +709,7 @@ FSerializer &FSerializer::Sprite(const char *key, int32_t &spritenum, int32_t *d
|
|||
{
|
||||
if (val->IsString())
|
||||
{
|
||||
int name = *reinterpret_cast<const int*>(val->GetString());
|
||||
uint32_t name = *reinterpret_cast<const uint32_t*>(val->GetString());
|
||||
for (auto hint = NumStdSprites; hint-- != 0; )
|
||||
{
|
||||
if (sprites[hint].dwName == name)
|
||||
|
|
|
@ -60,7 +60,7 @@ public:
|
|||
FWriter *w = nullptr;
|
||||
FReader *r = nullptr;
|
||||
|
||||
int ArraySize();
|
||||
unsigned ArraySize();
|
||||
void WriteKey(const char *key);
|
||||
void WriteObjects();
|
||||
|
||||
|
|
|
@ -91,7 +91,7 @@ static const FLOP FxFlops[] =
|
|||
//
|
||||
//==========================================================================
|
||||
|
||||
FCompileContext::FCompileContext(PClassActor *cls, PPrototype *ret) : Class(cls), ReturnProto(ret)
|
||||
FCompileContext::FCompileContext(PClassActor *cls, PPrototype *ret) : ReturnProto(ret), Class(cls)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -959,7 +959,7 @@ ExpEmit FxUnaryNotBoolean::Emit(VMFunctionBuilder *build)
|
|||
//==========================================================================
|
||||
|
||||
FxPreIncrDecr::FxPreIncrDecr(FxExpression *base, int token)
|
||||
: FxExpression(base->ScriptPosition), Base(base), Token(token)
|
||||
: FxExpression(base->ScriptPosition), Token(token), Base(base)
|
||||
{
|
||||
AddressRequested = false;
|
||||
AddressWritable = false;
|
||||
|
@ -1045,7 +1045,7 @@ ExpEmit FxPreIncrDecr::Emit(VMFunctionBuilder *build)
|
|||
//==========================================================================
|
||||
|
||||
FxPostIncrDecr::FxPostIncrDecr(FxExpression *base, int token)
|
||||
: FxExpression(base->ScriptPosition), Base(base), Token(token)
|
||||
: FxExpression(base->ScriptPosition), Token(token), Base(base)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue