Bitfield initializer bug fixes

This commit is contained in:
Jack Andersen 2017-01-24 18:40:19 -10:00
parent 87ab1a1f86
commit da91c921cb
21 changed files with 66 additions and 66 deletions

View File

@ -65,19 +65,12 @@ public:
s16 xa_prio; s16 xa_prio;
//CSfxHandle xc_handle; //CSfxHandle xc_handle;
TAreaId x10_area; TAreaId x10_area;
union bool x14_24_isActive:1;
{ bool x14_25_isPlaying:1;
struct bool x14_26_looped:1;
{ bool x14_27_inArea:1;
bool x14_24_isActive:1; bool x14_28_available:1;
bool x14_25_isPlaying:1; bool x14_29_useAcoustics:1;
bool x14_26_looped:1;
bool x14_27_inArea:1;
bool x14_28_available:1;
bool x14_29_useAcoustics:1;
};
u16 _dummy = 0;
};
public: public:
virtual ~CBaseSfxWrapper() = default; virtual ~CBaseSfxWrapper() = default;
virtual void SetActive(bool v) { x14_24_isActive = v; } virtual void SetActive(bool v) { x14_24_isActive = v; }

View File

@ -78,6 +78,7 @@ public:
return m_reader->readBytesToBuf(buf, len); return m_reader->readBytesToBuf(buf, len);
} }
u64 Length() {return m_reader->length();} u64 Length() {return m_reader->length();}
const std::string& GetPath() const { return x18_path; }
}; };
} }

View File

@ -18,14 +18,8 @@ class CGameCamera : public CActor
float x164_zfar; float x164_zfar;
float x168_aspect; float x168_aspect;
u32 x16c_; u32 x16c_;
union { bool x170_24_perspDirty : 1;
struct bool x170_25_disablesInput : 1;
{
bool x170_24_perspDirty : 1;
bool x170_25_disablesInput : 1;
};
u32 _dummy = 0;
};
float x174_ = 0.f; float x174_ = 0.f;
float x178_ = 0.f; float x178_ = 0.f;
float x17c_ = 0.f; float x17c_ = 0.f;

View File

@ -358,8 +358,11 @@ u32 CMoviePlayer::THPAudioDecode(s16* buffer, const u8* audioFrame, bool stereo)
} }
CMoviePlayer::CMoviePlayer(const char* path, float preLoadSeconds, bool loop, bool deinterlace) CMoviePlayer::CMoviePlayer(const char* path, float preLoadSeconds, bool loop, bool deinterlace)
: CDvdFile(path), xec_preLoadSeconds(preLoadSeconds), xf4_24_loop(loop), m_deinterlace(deinterlace) : CDvdFile(path), xec_preLoadSeconds(preLoadSeconds)
{ {
xf4_24_loop = loop;
m_deinterlace = deinterlace;
/* Read THP header information */ /* Read THP header information */
u8 buf[64]; u8 buf[64];
SyncRead(buf, 64); SyncRead(buf, 64);

View File

@ -121,12 +121,12 @@ private:
union union
{ {
u32 m_dummy = 0;
struct struct
{ {
bool xf4_24_loop : 1; bool xf4_25_hasAudio : 1; bool xf4_24_loop : 1; bool xf4_25_hasAudio : 1;
bool xf4_26_fieldFlip : 1; bool m_deinterlace : 1; bool xf4_26_fieldFlip : 1; bool m_deinterlace : 1;
}; };
u8 m_dummy = 0;
}; };
specter::View::ViewBlock m_viewVertBlock; specter::View::ViewBlock m_viewVertBlock;

View File

@ -14,8 +14,9 @@ namespace MP1
CMFGame::CMFGame(const std::weak_ptr<CStateManager>& stateMgr, const std::weak_ptr<CInGameGuiManager>& guiMgr, CMFGame::CMFGame(const std::weak_ptr<CStateManager>& stateMgr, const std::weak_ptr<CInGameGuiManager>& guiMgr,
const CArchitectureQueue&) const CArchitectureQueue&)
: CMFGameBase("CMFGame"), x14_stateManager(stateMgr.lock()), x18_guiManager(guiMgr.lock()), x2a_25_(true) : CMFGameBase("CMFGame"), x14_stateManager(stateMgr.lock()), x18_guiManager(guiMgr.lock())
{ {
x2a_25_ = true;
//g_Main->x160_25_ = true; //g_Main->x160_25_ = true;
} }

View File

@ -39,7 +39,12 @@ class CGunController
}; };
public: public:
CGunController(CModelData& modelData) : x0_modelData(modelData), x58_24_(true) {} CGunController(CModelData& modelData)
: x0_modelData(modelData)
{
x58_24_ = true;
}
void UnLoadFidget(); void UnLoadFidget();
void LoadFidgetAnimAsync(CStateManager&, s32, s32, s32); void LoadFidgetAnimAsync(CStateManager&, s32, s32, s32);
void GetFreeLookSetId() const; void GetFreeLookSetId() const;

