mirror of https://github.com/OpenTTD/OpenTTD
(svn r16628) -Codechange: remove one gcc2 hack
parent
4f0e62deb6
commit
d703f0c3b5
|
@ -97,7 +97,7 @@ inline void Blitter_32bppAnim::Draw(const Blitter::BlitterParams *bp, ZoomLevel
|
|||
uint m = *src_n;
|
||||
/* In case the m-channel is zero, do not remap this pixel in any way */
|
||||
if (m == 0) {
|
||||
*dst = *src_px;
|
||||
*dst = src_px->data;
|
||||
*anim = 0;
|
||||
} else {
|
||||
uint r = remap[m];
|
||||
|
@ -161,7 +161,7 @@ inline void Blitter_32bppAnim::Draw(const Blitter::BlitterParams *bp, ZoomLevel
|
|||
uint m = *src_n++;
|
||||
/* Above 217 (PALETTE_ANIM_SIZE_START) is palette animation */
|
||||
*anim++ = m;
|
||||
*dst++ = (m >= PALETTE_ANIM_SIZE_START) ? this->LookupColourInPalette(m) : *src_px;
|
||||
*dst++ = (m >= PALETTE_ANIM_SIZE_START) ? this->LookupColourInPalette(m) : src_px->data;
|
||||
src_px++;
|
||||
} while (--n != 0);
|
||||
} else {
|
||||
|
|
|
@ -41,7 +41,7 @@ public:
|
|||
*/
|
||||
static inline uint32 LookupColourInPalette(uint index)
|
||||
{
|
||||
return _cur_palette[index];
|
||||
return _cur_palette[index].data;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -110,7 +110,7 @@ inline void Blitter_32bppOptimized::Draw(const Blitter::BlitterParams *bp, ZoomL
|
|||
uint m = *src_n;
|
||||
/* In case the m-channel is zero, do not remap this pixel in any way */
|
||||
if (m == 0) {
|
||||
*dst = *src_px;
|
||||
*dst = src_px->data;
|
||||
} else {
|
||||
uint r = remap[m];
|
||||
if (r != 0) *dst = this->LookupColourInPalette(r);
|
||||
|
@ -162,7 +162,9 @@ inline void Blitter_32bppOptimized::Draw(const Blitter::BlitterParams *bp, ZoomL
|
|||
/* faster than memcpy(), n is usually low */
|
||||
src_n += n;
|
||||
do {
|
||||
*dst++ = *src_px++;
|
||||
*dst = src_px->data;
|
||||
dst++;
|
||||
src_px++;
|
||||
} while (--n != 0);
|
||||
} else {
|
||||
src_n += n;
|
||||
|
|
|
@ -138,14 +138,15 @@ struct DrawPixelInfo {
|
|||
};
|
||||
|
||||
/** Structure to access the alpha, red, green, and blue channels from a 32 bit number. */
|
||||
struct Colour {
|
||||
union Colour {
|
||||
uint32 data; ///< Conversion of the channel information to a 32 bit number.
|
||||
struct {
|
||||
#if TTD_ENDIAN == TTD_BIG_ENDIAN
|
||||
uint8 a, r, g, b; ///< colour channels in BE order
|
||||
uint8 a, r, g, b; ///< colour channels in BE order
|
||||
#else
|
||||
uint8 b, g, r, a; ///< colour channels in LE order
|
||||
uint8 b, g, r, a; ///< colour channels in LE order
|
||||
#endif /* TTD_ENDIAN == TTD_BIG_ENDIAN */
|
||||
|
||||
operator uint32 () const { return *(uint32 *)this; } ///< Conversion of the channel information to a 32 bit number.
|
||||
};
|
||||
};
|
||||
|
||||
/** Available font sizes */
|
||||
|
|
|
@ -4,16 +4,12 @@
|
|||
|
||||
#include "../core/endian_type.hpp"
|
||||
|
||||
#if TTD_ENDIAN == TTD_BIG_ENDIAN
|
||||
#define M(r, g, b) { 0xff, r, g, b }
|
||||
#else
|
||||
#define M(r, g, b) { b, g, r, 0xff }
|
||||
#endif /* TTD_ENDIAN == TTD_BIG_ENDIAN */
|
||||
#define M(r, g, b) { 0xff << 24 | (r) << 16 | (g) << 8 | (b) }
|
||||
|
||||
static const Colour _palettes[][256] = {
|
||||
/* palette 0 (mixed TTD DOS + TTD Windows palette */
|
||||
{
|
||||
{ 0, 0, 0, 0 }, M( 16, 16, 16), M( 32, 32, 32), M( 48, 48, 48),
|
||||
{ 0}, M( 16, 16, 16), M( 32, 32, 32), M( 48, 48, 48),
|
||||
M( 65, 64, 65), M( 82, 80, 82), M( 98, 101, 98), M(115, 117, 115),
|
||||
M(131, 133, 131), M(148, 149, 148), M(168, 168, 168), M(184, 184, 184),
|
||||
M(200, 200, 200), M(216, 216, 216), M(232, 232, 232), M(252, 252, 252),
|
||||
|
@ -81,7 +77,7 @@ static const Colour _palettes[][256] = {
|
|||
|
||||
/* palette 1 (TTD Windows) */
|
||||
{
|
||||
{ 0, 0, 0, 0 }, M(212, 0, 212), M(212, 0, 212), M(212, 0, 212),
|
||||
{ 0}, M(212, 0, 212), M(212, 0, 212), M(212, 0, 212),
|
||||
M(212, 0, 212), M(212, 0, 212), M(212, 0, 212), M(212, 0, 212),
|
||||
M(212, 0, 212), M(212, 0, 212), M(168, 168, 168), M(184, 184, 184),
|
||||
M(200, 200, 200), M(216, 216, 216), M(232, 232, 232), M(252, 252, 252),
|
||||
|
|
Loading…
Reference in New Issue