GRAPHICS: Use override and final keywords

This commit is contained in:
Cameron Cawley 2020-07-01 14:46:41 +01:00 committed by Filippos Karapetis
parent e50e010a9e
commit 6a6cdc2bce
9 changed files with 79 additions and 79 deletions

View File

@ -27,16 +27,16 @@
class DotMatrixPlugin : public ScalerPluginObject {
public:
DotMatrixPlugin();
virtual void initialize(const Graphics::PixelFormat &format);
virtual uint increaseFactor();
virtual uint decreaseFactor();
virtual bool canDrawCursor() const { return false; }
virtual uint extraPixels() const { return 0; }
virtual const char *getName() const;
virtual const char *getPrettyName() const;
virtual void initialize(const Graphics::PixelFormat &format) override;
virtual uint increaseFactor() override;
virtual uint decreaseFactor() override;
virtual bool canDrawCursor() const override { return false; }
virtual uint extraPixels() const override { return 0; }
virtual const char *getName() const override;
virtual const char *getPrettyName() const override;
protected:
virtual void scaleIntern(const uint8 *srcPtr, uint32 srcPitch,
uint8 *dstPtr, uint32 dstPitch, int width, int height, int x, int y);
uint8 *dstPtr, uint32 dstPitch, int width, int height, int x, int y) override;
private:
// Allocate enough for 32bpp formats
uint32 lookup[16];

View File

@ -28,21 +28,21 @@ class EdgePlugin : public SourceScaler {
public:
EdgePlugin();
virtual void initialize(const Graphics::PixelFormat &format);
virtual uint increaseFactor();
virtual uint decreaseFactor();
virtual bool canDrawCursor() const { return false; }
virtual bool useOldSource() const { return true; }
virtual uint extraPixels() const { return 1; }
virtual const char *getName() const;
virtual const char *getPrettyName() const;
virtual void initialize(const Graphics::PixelFormat &format) override;
virtual uint increaseFactor() override;
virtual uint decreaseFactor() override;
virtual bool canDrawCursor() const override { return false; }
virtual bool useOldSource() const override { return true; }
virtual uint extraPixels() const override { return 1; }
virtual const char *getName() const override;
virtual const char *getPrettyName() const override;
protected:
virtual void internScale(const uint8 *srcPtr, uint32 srcPitch,
uint8 *dstPtr, uint32 dstPitch,
const uint8 *oldSrcPtr, uint32 oldSrcPitch,
int width, int height, const uint8 *buffer, uint32 bufferPitch);
int width, int height, const uint8 *buffer, uint32 bufferPitch) override;
private:

View File

@ -27,17 +27,17 @@
class HQPlugin : public ScalerPluginObject {
public:
HQPlugin();
virtual void initialize(const Graphics::PixelFormat &format);
virtual void deinitialize();
virtual uint increaseFactor();
virtual uint decreaseFactor();
virtual bool canDrawCursor() const { return false; }
virtual uint extraPixels() const { return 1; }
virtual const char *getName() const;
virtual const char *getPrettyName() const;
virtual void initialize(const Graphics::PixelFormat &format) override;
virtual void deinitialize() override;
virtual uint increaseFactor() override;
virtual uint decreaseFactor() override;
virtual bool canDrawCursor() const override { return false; }
virtual uint extraPixels() const override { return 1; }
virtual const char *getName() const override;
virtual const char *getPrettyName() const override;
protected:
virtual void scaleIntern(const uint8 *srcPtr, uint32 srcPitch,
uint8 *dstPtr, uint32 dstPitch, int width, int height, int x, int y);
uint8 *dstPtr, uint32 dstPitch, int width, int height, int x, int y) override;
};

View File

@ -27,15 +27,15 @@
class NormalPlugin : public ScalerPluginObject {
public:
NormalPlugin();
virtual uint increaseFactor();
virtual uint decreaseFactor();
virtual bool canDrawCursor() const { return true; }
virtual uint extraPixels() const { return 0; }
virtual const char *getName() const;
virtual const char *getPrettyName() const;
virtual uint increaseFactor() override;
virtual uint decreaseFactor() override;
virtual bool canDrawCursor() const override { return true; }
virtual uint extraPixels() const override { return 0; }
virtual const char *getName() const override;
virtual const char *getPrettyName() const override;
protected:
virtual void scaleIntern(const uint8 *srcPtr, uint32 srcPitch,
uint8 *dstPtr, uint32 dstPitch, int width, int height, int x, int y);
uint8 *dstPtr, uint32 dstPitch, int width, int height, int x, int y) override;
};

View File

@ -28,13 +28,13 @@ class PMPlugin : public ScalerPluginObject {
public:
PMPlugin();
virtual void scaleIntern(const uint8 *srcPtr, uint32 srcPitch,
uint8 *dstPtr, uint32 dstPitch, int width, int height, int x, int y);
virtual uint increaseFactor();
virtual uint decreaseFactor();
virtual bool canDrawCursor() const { return false; }
virtual uint extraPixels() const { return 1; }
virtual const char *getName() const;
virtual const char *getPrettyName() const;
uint8 *dstPtr, uint32 dstPitch, int width, int height, int x, int y) override;
virtual uint increaseFactor() override;
virtual uint decreaseFactor() override;
virtual bool canDrawCursor() const override { return false; }
virtual uint extraPixels() const override { return 1; }
virtual const char *getName() const override;
virtual const char *getPrettyName() const override;
};
#endif

