Runtime/Graphics: Replace bitfield unions with constructor initializers

This commit is contained in:
Luke Street 2020-04-10 15:03:31 -04:00
parent f83b970e75
commit 232823ae69
4 changed files with 29 additions and 29 deletions

View File

@ -681,7 +681,16 @@ void CBooRenderer::LoadBallFade() {
}
CBooRenderer::CBooRenderer(IObjectStore& store, IFactory& resFac)
: x8_factory(resFac), xc_store(store), x2a8_thermalRand(20) {
: x8_factory(resFac), xc_store(store), x2a8_thermalRand(20)
, x318_24_refectionDirty(false)
, x318_25_drawWireframe(false)
, x318_26_requestRGBA6(false)
, x318_27_currentRGBA6(false)
, x318_28_disableFog(false)
, x318_29_thermalVisor(false)
, x318_30_inAreaDraw(false)
, x318_31_persistRGBA6(false)
, m_thermalHotPass(false) {
g_Renderer = this;
xee_24_ = true;

View File

@ -152,20 +152,15 @@ class CBooRenderer final : public IRenderer {
// std::unique_ptr<CTexture> x314_phazonSuitMask;
CPhazonSuitFilter m_phazonSuitFilter;
union {
struct {
bool x318_24_refectionDirty : 1;
bool x318_25_drawWireframe : 1;
bool x318_26_requestRGBA6 : 1;
bool x318_27_currentRGBA6 : 1;
bool x318_28_disableFog : 1;
bool x318_29_thermalVisor : 1;
bool x318_30_inAreaDraw : 1;
bool x318_31_persistRGBA6 : 1;
bool m_thermalHotPass : 1;
};
u16 dummy = 0;
};
bool x318_24_refectionDirty : 1;
bool x318_25_drawWireframe : 1;
bool x318_26_requestRGBA6 : 1;
bool x318_27_currentRGBA6 : 1;
bool x318_28_disableFog : 1;
bool x318_29_thermalVisor : 1;
bool x318_30_inAreaDraw : 1;
bool x318_31_persistRGBA6 : 1;
bool m_thermalHotPass : 1;
void GenerateFogVolumeRampTex(boo::IGraphicsDataFactory::Context& ctx);
void GenerateSphereRampTex(boo::IGraphicsDataFactory::Context& ctx);

View File

@ -140,10 +140,12 @@ u32 CMoviePlayer::THPAudioDecode(s16* buffer, const u8* audioFrame, bool stereo)
}
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)
, xf4_25_hasAudio(false)
, xf4_26_fieldFlip(false)
, m_deinterlace(deinterlace) {
/* Read THP header information */
u8 buf[64];
SyncRead(buf, 64);

View File

@ -99,21 +99,15 @@ private:
float xe8_curSeconds = 0.f;
float xec_preLoadSeconds;
u32 xf0_preLoadFrames = 0;
bool xf4_24_loop : 1;
bool xf4_25_hasAudio : 1;
bool xf4_26_fieldFlip : 1;
bool m_deinterlace : 1;
u32 xf8_ = 0;
u32 xfc_fieldIndex = 0;
std::unique_ptr<uint8_t[]> m_yuvBuf;
union {
u32 m_dummy = 0;
struct {
bool xf4_24_loop : 1;
bool xf4_25_hasAudio : 1;
bool xf4_26_fieldFlip : 1;
bool m_deinterlace : 1;
};
};
specter::View::ViewBlock m_viewVertBlock;
boo::ObjToken<boo::IGraphicsBufferD> m_blockBuf;
boo::ObjToken<boo::IGraphicsBufferD> m_vertBuf;