[Scummvm-git-logs] scummvm master -> 60b43e4f5294a4aa38ce378b17ce14d020d4cc2d
sev-
noreply at scummvm.org
Tue Oct 18 22:29:05 UTC 2022
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
60b43e4f52 GRAPHICS: Add a mechanism to get the game and overlay display rects
Commit: 60b43e4f5294a4aa38ce378b17ce14d020d4cc2d
https://github.com/scummvm/scummvm/commit/60b43e4f5294a4aa38ce378b17ce14d020d4cc2d
Author: elasota (ejlasota at gmail.com)
Date: 2022-10-19T00:29:01+02:00
Commit Message:
GRAPHICS: Add a mechanism to get the game and overlay display rects
Changed paths:
backends/graphics/graphics.h
backends/graphics/null/null-graphics.h
backends/graphics/windowed.h
diff --git a/backends/graphics/graphics.h b/backends/graphics/graphics.h
index 761be9bdbe6..2bf9f0caac7 100644
--- a/backends/graphics/graphics.h
+++ b/backends/graphics/graphics.h
@@ -75,6 +75,7 @@ public:
virtual int16 getHeight() const = 0;
virtual int16 getWidth() const = 0;
+ virtual Common::Rect getScreenRect() const = 0;
virtual void setPalette(const byte *colors, uint start, uint num) = 0;
virtual void grabPalette(byte *colors, uint start, uint num) const = 0;
virtual void copyRectToScreen(const void *buf, int pitch, int x, int y, int w, int h) = 0;
@@ -95,6 +96,7 @@ public:
virtual void copyRectToOverlay(const void *buf, int pitch, int x, int y, int w, int h) = 0;
virtual int16 getOverlayHeight() const = 0;
virtual int16 getOverlayWidth() const = 0;
+ virtual Common::Rect getOverlayRect() const = 0;
virtual float getHiDPIScreenFactor() const { return 1.0f; }
virtual bool showMouse(bool visible) = 0;
diff --git a/backends/graphics/null/null-graphics.h b/backends/graphics/null/null-graphics.h
index 1fcdeec066a..9675a145fa6 100644
--- a/backends/graphics/null/null-graphics.h
+++ b/backends/graphics/null/null-graphics.h
@@ -60,6 +60,7 @@ public:
int16 getHeight() const override { return _height; }
int16 getWidth() const override { return _width; }
+ Common::Rect getScreenRect() const override { return Common::Rect(0, 0, _width, _height); }
void setPalette(const byte *colors, uint start, uint num) override {}
void grabPalette(byte *colors, uint start, uint num) const override {}
void copyRectToScreen(const void *buf, int pitch, int x, int y, int w, int h) override {}
@@ -80,6 +81,7 @@ public:
void copyRectToOverlay(const void *buf, int pitch, int x, int y, int w, int h) override {}
int16 getOverlayHeight() const override { return _height; }
int16 getOverlayWidth() const override { return _width; }
+ Common::Rect getOverlayRect() const override { return Common::Rect(0, 0, _width, _height); }
bool showMouse(bool visible) override { return !visible; }
void warpMouse(int x, int y) override {}
diff --git a/backends/graphics/windowed.h b/backends/graphics/windowed.h
index fc70bd7300c..1324a8468d0 100644
--- a/backends/graphics/windowed.h
+++ b/backends/graphics/windowed.h
@@ -53,6 +53,14 @@ public:
_cursorNeedsRedraw(false),
_cursorLastInActiveArea(true) {}
+ Common::Rect getScreenRect() const override {
+ return _gameDrawRect;
+ }
+
+ Common::Rect getOverlayRect() const override {
+ return _overlayDrawRect;
+ }
+
void showOverlay() override {
if (_overlayVisible)
return;
More information about the Scummvm-git-logs
mailing list