diff options
Diffstat (limited to 'engines/titanic/star_control/surface_area.h')
-rw-r--r-- | engines/titanic/star_control/surface_area.h | 14 |
1 files changed, 9 insertions, 5 deletions
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<typename T> + 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); |