diff options
author | Paul Gilbert | 2017-05-30 17:24:06 -0400 |
---|---|---|
committer | Paul Gilbert | 2017-05-30 17:24:06 -0400 |
commit | eb2ce9c759d03b6e71c9888d9a471a67593d4024 (patch) | |
tree | 470e4d2055565d1864ba170ec7a841d11610ef2f /engines/titanic/star_control/surface_area.h | |
parent | 98ad7ca3556ddbac3067c68940add964b371157b (diff) | |
download | scummvm-rg350-eb2ce9c759d03b6e71c9888d9a471a67593d4024.tar.gz scummvm-rg350-eb2ce9c759d03b6e71c9888d9a471a67593d4024.tar.bz2 scummvm-rg350-eb2ce9c759d03b6e71c9888d9a471a67593d4024.zip |
TITANIC: Implement CSurfaceArea drawLine
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); |