Biadapt fix for 24bpp, some minor bilinear optimizations

git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@506 8092fc87-c524-0410-9efc-e669fe64eaf9
This commit is contained in:
gewlitys
2002-12-30 20:08:26 +00:00
parent 8af4655064
commit 2de1fc1023
+9 -4
View File
@@ -26,7 +26,7 @@ static SDL_Surface *fade_white;
static SDL_Surface *fade_temp;
static int gfx_flags;
static const UBYTE bilinear_table[4][4] =
static const Uint32 bilinear_table[4][4] =
{
{ 9, 3, 3, 1 },
{ 3, 1, 9, 3 },
@@ -39,7 +39,7 @@ typedef union
struct
{
Uint8 c1, c2, c3;
};
} bchan;
Uint8 channels[3];
} PIXEL_24BIT;
@@ -52,6 +52,11 @@ typedef union
// are not at the beginning of the buffer and can read 1 byte
// before (p)
//
// WARNING!! Do not call these macros like so:
// SET_PIX_24BIT (dst_p++, pixel)
// The pre-increment or post-increment will be done
// several times
//
# define GET_PIX_24BIT(p) \
( ((Uint32)(p)) & 3 ? \
(*(Uint32 *)((Uint8 *)(p) - 1) & 0x00ffffff) : \
@@ -87,7 +92,7 @@ typedef union
) : \
( *(Uint32 *)(p) = \
(*(Uint32 *)(p) & 0xff000000) | \
((c) && 0x00ffffff) \
((c) & 0x00ffffff) \
) \
)
#endif
@@ -742,7 +747,7 @@ static void Scale_BilinearFilter (SDL_Surface *src, SDL_Surface *dst)
{
Uint16 *src_p = (Uint16 *) src->pixels, *src_p2;
Uint16 *dst_p = (Uint16 *) dst->pixels;
Uint16 p[4];
Uint32 p[4];
for (y = 0; y < h; ++y)
{