From eb2ce9c759d03b6e71c9888d9a471a67593d4024 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Tue, 30 May 2017 17:24:06 -0400 Subject: TITANIC: Implement CSurfaceArea drawLine --- engines/titanic/star_control/surface_area.h | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'engines/titanic/star_control/surface_area.h') diff --git a/engines/titanic/star_control/surface_area.h b/engines/titanic/star_control/surface_area.h index a7065f0cdd..07aae36205 100644 --- a/engines/titanic/star_control/surface_area.h +++ b/engines/titanic/star_control/surface_area.h @@ -35,6 +35,14 @@ enum SurfaceAreaMode { }; class CSurfaceArea { + template + static void plotPoint(int x, int y, int color, void *data) { + CSurfaceArea *sa = (CSurfaceArea *)data; + if (x >= 0 && x < sa->_width && y >= 0 && y < sa->_height) { + T *ptr = (T *)sa->_surface->getBasePtr(x, y); + *ptr = (*ptr & sa->_colorMask) ^ sa->_color; + } + } private: /** * Initialize data for the class @@ -47,11 +55,6 @@ private: void setColor(uint rgb); void pixelToRGB(uint pixel, uint *rgb); - - /** - * Alters the pixels of a specified line using a passed and and xor mask - */ - static void drawLine(Graphics::Surface &s, const Common::Rect &r, uint andMask, uint xorMask); public: int _field0; int _width; @@ -71,6 +74,7 @@ public: uint _color; SurfaceAreaMode _mode; Rect _bounds; + Graphics::Surface *_surface; public: CSurfaceArea(CVideoSurface *surface); -- cgit v1.2.3