View File

@ -7,7 +7,10 @@ const std::vector<SConnection> CEntity::NullConnectionList;
CEntity::CEntity(TUniqueId uniqueId, const CEntityInfo& info, bool active, const std::string& name) CEntity::CEntity(TUniqueId uniqueId, const CEntityInfo& info, bool active, const std::string& name)
: x4_areaId(info.GetAreaId()), x8_uid(uniqueId), xc_editorId(info.GetEditorId()), x10_name(name), : x4_areaId(info.GetAreaId()), x8_uid(uniqueId), xc_editorId(info.GetEditorId()), x10_name(name),
x20_conns(info.GetConnectionList()), x30_24_active(active) {} x20_conns(info.GetConnectionList())
{
x30_24_active = active;
}
void CEntity::AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId objId, CStateManager& stateMgr) void CEntity::AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId objId, CStateManager& stateMgr)
{ {

View File

@ -355,8 +355,9 @@ const zeus::CTransform& CDummyGameArea::IGetTM() const
} }
CGameArea::CGameArea(CInputStream& in, int idx, int mlvlVersion) CGameArea::CGameArea(CInputStream& in, int idx, int mlvlVersion)
: x4_selfIdx(idx), xf0_25_active(true) : x4_selfIdx(idx)
{ {
xf0_25_active = true;
x8_nameSTRG = in.readUint32Big(); x8_nameSTRG = in.readUint32Big();
xc_transform.read34RowMajor(in); xc_transform.read34RowMajor(in);
x3c_invTransform = xc_transform.inverse(); x3c_invTransform = xc_transform.inverse();

View File

@ -10,7 +10,6 @@ CPhysicsActor::CPhysicsActor(TUniqueId uid, bool active, const std::string& name
: CActor(uid, active, name, info, xf, std::move(mData), matList, actorParms, kInvalidUniqueId) : CActor(uid, active, name, info, xf, std::move(mData), matList, actorParms, kInvalidUniqueId)
, xe8_mass(moverData.x30_mass) , xe8_mass(moverData.x30_mass)
, xec_massRecip(moverData.x30_mass <= 0.f ? 1.f : 1.f / moverData.x30_mass) , xec_massRecip(moverData.x30_mass <= 0.f ? 1.f : 1.f / moverData.x30_mass)
, xf8_24_(true)
, x150_momentum(moverData.x18_) , x150_momentum(moverData.x18_)
, x1c0_collisionPrimitive(box, matList) , x1c0_collisionPrimitive(box, matList)
, x1f4_translation(xf.origin) , x1f4_translation(xf.origin)
@ -18,6 +17,7 @@ CPhysicsActor::CPhysicsActor(TUniqueId uid, bool active, const std::string& name
, x23c_stepUpHeight(stepUp) , x23c_stepUpHeight(stepUp)
, x240_stepDownHeight(stepDown) , x240_stepDownHeight(stepDown)
{ {
xf8_24_ = true;
SetMass(moverData.x30_mass); SetMass(moverData.x30_mass);
MoveCollisionPrimitive(zeus::CVector3f::skZero); MoveCollisionPrimitive(zeus::CVector3f::skZero);
SetVelocityOR(moverData.x0_velocity); SetVelocityOR(moverData.x0_velocity);

View File

@ -10,10 +10,10 @@ CScriptActorKeyframe::CScriptActorKeyframe(TUniqueId uid, const std::string& nam
, x38_(f1) , x38_(f1)
, x3c_(totalPlayback) , x3c_(totalPlayback)
, x40_(f1) , x40_(f1)
, x44_24_(b1)
, x44_25_(b2)
, x44_26_(w2)
{ {
x44_24_ = b1;
x44_25_ = b2;
x44_26_ = w2;
} }
void CScriptActorKeyframe::Accept(IVisitor& visitor) void CScriptActorKeyframe::Accept(IVisitor& visitor)

View File

@ -12,9 +12,9 @@ CScriptCameraHintTrigger::CScriptCameraHintTrigger(TUniqueId uid, bool active, c
CActorParameters::None(), kInvalidUniqueId) CActorParameters::None(), kInvalidUniqueId)
, xe8_obb(xf, scale) , xe8_obb(xf, scale)
, x124_scale(scale) , x124_scale(scale)
, x130_24_(b2)
, x130_25_(b3)
{ {
x130_24_ = b2;
x130_25_ = b3;
} }
void CScriptCameraHintTrigger::Accept(IVisitor& visitor) void CScriptCameraHintTrigger::Accept(IVisitor& visitor)

View File

@ -9,19 +9,18 @@ CScriptColorModulate::CScriptColorModulate(TUniqueId uid, const std::string& nam
const zeus::CColor& c1, const zeus::CColor& c2, const zeus::CColor& c1, const zeus::CColor& c2,
EBlendMode bm, float f1, float f2, EBlendMode bm, float f1, float f2,
bool b1, bool b2, bool b3, bool b4, bool b5, bool active) bool b1, bool b2, bool b3, bool b4, bool b5, bool active)
: CEntity(uid, info, active, name), : CEntity(uid, info, active, name),
x40_(c1), x40_(c1),
x44_(c2), x44_(c2),
x48_blendMode(bm), x48_blendMode(bm),
x4c_(f1), x4c_(f1),
x50_(f2), x50_(f2)
x54_24_(b1),
x54_25_(b2),
x54_26_(b3),
x54_27_(b4),
x54_28_(b5)
{ {
x54_24_ = b1;
x54_25_ = b2;
x54_26_ = b3;
x54_27_ = b4;
x54_28_ = b5;
} }
void CScriptColorModulate::Accept(IVisitor& visitor) void CScriptColorModulate::Accept(IVisitor& visitor)

View File

@ -10,9 +10,9 @@ CScriptCoverPoint::CScriptCoverPoint(TUniqueId uid, const std::string &name, con
: CActor(uid, active, name, info, xf, CModelData::CModelDataNull(), : CActor(uid, active, name, info, xf, CModelData::CModelDataNull(),
CMaterialList(EMaterialTypes::Unknown), CActorParameters::None(), kInvalidUniqueId), CMaterialList(EMaterialTypes::Unknown), CActorParameters::None(), kInvalidUniqueId),
xe8_flags(flags), xe8_flags(flags),
xf4_coverTime(coverTime), xf4_coverTime(coverTime)
xf8_24_crouch(crouch)
{ {
xf8_24_crouch = crouch;
xec_cosHorizontalAngle = std::cos(zeus::degToRad(horizontalAngle) * 0.5f); xec_cosHorizontalAngle = std::cos(zeus::degToRad(horizontalAngle) * 0.5f);
xf0_sinVerticalAngle = std::sin(zeus::degToRad(verticalAngle) * 0.5f); xf0_sinVerticalAngle = std::sin(zeus::degToRad(verticalAngle) * 0.5f);
x100_touchBounds.emplace(xf.origin, xf.origin); x100_touchBounds.emplace(xf.origin, xf.origin);

View File

@ -28,8 +28,8 @@ CScriptDock::CScriptDock(TUniqueId uid, const std::string& name, const CEntityIn
, x258_dockReferenceCount(dockReferenceCount) , x258_dockReferenceCount(dockReferenceCount)
, x25c_dock(dock) , x25c_dock(dock)
, x260_area(area) , x260_area(area)
, x268_25_loadConnected(loadConnected)
{ {
x268_25_loadConnected = loadConnected;
} }
void CScriptDock::Accept(IVisitor& visitor) void CScriptDock::Accept(IVisitor& visitor)

View File

@ -30,13 +30,13 @@ CScriptDoor::CScriptDoor(TUniqueId uid, const std::string& name, const CEntityIn
const zeus::CVector3f&, const zeus::CAABox& aabb, bool active, const zeus::CVector3f&, const zeus::CAABox& aabb, bool active,
bool open, bool b2, float, bool ballDoor) bool open, bool b2, float, bool ballDoor)
: CPhysicsActor(uid, active, name, info, xf, std::move(mData), MakeDoorMaterialList(open), : CPhysicsActor(uid, active, name, info, xf, std::move(mData), MakeDoorMaterialList(open),
aabb, SMoverData(1.f), actParms, 0.3f, 0.1f), aabb, SMoverData(1.f), actParms, 0.3f, 0.1f)
x2a8_29_ballDoor(ballDoor),
x2a8_25_(open),
x2a8_26_(open),
x2a8_28_(b2),
x2a8_27_(true)
{ {
x2a8_29_ballDoor = ballDoor;
x2a8_25_ = open;
x2a8_26_ = open;
x2a8_28_ = b2;
x2a8_27_ = true;
x264_ = GetBoundingBox(); x264_ = GetBoundingBox();
x284_modelBounds = x64_modelData->GetBounds(xf.getRotation()); x284_modelBounds = x64_modelData->GetBounds(xf.getRotation());

View File

@ -19,8 +19,8 @@ CScriptShadowProjector::CScriptShadowProjector(TUniqueId uid, const std::string&
, xfc_opacity(opacity) , xfc_opacity(opacity)
, x100_opacityRecip(opacity < 0.00001 ? 1.f : opacityQ / opacity) , x100_opacityRecip(opacity < 0.00001 ? 1.f : opacityQ / opacity)
, x10c_textureSize(textureSize) , x10c_textureSize(textureSize)
, x110_24_persistent(b2)
{ {
x110_24_persistent = b2;
} }
void CScriptShadowProjector::Accept(IVisitor& visitor) void CScriptShadowProjector::Accept(IVisitor& visitor)

View File

@ -24,14 +24,14 @@ CScriptSound::CScriptSound(TUniqueId uid, const std::string& name, const CEntity
, x114_(w5) , x114_(w5)
, x116_(w6) , x116_(w6)
, x118_(w7 + 8192) , x118_(w7 + 8192)
, x11c_25_(b1)
, x11c_26_(b2)
, x11c_27_(b3)
, x11c_28_(b4)
, x11c_29_(b5)
, x11c_30_(b6)
, x11d_24_(b7)
{ {
x11c_25_ = b1;
x11c_26_ = b2;
x11c_27_ = b3;
x11c_28_ = b4;
x11c_29_ = b5;
x11c_30_ = b6;
x11d_24_ = b7;
if (x11c_30_ && (!x11c_26_ || !x11c_25_)) if (x11c_30_ && (!x11c_26_ || !x11c_25_))
x11c_30_ = false; x11c_30_ = false;
} }

View File

@ -30,8 +30,8 @@ CScriptSpecialFunction::CScriptSpecialFunction(TUniqueId uid, const std::string&
, x1bc_(aId1) , x1bc_(aId1)
, x1c0_(aId2) , x1c0_(aId2)
, x1c4_(aId3) , x1c4_(aId3)
, x1e4_26_(true)
{ {
x1e4_26_ = true;
if (xe8_function == ESpecialFunction::HUDTarget) if (xe8_function == ESpecialFunction::HUDTarget)
x1c8_ = {{zeus::CVector3f(-1.f), zeus::CVector3f(1.f)}}; x1c8_ = {{zeus::CVector3f(-1.f), zeus::CVector3f(1.f)}};
} }

View File

@ -23,9 +23,9 @@ CScriptTrigger::CScriptTrigger(TUniqueId uid, const std::string& name, const CEn
, x128_forceMagnitude(forceField.magnitude()) , x128_forceMagnitude(forceField.magnitude())
, x12c_flags(triggerFlags) , x12c_flags(triggerFlags)
, x130_bounds(bounds) , x130_bounds(bounds)
, x148_26_deactivateOnEntered(b2)
, x148_27_deactivateOnExited(b3)
{ {
x148_26_deactivateOnEntered = b2;
x148_27_deactivateOnExited = b3;
} }
void CScriptTrigger::Accept(IVisitor& visitor) void CScriptTrigger::Accept(IVisitor& visitor)

View File

@ -99,7 +99,7 @@ private:
void DrawText(); void DrawText();
public: public:
CWorldTransManager() : x44_24_transFinished(true) {} CWorldTransManager() { x44_24_transFinished = true; }
void Update(float); void Update(float);