Modern syntax: virtual -> override.

Signed-off-by: Andrea Odetti <mariofutire@gmail.com>
This commit is contained in:
Andrea Odetti 2021-01-31 13:55:43 +00:00
parent 3215f2aff3
commit cc55d9e681
19 changed files with 87 additions and 103 deletions

View file

@ -9,9 +9,9 @@ class CommonFrame : public LinuxFrame
public:
CommonFrame();
virtual void Destroy();
void Destroy() override;
virtual BYTE* GetResource(WORD id, LPCSTR lpType, DWORD expectedSize);
BYTE* GetResource(WORD id, LPCSTR lpType, DWORD expectedSize) override;
protected:
static std::string getBitmapFilename(const std::string & resource);

View file

@ -18,12 +18,12 @@ public:
typedef boost::property_tree::basic_ptree<std::string, std::string, KeyQtEncodedLess> ini_t;
virtual std::string getString(const std::string & section, const std::string & key) const;
virtual DWORD getDWord(const std::string & section, const std::string & key) const;
virtual bool getBool(const std::string & section, const std::string & key) const;
std::string getString(const std::string & section, const std::string & key) const override;
DWORD getDWord(const std::string & section, const std::string & key) const override;
bool getBool(const std::string & section, const std::string & key) const override;
virtual void putString(const std::string & section, const std::string & key, const std::string & value);
virtual void putDWord(const std::string & section, const std::string & key, const DWORD value);
void putString(const std::string & section, const std::string & key, const std::string & value) override;
void putDWord(const std::string & section, const std::string & key, const DWORD value) override;
template<typename T>
T getValue(const std::string & section, const std::string & key) const;

View file

@ -10,7 +10,7 @@ class Analog : public JoypadBase
public:
Analog();
virtual double getAxis(int i) const;
double getAxis(int i) const override;
private:
std::vector<std::pair<unsigned, unsigned> > myAxisCodes;

View file

@ -11,7 +11,7 @@ class Joypad : public JoypadBase
public:
Joypad();
virtual double getAxis(int i) const;
double getAxis(int i) const override;
private:
std::vector<std::map<unsigned, double> > myAxisCodes;

View file

@ -11,7 +11,7 @@ class JoypadBase : public Paddle
public:
JoypadBase();
virtual bool getButton(int i) const;
bool getButton(int i) const override;
private:
std::vector<unsigned> myButtonCodes;

View file

@ -10,12 +10,12 @@ class RetroFrame : public CommonFrame
public:
RetroFrame();
virtual void VideoPresentScreen();
virtual void FrameRefreshStatus(int drawflags);
virtual void Initialize();
virtual void Destroy();
virtual int FrameMessageBox(LPCSTR lpText, LPCSTR lpCaption, UINT uType);
virtual void GetBitmap(LPCSTR lpBitmapName, LONG cb, LPVOID lpvBits);
void VideoPresentScreen() override;
void FrameRefreshStatus(int drawflags) override;
void Initialize() override;
void Destroy() override;
int FrameMessageBox(LPCSTR lpText, LPCSTR lpCaption, UINT uType) override;
void GetBitmap(LPCSTR lpBitmapName, LONG cb, LPVOID lpvBits) override;
private:
std::vector<uint8_t> myVideoBuffer;

View file

@ -17,8 +17,8 @@ public:
int poll();
const std::string & getName() const;
virtual bool getButton(int i) const;
virtual double getAxis(int i) const;
bool getButton(int i) const override;
double getAxis(int i) const override;
private:
int myFD;

View file

@ -18,10 +18,10 @@ public:
WINDOW * GetWindow();
WINDOW * GetStatus();
virtual void Initialize();
virtual void Destroy();
virtual void VideoPresentScreen();
virtual int FrameMessageBox(LPCSTR lpText, LPCSTR lpCaption, UINT uType);
void Initialize() override;
void Destroy() override;
void VideoPresentScreen() override;
int FrameMessageBox(LPCSTR lpText, LPCSTR lpCaption, UINT uType) override;
void ProcessEvDev();

View file

