diff options
Diffstat (limited to 'scumm/smush/color.cpp')
-rw-r--r-- | scumm/smush/color.cpp | 36 |
1 files changed, 2 insertions, 34 deletions
diff --git a/scumm/smush/color.cpp b/scumm/smush/color.cpp index e88785ccbd..54a06df3e1 100644 --- a/scumm/smush/color.cpp +++ b/scumm/smush/color.cpp @@ -22,48 +22,16 @@ #include <stdafx.h> #include "color.h" -Color::Color() : _r(0), _g(0), _b(0) { -} - -Color::Color(value_type r, value_type g, value_type b) : _r(r), _g(g), _b(b) { -} - -Color::Color(const Color & c) : _r(c._r), _g(c._g), _b(c._b) { -} - -Color & Color::operator=(const Color & c) { - _r = c._r; - _g = c._g; - _b = c._b; - return *this; -} - -Color::~Color() { -} - -Color::value_type Color::red() const { - return _r; -} - -Color::value_type Color::green() const { - return _g; -} - -Color::value_type Color::blue() const { - return _b; -} +#define UPDATE_COLOR(c, inc) (((int)((c)) << 7) + (c) + (inc)) >> 7 +#define CHECK_BOUNDS(c) (((c) > 255) ? 255 : (((c) < 0) ? 0 : (c))) void Color::delta(short * ptr) { // This is a very specific method for XPALs. int t; -#define UPDATE_COLOR(c, inc) (((int)((c)) << 7) + (c) + (inc)) >> 7 -#define CHECK_BOUNDS(c) (((c) > 255) ? 255 : (((c) < 0) ? 0 : (c))) t = UPDATE_COLOR(_r, ptr[0]); _r = CHECK_BOUNDS(t); t = UPDATE_COLOR(_g, ptr[1]); _g = CHECK_BOUNDS(t); t = UPDATE_COLOR(_b, ptr[2]); _b = CHECK_BOUNDS(t); -#undef UPDATE_COLOR -#undef CHECK_BOUNDS } |