aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/graphics/helpers.h
diff options
context:
space:
mode:
authorColin Snover2017-10-06 22:05:57 -0500
committerColin Snover2017-10-06 22:56:26 -0500
commitc7c5f28bdb2f393c1290bcac803cf9fc86ac8ed8 (patch)
treea58ee49fcb2271f8c399220d2946b47b648c7b4a /engines/sci/graphics/helpers.h
parentd53e7787391683830f57c77cc8acd87c50444d40 (diff)
downloadscummvm-rg350-c7c5f28bdb2f393c1290bcac803cf9fc86ac8ed8.tar.gz
scummvm-rg350-c7c5f28bdb2f393c1290bcac803cf9fc86ac8ed8.tar.bz2
scummvm-rg350-c7c5f28bdb2f393c1290bcac803cf9fc86ac8ed8.zip
SCI32: Clean up scriptWidth/scriptHeight/screenWidth/screenHeight
This removes the unnecessary Buffer subclass and stops most places where the output buffer was being interrogated about dimensions instead of GfxFrameout.
Diffstat (limited to 'engines/sci/graphics/helpers.h')
-rw-r--r--engines/sci/graphics/helpers.h37
1 files changed, 1 insertions, 36 deletions
diff --git a/engines/sci/graphics/helpers.h b/engines/sci/graphics/helpers.h
index 9d266fcf00..5842bf0887 100644
--- a/engines/sci/graphics/helpers.h
+++ b/engines/sci/graphics/helpers.h
@@ -225,42 +225,7 @@ inline int splitRects(Common::Rect r, const Common::Rect &other, Common::Rect(&o
return splitCount;
}
-struct Buffer : public Graphics::Surface {
- uint16 screenWidth;
- uint16 screenHeight;
- uint16 scriptWidth;
- uint16 scriptHeight;
-
- Buffer() :
- screenWidth(0),
- screenHeight(0),
- scriptWidth(320),
- scriptHeight(200) {}
-
- Buffer(const uint16 width, const uint16 height, uint8 *const pix) :
- screenWidth(width),
- screenHeight(height),
- scriptWidth(320),
- scriptHeight(200) {
- init(width, height, width, pix, Graphics::PixelFormat::createFormatCLUT8());
- }
-
- void clear(const uint8 value) {
- memset(pixels, value, w * h);
- }
-
- inline uint8 *getAddress(const uint16 x, const uint16 y) {
- return (uint8 *)getBasePtr(x, y);
- }
-
- inline uint8 *getAddressSimRes(const uint16 x, const uint16 y) {
- return (uint8*)pixels + (y * w * screenHeight / scriptHeight) + (x * screenWidth / scriptWidth);
- }
-
- bool isNull() {
- return pixels == nullptr;
- }
-};
+typedef Graphics::Surface Buffer;
#endif
struct Color {