BAGEL: More cleanup (add virtual/override keywords, remove useless includes)

This commit is contained in:
Strangerke 2024-05-31 23:17:33 +01:00
parent 895069be9a
commit 6c391b6649
5 changed files with 22 additions and 28 deletions

View File

@ -25,7 +25,6 @@
#include "bagel/boflib/gui/dialog.h"
#include "bagel/boflib/gui/button.h"
#include "bagel/boflib/gfx/text.h"
namespace Bagel {
@ -35,14 +34,14 @@ class CBagQuitDialog : public CBofDialog {
public:
CBagQuitDialog();
virtual void onInitDialog();
void onInitDialog() override;
protected:
virtual void onPaint(CBofRect *pRect);
virtual void onClose();
virtual void onBofButton(CBofObject *pObject, int nState);
void onPaint(CBofRect *pRect) override;
void onClose() override;
void onBofButton(CBofObject *pObject, int nState) override;
virtual void onKeyHit(uint32 lKey, uint32 lRepCount);
void onKeyHit(uint32 lKey, uint32 lRepCount) override;
// Data
//
@ -53,14 +52,14 @@ class CBagNextCDDialog : public CBofDialog {
public:
CBagNextCDDialog();
virtual void onInitDialog();
void onInitDialog() override;
protected:
virtual void onPaint(CBofRect *pRect);
virtual void onClose();
virtual void onBofButton(CBofObject *pObject, int nState);
void onPaint(CBofRect *pRect) override;
void onClose() override;
void onBofButton(CBofObject *pObject, int nState) override;
virtual void onKeyHit(uint32 lKey, uint32 lRepCount);
void onKeyHit(uint32 lKey, uint32 lRepCount) override;
// Data
CBofBmpButton *_pButton;
@ -70,16 +69,16 @@ class CBagCreditsDialog : public CBofDialog {
public:
CBagCreditsDialog();
virtual void onInitDialog();
void onInitDialog() override;
protected:
virtual void onPaint(CBofRect *pRect);
virtual void onClose();
void onPaint(CBofRect *pRect) override;
void onClose() override;
virtual void onKeyHit(uint32 lKey, uint32 lRepCount);
virtual void onLButtonDown(uint32 nFlags, CBofPoint *pPoint, void * = nullptr);
void onKeyHit(uint32 lKey, uint32 lRepCount) override;
void onLButtonDown(uint32 nFlags, CBofPoint *pPoint, void * = nullptr) override;
virtual void onMainLoop();
void onMainLoop() override;
ErrorCode nextScreen();
ErrorCode displayCredits();

View File

@ -24,7 +24,6 @@
#define BAGEL_DIALOGS_OPT_WINDOW_H
#include "bagel/boflib/gui/dialog.h"
#include "bagel/boflib/string.h"
#include "bagel/boflib/gui/button.h"
#include "bagel/boflib/gui/scroll_bar.h"
#include "bagel/boflib/gui/text_box.h"
@ -76,12 +75,12 @@ public:
void getDialogData();
protected:
virtual void onPaint(CBofRect *pRect);
virtual void onInitDialog();
void onPaint(CBofRect *pRect) override;
void onInitDialog() override;
virtual void onBofScrollBar(CBofObject *pObject, int nPos);
virtual void onBofButton(CBofObject *pObject, int nState);
virtual void onKeyHit(uint32 lKey, uint32 lRepCount);
void onBofScrollBar(CBofObject *pObject, int nPos) override;
void onBofButton(CBofObject *pObject, int nState) override;
void onKeyHit(uint32 lKey, uint32 lRepCount) override;
// Data members
//

View File

@ -26,7 +26,6 @@
#include "bagel/boflib/gui/list_box.h"
#include "bagel/boflib/gui/button.h"
#include "bagel/boflib/gui/text_box.h"
#include "bagel/boflib/string.h"
#include "bagel/dialogs/save_dialog.h"
namespace Bagel {

View File

@ -21,7 +21,6 @@
#include "bagel/spacebar/filter.h"
#include "bagel/spacebar/main_window.h"
#include "bagel/spacebar/master_win.h"
#include "bagel/spacebar/spacebar.h"
#include "bagel/boflib/gfx/palette.h"
#include "bagel/boflib/string.h"

View File

@ -214,9 +214,7 @@ ErrorCode SBarSlotWnd::attach() {
}
// Read in their total nuggets from game
CBagVar *pVar = nullptr;
pVar = g_VarManager->getVariable("NUGGETS");
CBagVar *pVar = g_VarManager->getVariable("NUGGETS");
if (pVar)
_nCredit = pVar->getNumValue();