View File

@ -27,43 +27,43 @@
class SAIPlugin : public ScalerPluginObject {
public:
SAIPlugin();
virtual uint increaseFactor();
virtual uint decreaseFactor();
virtual bool canDrawCursor() const { return false; }
virtual uint extraPixels() const { return 2; }
virtual const char *getName() const;
virtual const char *getPrettyName() const;
virtual uint increaseFactor() override;
virtual uint decreaseFactor() override;
virtual bool canDrawCursor() const override { return false; }
virtual uint extraPixels() const override { return 2; }
virtual const char *getName() const override;
virtual const char *getPrettyName() const override;
protected:
virtual void scaleIntern(const uint8 *srcPtr, uint32 srcPitch,
uint8 *dstPtr, uint32 dstPitch, int width, int height, int x, int y);
uint8 *dstPtr, uint32 dstPitch, int width, int height, int x, int y) override;
};
class SuperSAIPlugin : public ScalerPluginObject {
public:
SuperSAIPlugin();
virtual uint increaseFactor();
virtual uint decreaseFactor();
virtual bool canDrawCursor() const { return false; }
virtual uint extraPixels() const { return 2; }
virtual const char *getName() const;
virtual const char *getPrettyName() const;
virtual uint increaseFactor() override;
virtual uint decreaseFactor() override;
virtual bool canDrawCursor() const override { return false; }
virtual uint extraPixels() const override { return 2; }
virtual const char *getName() const override;
virtual const char *getPrettyName() const override;
protected:
virtual void scaleIntern(const uint8 *srcPtr, uint32 srcPitch,
uint8 *dstPtr, uint32 dstPitch, int width, int height, int x, int y);
uint8 *dstPtr, uint32 dstPitch, int width, int height, int x, int y) override;
};
class SuperEaglePlugin : public ScalerPluginObject {
public:
SuperEaglePlugin();
virtual uint increaseFactor();
virtual uint decreaseFactor();
virtual bool canDrawCursor() const { return false; }
virtual uint extraPixels() const { return 2; }
virtual const char *getName() const;
virtual const char *getPrettyName() const;
virtual uint increaseFactor() override;
virtual uint decreaseFactor() override;
virtual bool canDrawCursor() const override { return false; }
virtual uint extraPixels() const override { return 2; }
virtual const char *getName() const override;
virtual const char *getPrettyName() const override;
protected:
virtual void scaleIntern(const uint8 *srcPtr, uint32 srcPitch,
uint8 *dstPtr, uint32 dstPitch, int width, int height, int x, int y);
uint8 *dstPtr, uint32 dstPitch, int width, int height, int x, int y) override;
};
#endif

View File

@ -45,13 +45,13 @@ class AdvMamePlugin : public ScalerPluginObject {
public:
AdvMamePlugin();
virtual void scaleIntern(const uint8 *srcPtr, uint32 srcPitch,
uint8 *dstPtr, uint32 dstPitch, int width, int height, int x, int y);
virtual uint increaseFactor();
virtual uint decreaseFactor();
virtual bool canDrawCursor() const { return true; }
virtual uint extraPixels() const { return 4; }
virtual const char *getName() const;
virtual const char *getPrettyName() const;
uint8 *dstPtr, uint32 dstPitch, int width, int height, int x, int y) override;
virtual uint increaseFactor() override;
virtual uint decreaseFactor() override;
virtual bool canDrawCursor() const override { return true; }
virtual uint extraPixels() const override { return 4; }
virtual const char *getName() const override;
virtual const char *getPrettyName() const override;
};
#endif

View File

@ -27,15 +27,15 @@
class TVPlugin : public ScalerPluginObject {
public:
TVPlugin();
virtual uint increaseFactor();
virtual uint decreaseFactor();
virtual bool canDrawCursor() const { return false; }
virtual uint extraPixels() const { return 0; }
virtual const char *getName() const;
virtual const char *getPrettyName() const;
virtual uint increaseFactor() override;
virtual uint decreaseFactor() override;
virtual bool canDrawCursor() const override { return false; }
virtual uint extraPixels() const override { return 0; }
virtual const char *getName() const override;
virtual const char *getPrettyName() const override;
private:
virtual void scaleIntern(const uint8 *srcPtr, uint32 srcPitch,
uint8 *dstPtr, uint32 dstPitch, int width, int height, int x, int y);
uint8 *dstPtr, uint32 dstPitch, int width, int height, int x, int y) override;
template<typename ColorMask>
void scaleIntern(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr,
uint32 dstPitch, int width, int height);

View File

@ -161,16 +161,16 @@ public:
SourceScaler();
virtual ~SourceScaler();
virtual void deinitialize();
virtual void deinitialize() override;
virtual void setSource(const byte *src, uint pitch, int width, int height, int padding);
virtual void setSource(const byte *src, uint pitch, int width, int height, int padding) final;
virtual void enableSource(bool enable) { _enable = enable; }
virtual void enableSource(bool enable) final { _enable = enable; }
protected:
virtual void scaleIntern(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr,
uint32 dstPitch, int width, int height, int x, int y);
uint32 dstPitch, int width, int height, int x, int y) final;
/**
* Scalers must implement this function. It will be called by oldSrcScale.