diff options
-rw-r--r-- | engines/cine/pal.cpp | 6 | ||||
-rw-r--r-- | engines/cine/pal.h | 7 |
2 files changed, 8 insertions, 5 deletions
diff --git a/engines/cine/pal.cpp b/engines/cine/pal.cpp index 3602187352..88b7f9ef6d 100644 --- a/engines/cine/pal.cpp +++ b/engines/cine/pal.cpp @@ -244,7 +244,7 @@ Palette &Palette::saturatedAddColor(Palette &output, byte firstIndex, byte lastI // For more information about this gcc specific problem, you can read up on the following bug // report: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36043 const Color src = _colors[i]; - output._colors[i] = saturatedAddColor(src, r, g, b); + saturatedAddColor(output._colors[i], src, r, g, b); } return output; @@ -269,12 +269,10 @@ Palette &Palette::saturatedAddNormalizedGray(Palette &output, byte firstIndex, b } // a.k.a. transformColor -Palette::Color &Palette::saturatedAddColor(Color baseColor, signed r, signed g, signed b) const { - Cine::Palette::Color result; +void Palette::saturatedAddColor(Color &result, Color baseColor, signed r, signed g, signed b) const { result.r = CLIP<int>(baseColor.r + r, 0, _format.rMax()); result.g = CLIP<int>(baseColor.g + g, 0, _format.gMax()); result.b = CLIP<int>(baseColor.b + b, 0, _format.bMax()); - return result; } Palette::Palette(const Graphics::PixelFormat format, const uint numColors) : _format(format), _colors() { diff --git a/engines/cine/pal.h b/engines/cine/pal.h index 57dbea5d62..c8c1ad62a5 100644 --- a/engines/cine/pal.h +++ b/engines/cine/pal.h @@ -186,7 +186,12 @@ public: private: void setColorFormat(const Graphics::PixelFormat format); - Color &saturatedAddColor(Color baseColor, signed r, signed g, signed b) const; + + // WORKAROUND: Using a reference to a result here instead of returning an Color object. + // This is needed because when using a Color as return value, this would crash Chrilith's + // compiler for PalmOS. + // TODO: Add more information about the compiler. + void saturatedAddColor(Color &result, Color baseColor, signed r, signed g, signed b) const; private: Graphics::PixelFormat _format; ///< The used source color format |