Changeset - r12204:a49bd04a557a
[Not reviewed]
master
0 5 0
smatz - 15 years ago 2009-06-22 23:15:27
smatz@openttd.org
(svn r16628) -Codechange: remove one gcc2 hack
5 files changed with 16 insertions and 17 deletions:
0 comments (0 inline, 0 general)
src/blitter/32bpp_anim.cpp
Show inline comments
 
@@ -97,7 +97,7 @@ inline void Blitter_32bppAnim::Draw(cons
 
							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(cons
 
							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 {
src/blitter/32bpp_base.hpp
Show inline comments
 
@@ -41,7 +41,7 @@ public:
 
	 */
 
	static inline uint32 LookupColourInPalette(uint index)
 
	{
 
		return _cur_palette[index];
 
		return _cur_palette[index].data;
 
	}
 

	
 
	/**
src/blitter/32bpp_optimized.cpp
Show inline comments
 
@@ -110,7 +110,7 @@ inline void Blitter_32bppOptimized::Draw
 
							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
 
						/* 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;
src/gfx_type.h
Show inline comments
 
@@ -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 */
src/table/palettes.h
Show inline comments
 
@@ -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),
0 comments (0 inline, 0 general)