From 56ace34945ce51eb7ffddeeafa5a8840f10cb2fc Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Tue, 23 Apr 2024 18:41:25 -0700 Subject: [PATCH] BAGEL: Further #if block removal --- engines/bagel/baglib/command_object.cpp | 3 +-- engines/bagel/baglib/help.cpp | 1 - engines/bagel/baglib/log_msg.cpp | 16 +--------------- engines/bagel/baglib/log_msg.h | 4 ---- engines/bagel/boflib/app.cpp | 4 ---- engines/bagel/boflib/gfx/bitmap.cpp | 4 ---- engines/bagel/dialogs/save_dialog.h | 4 +--- 7 files changed, 3 insertions(+), 33 deletions(-) diff --git a/engines/bagel/baglib/command_object.cpp b/engines/bagel/baglib/command_object.cpp index b0c9480f2b3..88a4728fde7 100644 --- a/engines/bagel/baglib/command_object.cpp +++ b/engines/bagel/baglib/command_object.cpp @@ -223,9 +223,8 @@ bool CBagCommandObject::RunObject() { } } else if (GetFileName() == "SETQVOL") { -#if BOF_WINDOWS CBofSound::SetQVol(GetPosition().x, GetPosition().y); -#endif + } else if (GetFileName() == "TURN") { // Cause 1 turn to go by diff --git a/engines/bagel/baglib/help.cpp b/engines/bagel/baglib/help.cpp index fff208f7222..30cc01e35ab 100644 --- a/engines/bagel/baglib/help.cpp +++ b/engines/bagel/baglib/help.cpp @@ -89,7 +89,6 @@ ErrorCode CBagHelp::Attach() { #endif if ((m_pOKButton = new CBofBmpButton) != nullptr) { - CBofBitmap *pUp, *pDown, *pFocus, *pDis; pUp = LoadBitmap(BuildHelpDir(HELP_OK_UP), pPal); diff --git a/engines/bagel/baglib/log_msg.cpp b/engines/bagel/baglib/log_msg.cpp index a3db4fac7df..95b1a354b82 100644 --- a/engines/bagel/baglib/log_msg.cpp +++ b/engines/bagel/baglib/log_msg.cpp @@ -709,12 +709,10 @@ void CBagLogSuspect::SetProperty(const CBofString &sProp, int nVal) { if (!sProp.Find("CHECKED")) SetSusChecked(bVal == 2 ? !GetSusChecked() : bVal); -#if INCLUDE_RP_AND_VP else if (!sProp.Find("VP")) SetSusVP(bVal == 2 ? !GetSusVP() : bVal); else if (!sProp.Find("RP")) SetSusRP(bVal == 2 ? !GetSusRP() : bVal); -#endif else CBagObject::SetProperty(sProp, nVal); } @@ -724,13 +722,12 @@ void CBagLogSuspect::SetProperty(const CBofString &sProp, int nVal) { int CBagLogSuspect::GetProperty(const CBofString &sProp) { if (!sProp.Find("CHECKED")) return GetSusChecked(); -#if INCLUDE_RP_AND_VP + if (!sProp.Find("VP")) return GetSusVP(); if (!sProp.Find("RP")) return GetSusRP(); -#endif return CBagObject::GetProperty(sProp); } @@ -747,14 +744,11 @@ ErrorCode CBagLogSuspect::Update(CBofBitmap *pBmp, CBofPoint pt, CBofRect *pSrcR CBofString sSusChecked(szSusChecked, 256); // Remove all the references to the jamming and voice printer state - -#if INCLUDE_RP_AND_VP char szSusVP[256]; char szSusRP[256]; CBofString sSusVP(szSusVP, 256); CBofString sSusRP(szSusRP, 256); -#endif if (GetSusChecked()) sSusChecked = "Y"; @@ -773,7 +767,6 @@ ErrorCode CBagLogSuspect::Update(CBofBitmap *pBmp, CBofPoint pt, CBofRect *pSrcR SetFont(FONT_MONO); -#if INCLUDE_RP_AND_VP SetText(BuildString(" %-5.5s %-17.17s %-12.12s %-20.20s %-4.4s %-4.4s", sSusChecked.GetBuffer(), m_sSusName.GetBuffer(), @@ -781,13 +774,6 @@ ErrorCode CBagLogSuspect::Update(CBofBitmap *pBmp, CBofPoint pt, CBofRect *pSrcR m_sSusRoom.GetBuffer(), sSusVP.GetBuffer(), sSusRP.GetBuffer())); -#else - SetText(BuildString(" %-5.5s %-17.17s %-12.12s %-20.20s", - sSusChecked.GetBuffer(), - m_sSusName.GetBuffer(), - m_sSusSpecies.GetBuffer(), - m_sSusRoom.GetBuffer())); -#endif return CBagTextObject::Update(pBmp, pt, pSrcRect, nMaskColor); } diff --git a/engines/bagel/baglib/log_msg.h b/engines/bagel/baglib/log_msg.h index 5c0d2da7350..7e68b6008ec 100644 --- a/engines/bagel/baglib/log_msg.h +++ b/engines/bagel/baglib/log_msg.h @@ -28,8 +28,6 @@ namespace Bagel { -#define INCLUDE_RP_AND_VP true - class CBagLogResidue : public CBagTextObject { protected: int m_nSdevWidth; @@ -129,7 +127,6 @@ public: m_sSusRoom = sProp; } -#if INCLUDE_RP_AND_VP void SetSusVP(bool bVal) { bVal == false ? SetState(GetState() & ~mSusVoicePrinted) : SetState(GetState() | mSusVoicePrinted); } @@ -143,7 +140,6 @@ public: bool GetSusRP() { return (GetState() & mSusResiduePrinted) != 0; } -#endif void SetSusChecked(bool bVal) { bVal == false ? SetState(GetState() & ~mSusChecked) : SetState(GetState() | mSusChecked); diff --git a/engines/bagel/boflib/app.cpp b/engines/bagel/boflib/app.cpp index 555b1283c07..f617de48d74 100644 --- a/engines/bagel/boflib/app.cpp +++ b/engines/bagel/boflib/app.cpp @@ -192,10 +192,6 @@ ErrorCode CBofApp::PreShutDown() { } ErrorCode CBofApp::PostShutDown() { -#if BOFDISP - CBofDisplayObject::CleanUp(); -#endif - if (m_pWindow != nullptr) { delete m_pWindow; m_pWindow = nullptr; diff --git a/engines/bagel/boflib/gfx/bitmap.cpp b/engines/bagel/boflib/gfx/bitmap.cpp index 4f84b8f942b..a8569cdea60 100644 --- a/engines/bagel/boflib/gfx/bitmap.cpp +++ b/engines/bagel/boflib/gfx/bitmap.cpp @@ -236,10 +236,6 @@ ErrorCode CBofBitmap::Paint(CBofWindow *pWnd, CBofRect *pDstRect, CBofRect *pSrc Assert(IsValidObject(this)); Assert(pWnd != nullptr); -#if PALETTESHIFTFIX - CBofWindow::CheckPaletteShiftList(); -#endif - Graphics::ManagedSurface *dstSurf = pWnd->getSurface(); CBofRect cDestRect(0, 0, m_nDX - 1, m_nDY - 1), cSourceRect(0, 0, m_nDX - 1, m_nDY - 1); diff --git a/engines/bagel/dialogs/save_dialog.h b/engines/bagel/dialogs/save_dialog.h index 80cbc7debf7..540a532913d 100644 --- a/engines/bagel/dialogs/save_dialog.h +++ b/engines/bagel/dialogs/save_dialog.h @@ -52,9 +52,7 @@ public: m_nBufSize = nLength; } -#if 1 - virtual void OnInitDialog(); -#endif + void OnInitDialog() override; protected: virtual void OnPaint(CBofRect *pRect);