[Scummvm-cvs-logs] SF.net SVN: scummvm:[47771] scummvm/trunk/engines/cine

Chris Apers changes at chrilith.com
Sun Jan 31 20:04:16 CET 2010


Hi LordHoto,

This workaround does the trick thanks :)

Le 31 janv. 2010 à 19:29, lordhoto at users.sourceforge.net a écrit :

> Revision: 47771
>          http://scummvm.svn.sourceforge.net/scummvm/? 
> rev=47771&view=rev
> Author:   lordhoto
> Date:     2010-01-31 18:29:54 +0000 (Sun, 31 Jan 2010)
>
> Log Message:
> -----------
> Fix return of a reference to a temporary object introduced with  
> r47766. (Hopefully this "workaround" will work also for Chrilith's  
> compiler ;-).
>
> Modified Paths:
> --------------
>    scummvm/trunk/engines/cine/pal.cpp
>    scummvm/trunk/engines/cine/pal.h
>
> Modified: scummvm/trunk/engines/cine/pal.cpp
> ===================================================================
> --- scummvm/trunk/engines/cine/pal.cpp    2010-01-31 18:24:49 UTC  
> (rev 47770)
> +++ scummvm/trunk/engines/cine/pal.cpp    2010-01-31 18:29:54 UTC  
> (rev 47771)
> @@ -244,7 +244,7 @@
>        // 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 @@
> }
>
> // 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() {
>
> Modified: scummvm/trunk/engines/cine/pal.h
> ===================================================================
> --- scummvm/trunk/engines/cine/pal.h    2010-01-31 18:24:49 UTC (rev  
> 47770)
> +++ scummvm/trunk/engines/cine/pal.h    2010-01-31 18:29:54 UTC (rev  
> 47771)
> @@ -186,8 +186,13 @@
>
> 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
>    Common::Array<Color> _colors;  ///< The actual palette data
>
>
> This was sent by the SourceForge.net collaborative development  
> platform, the world's largest Open Source development site.
>
> --- 
> --- 
> --- 
> ---------------------------------------------------------------------
> The Planet: dedicated and managed hosting, cloud storage, colocation
> Stay online with enterprise data centers and the best network in the  
> business
> Choose flexible plans and management services without long-term  
> contracts
> Personal 24x7 support from experience hosting pros just a phone call  
> away.
> http://p.sf.net/sfu/theplanet-com
> _______________________________________________
> Scummvm-cvs-logs mailing list
> Scummvm-cvs-logs at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/scummvm-cvs-logs




More information about the Scummvm-git-logs mailing list