From 8fb35aca7f062b7459c6d31c2c15f806fec995bc Mon Sep 17 00:00:00 2001 From: RaveYard Date: Sat, 15 Oct 2022 13:58:41 +0200 Subject: [PATCH] Use default member initializers in IntThing --- src/level/doomdata.h | 24 ++++++++++++------------ src/level/level_udmf.cpp | 3 --- 2 files changed, 12 insertions(+), 15 deletions(-) diff --git a/src/level/doomdata.h b/src/level/doomdata.h index cf1ef83..f44e2b5 100644 --- a/src/level/doomdata.h +++ b/src/level/doomdata.h @@ -259,21 +259,21 @@ struct MapThing2 struct IntThing { - unsigned short thingid; - fixed_t x; // full precision coordinates for UDMF support - fixed_t y; + unsigned short thingid = 0; + fixed_t x = 0; // full precision coordinates for UDMF support + fixed_t y = 0; // everything else is not needed or has no extended form in UDMF - short z; - short angle; - short type; - short flags; - int special; - int args[5]; + short z = 0; + short angle = 0; + short type = 0; + short flags = 0; + int special = 0; + int args[5] = {}; FString arg0str; - short pitch; // UDMF - float height; // UDMF - float alpha; + short pitch = 0; // UDMF + float height = 0; // UDMF + float alpha = 1.0; TArray props; }; diff --git a/src/level/level_udmf.cpp b/src/level/level_udmf.cpp index 5ac0e9d..1d73a72 100644 --- a/src/level/level_udmf.cpp +++ b/src/level/level_udmf.cpp @@ -163,8 +163,6 @@ fixed_t CheckFixed(const char *key) void FProcessor::ParseThing(IntThing *th) { - th->pitch = 0; - SC_MustGetStringName("{"); while (!SC_CheckString("}")) { @@ -219,7 +217,6 @@ void FProcessor::ParseThing(IntThing *th) { th->args[4] = CheckInt(key); } - th->alpha = 1.0f; if (!stricmp(key, "alpha")) { th->alpha = CheckFloat(key);