@ -8,12 +8,12 @@
class Configuration : public Registry
{
public:
virtual std::string getString(const std::string & section, const std::string & key) const;
virtual DWORD getDWord(const std::string & section, const std::string & key) const;
virtual bool getBool(const std::string & section, const std::string & key) const;
std::string getString(const std::string & section, const std::string & key) const override;
DWORD getDWord(const std::string & section, const std::string & key) const override;
bool getBool(const std::string & section, const std::string & key) const override;
virtual void putString(const std::string & section, const std::string & key, const std::string & value);
virtual void putDWord(const std::string & section, const std::string & key, const DWORD value);
void putString(const std::string & section, const std::string & key, const std::string & value) override;
void putDWord(const std::string & section, const std::string & key, const DWORD value) override;
private:
QSettings mySettings;

View file

@ -11,8 +11,8 @@ class GamepadPaddle : public Paddle
public:
static std::shared_ptr<Paddle> fromName(const QString & name);
virtual bool getButton(int i) const;
virtual double getAxis(int i) const;
bool getButton(int i) const override;
double getAxis(int i) const override;
private:
GamepadPaddle(const std::shared_ptr<QGamepad> & gamepad);

View file

@ -38,8 +38,8 @@ public slots:
void startEmulator();
protected:
virtual void closeEvent(QCloseEvent * event);
virtual void timerEvent(QTimerEvent *event);
void closeEvent(QCloseEvent * event) override;
void timerEvent(QTimerEvent *event) override;
private slots:

View file

@ -14,14 +14,14 @@ class QtFrame : public LinuxFrame
public:
QtFrame(Emulator * emulator, QMdiSubWindow * window);
virtual void VideoPresentScreen();
virtual void FrameRefreshStatus(int drawflags);
virtual void Initialize();
virtual void Destroy();
void VideoPresentScreen() override;
void FrameRefreshStatus(int drawflags) override;
void Initialize() override;
void Destroy() override;
virtual int FrameMessageBox(LPCSTR lpText, LPCSTR lpCaption, UINT uType);
virtual void GetBitmap(LPCSTR lpBitmapName, LONG cb, LPVOID lpvBits);
virtual BYTE* GetResource(WORD id, LPCSTR lpType, DWORD expectedSize);
int FrameMessageBox(LPCSTR lpText, LPCSTR lpCaption, UINT uType) override;
void GetBitmap(LPCSTR lpBitmapName, LONG cb, LPVOID lpvBits) override;
BYTE* GetResource(WORD id, LPCSTR lpType, DWORD expectedSize) override;
void SetForceRepaint(const bool force);
void SetZoom(const int x);

View file

@ -22,14 +22,14 @@ signals:
public slots:
protected:
virtual bool event(QEvent *event);
bool event(QEvent *event) override;
virtual void paintEvent(QPaintEvent *event);
virtual void keyPressEvent(QKeyEvent *event);
virtual void keyReleaseEvent(QKeyEvent *event);
virtual void mouseMoveEvent(QMouseEvent *event);
virtual void mousePressEvent(QMouseEvent *event);
virtual void mouseReleaseEvent(QMouseEvent *event);
void paintEvent(QPaintEvent *event) override;
void keyPressEvent(QKeyEvent *event) override;
void keyReleaseEvent(QKeyEvent *event) override;
void mouseMoveEvent(QMouseEvent *event) override;
void mousePressEvent(QMouseEvent *event) override;
void mouseReleaseEvent(QMouseEvent *event) override;
private:
QImage myLogo;

View file

@ -12,8 +12,8 @@ class Gamepad : public Paddle
public:
Gamepad(const int index);
virtual bool getButton(int i) const;
virtual double getAxis(int i) const;
bool getButton(int i) const override;
double getAxis(int i) const override;
private:
std::shared_ptr<SDL_GameController> myController;

View file

@ -10,10 +10,10 @@ class SDLFrame : public CommonFrame
public:
SDLFrame(const EmulatorOptions & options);
virtual void VideoPresentScreen();
virtual void FrameRefreshStatus(int drawflags);
virtual int FrameMessageBox(LPCSTR lpText, LPCSTR lpCaption, UINT uType);
virtual void GetBitmap(LPCSTR lpBitmapName, LONG cb, LPVOID lpvBits);
void VideoPresentScreen() override;
void FrameRefreshStatus(int drawflags) override;
int FrameMessageBox(LPCSTR lpText, LPCSTR lpCaption, UINT uType) override;
void GetBitmap(LPCSTR lpBitmapName, LONG cb, LPVOID lpvBits) override;
void UpdateTexture();
void RenderPresent();

View file

@ -9,27 +9,27 @@ class CConfigNeedingRestart;
class CPropertySheet : public IPropertySheet
{
public:
virtual void Init(void);
virtual DWORD GetVolumeMax(void);
virtual bool SaveStateSelectImage(HWND hWindow, bool bSave);
virtual void ApplyNewConfig(const CConfigNeedingRestart& ConfigNew, const CConfigNeedingRestart& ConfigOld);
virtual void ConfigSaveApple2Type(eApple2Type apple2Type);
virtual UINT GetScrollLockToggle(void);
virtual void SetScrollLockToggle(UINT uValue);
virtual UINT GetJoystickCursorControl(void);
virtual void SetJoystickCursorControl(UINT uValue);
virtual UINT GetJoystickCenteringControl(void);
virtual void SetJoystickCenteringControl(UINT uValue);
virtual UINT GetAutofire(UINT uButton);
virtual void SetAutofire(UINT uValue);
virtual bool GetButtonsSwapState(void);
virtual void SetButtonsSwapState(bool value);
virtual UINT GetMouseShowCrosshair(void);
virtual void SetMouseShowCrosshair(UINT uValue);
virtual UINT GetMouseRestrictToWindow(void);
virtual void SetMouseRestrictToWindow(UINT uValue);
virtual UINT GetTheFreezesF8Rom(void);
virtual void SetTheFreezesF8Rom(UINT uValue);
void Init(void) override;
DWORD GetVolumeMax(void) override;
bool SaveStateSelectImage(HWND hWindow, bool bSave) override;
void ApplyNewConfig(const CConfigNeedingRestart& ConfigNew, const CConfigNeedingRestart& ConfigOld) override;
void ConfigSaveApple2Type(eApple2Type apple2Type) override;
UINT GetScrollLockToggle(void) override;
void SetScrollLockToggle(UINT uValue) override;
UINT GetJoystickCursorControl(void) override;
void SetJoystickCursorControl(UINT uValue) override;
UINT GetJoystickCenteringControl(void) override;
void SetJoystickCenteringControl(UINT uValue) override;
UINT GetAutofire(UINT uButton) override;
void SetAutofire(UINT uValue) override;
bool GetButtonsSwapState(void) override;
void SetButtonsSwapState(bool value) override;
UINT GetMouseShowCrosshair(void) override;
void SetMouseShowCrosshair(UINT uValue) override;
UINT GetMouseRestrictToWindow(void) override;
void SetMouseRestrictToWindow(UINT uValue) override;
UINT GetTheFreezesF8Rom(void) override;
void SetTheFreezesF8Rom(UINT uValue) override;
private:
CPropertySheetHelper m_PropertySheetHelper;
};

View file

@ -62,18 +62,6 @@ void LinuxFrame::Destroy()
GetVideo().Destroy(); // this resets the Video's FrameBuffer pointer
}
void LinuxFrame::ChooseMonochromeColor()
{
}
void LinuxFrame::Benchmark()
{
}
void LinuxFrame::DisplayLogo()
{
}
void LinuxFrame::ApplyVideoModeChange()
{
// this is similar to Win32Frame::ApplyVideoModeChange

View file

@ -7,28 +7,24 @@ class LinuxFrame : public FrameBase
{
public:
virtual void Initialize();
virtual void Destroy();
void Initialize() override;
void Destroy() override;
virtual void FrameDrawDiskLEDS();
virtual void FrameDrawDiskStatus();
virtual void FrameRefreshStatus(int drawflags);
virtual void FrameUpdateApple2Type();
virtual void FrameSetCursorPosByMousePos();
void FrameDrawDiskLEDS() override;
void FrameDrawDiskStatus() override;
void FrameRefreshStatus(int drawflags) override;
void FrameUpdateApple2Type() override;
void FrameSetCursorPosByMousePos() override;
virtual void SetFullScreenShowSubunitStatus(bool bShow);
virtual bool GetBestDisplayResolutionForFullScreen(UINT& bestWidth, UINT& bestHeight, UINT userSpecifiedHeight = 0);
virtual int SetViewportScale(int nNewScale, bool bForce = false);
virtual void SetAltEnterToggleFullScreen(bool mode);
void SetFullScreenShowSubunitStatus(bool bShow) override;
bool GetBestDisplayResolutionForFullScreen(UINT& bestWidth, UINT& bestHeight, UINT userSpecifiedHeight = 0) override;
int SetViewportScale(int nNewScale, bool bForce = false) override;
void SetAltEnterToggleFullScreen(bool mode) override;
virtual void SetLoadedSaveStateFlag(const bool bFlag);
void SetLoadedSaveStateFlag(const bool bFlag) override;
virtual void ChooseMonochromeColor();
virtual void Benchmark();
virtual void DisplayLogo();
virtual void Restart();
virtual void GetBitmap(LPCSTR lpBitmapName, LONG cb, LPVOID lpvBits);
void Restart() override;
void GetBitmap(LPCSTR lpBitmapName, LONG cb, LPVOID lpvBits) override;
void CycleVideoType();
void Cycle50ScanLines();

View file

@ -91,7 +91,7 @@ class IDirectSoundBuffer : public IUnknown
const size_t flags;
IDirectSoundBuffer(const size_t bufferSize, const size_t channels, const size_t sampleRate, const size_t bitsPerSample, const size_t flags);
virtual HRESULT Release();
HRESULT Release() override;
HRESULT QueryInterface(int riid, void **ppvObject);