From c7c5f28bdb2f393c1290bcac803cf9fc86ac8ed8 Mon Sep 17 00:00:00 2001 From: Colin Snover Date: Fri, 6 Oct 2017 22:05:57 -0500 Subject: 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. --- engines/sci/graphics/helpers.h | 37 +------------------------------------ 1 file changed, 1 insertion(+), 36 deletions(-) (limited to 'engines/sci/graphics/helpers.h') 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 { -- cgit v1.2.3