World of Might and Magic
0.2.0
Open reimplementation of Might and Magic 6 7 8 game engine
|
См. документацию.
46 #define SDL_ALPHA_OPAQUE 255
47 #define SDL_ALPHA_TRANSPARENT 0
117 #define SDL_DEFINE_PIXELFOURCC(A, B, C, D) SDL_FOURCC(A, B, C, D)
119 #define SDL_DEFINE_PIXELFORMAT(type, order, layout, bits, bytes) \
120 ((1 << 28) | ((type) << 24) | ((order) << 20) | ((layout) << 16) | \
121 ((bits) << 8) | ((bytes) << 0))
123 #define SDL_PIXELFLAG(X) (((X) >> 28) & 0x0F)
124 #define SDL_PIXELTYPE(X) (((X) >> 24) & 0x0F)
125 #define SDL_PIXELORDER(X) (((X) >> 20) & 0x0F)
126 #define SDL_PIXELLAYOUT(X) (((X) >> 16) & 0x0F)
127 #define SDL_BITSPERPIXEL(X) (((X) >> 8) & 0xFF)
128 #define SDL_BYTESPERPIXEL(X) \
129 (SDL_ISPIXELFORMAT_FOURCC(X) ? \
130 ((((X) == SDL_PIXELFORMAT_YUY2) || \
131 ((X) == SDL_PIXELFORMAT_UYVY) || \
132 ((X) == SDL_PIXELFORMAT_YVYU)) ? 2 : 1) : (((X) >> 0) & 0xFF))
134 #define SDL_ISPIXELFORMAT_INDEXED(format) \
135 (!SDL_ISPIXELFORMAT_FOURCC(format) && \
136 ((SDL_PIXELTYPE(format) == SDL_PIXELTYPE_INDEX1) || \
137 (SDL_PIXELTYPE(format) == SDL_PIXELTYPE_INDEX4) || \
138 (SDL_PIXELTYPE(format) == SDL_PIXELTYPE_INDEX8)))
140 #define SDL_ISPIXELFORMAT_PACKED(format) \
141 (!SDL_ISPIXELFORMAT_FOURCC(format) && \
142 ((SDL_PIXELTYPE(format) == SDL_PIXELTYPE_PACKED8) || \
143 (SDL_PIXELTYPE(format) == SDL_PIXELTYPE_PACKED16) || \
144 (SDL_PIXELTYPE(format) == SDL_PIXELTYPE_PACKED32)))
146 #define SDL_ISPIXELFORMAT_ARRAY(format) \
147 (!SDL_ISPIXELFORMAT_FOURCC(format) && \
148 ((SDL_PIXELTYPE(format) == SDL_PIXELTYPE_ARRAYU8) || \
149 (SDL_PIXELTYPE(format) == SDL_PIXELTYPE_ARRAYU16) || \
150 (SDL_PIXELTYPE(format) == SDL_PIXELTYPE_ARRAYU32) || \
151 (SDL_PIXELTYPE(format) == SDL_PIXELTYPE_ARRAYF16) || \
152 (SDL_PIXELTYPE(format) == SDL_PIXELTYPE_ARRAYF32)))
154 #define SDL_ISPIXELFORMAT_ALPHA(format) \
155 ((SDL_ISPIXELFORMAT_PACKED(format) && \
156 ((SDL_PIXELORDER(format) == SDL_PACKEDORDER_ARGB) || \
157 (SDL_PIXELORDER(format) == SDL_PACKEDORDER_RGBA) || \
158 (SDL_PIXELORDER(format) == SDL_PACKEDORDER_ABGR) || \
159 (SDL_PIXELORDER(format) == SDL_PACKEDORDER_BGRA))) || \
160 (SDL_ISPIXELFORMAT_ARRAY(format) && \
161 ((SDL_PIXELORDER(format) == SDL_ARRAYORDER_ARGB) || \
162 (SDL_PIXELORDER(format) == SDL_ARRAYORDER_RGBA) || \
163 (SDL_PIXELORDER(format) == SDL_ARRAYORDER_ABGR) || \
164 (SDL_PIXELORDER(format) == SDL_ARRAYORDER_BGRA))))
167 #define SDL_ISPIXELFORMAT_FOURCC(format) \
168 ((format) && (SDL_PIXELFLAG(format) != 1))
268 #if SDL_BYTEORDER == SDL_BIG_ENDIAN
281 SDL_DEFINE_PIXELFOURCC(
'Y',
'V',
'1',
'2'),
283 SDL_DEFINE_PIXELFOURCC(
'I',
'Y',
'U',
'V'),
285 SDL_DEFINE_PIXELFOURCC(
'Y',
'U',
'Y',
'2'),
287 SDL_DEFINE_PIXELFOURCC(
'U',
'Y',
'V',
'Y'),
289 SDL_DEFINE_PIXELFOURCC(
'Y',
'V',
'Y',
'U'),
291 SDL_DEFINE_PIXELFOURCC(
'N',
'V',
'1',
'2'),
293 SDL_DEFINE_PIXELFOURCC(
'N',
'V',
'2',
'1'),
295 SDL_DEFINE_PIXELFOURCC(
'O',
'E',
'S',
' ')
305 #define SDL_Colour SDL_Color
414 int firstcolor,
int ncolors);
DECLSPEC Uint32 SDLCALL SDL_MapRGBA(const SDL_PixelFormat *format, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
Maps an RGBA quadruple to a pixel value for a given pixel format.
DECLSPEC SDL_bool SDLCALL SDL_PixelFormatEnumToMasks(Uint32 format, int *bpp, Uint32 *Rmask, Uint32 *Gmask, Uint32 *Bmask, Uint32 *Amask)
Convert one of the enumerated pixel formats to a bpp and RGBA masks.
@ SDL_PIXELFORMAT_ARGB1555
@ SDL_PIXELFORMAT_BGRA4444
struct SDL_Palette SDL_Palette
@ SDL_PIXELFORMAT_INDEX1LSB
@ SDL_PIXELFORMAT_RGBX8888
DECLSPEC Uint32 SDLCALL SDL_MapRGB(const SDL_PixelFormat *format, Uint8 r, Uint8 g, Uint8 b)
Maps an RGB triple to an opaque pixel value for a given pixel format.
struct SDL_Color SDL_Color
DECLSPEC SDL_PixelFormat *SDLCALL SDL_AllocFormat(Uint32 pixel_format)
Create an SDL_PixelFormat structure from a pixel format enum.
@ SDL_PIXELFORMAT_EXTERNAL_OES
DECLSPEC void SDLCALL SDL_FreePalette(SDL_Palette *palette)
Free a palette created with SDL_AllocPalette().
@ SDL_PIXELFORMAT_BGRX8888
@ SDL_PACKEDLAYOUT_1010102
DECLSPEC void SDLCALL SDL_CalculateGammaRamp(float gamma, Uint16 *ramp)
Calculate a 256 entry gamma ramp for a gamma value.
DECLSPEC int SDLCALL SDL_SetPixelFormatPalette(SDL_PixelFormat *format, SDL_Palette *palette)
Set the palette for a pixel format structure.
DECLSPEC void SDLCALL SDL_GetRGB(Uint32 pixel, const SDL_PixelFormat *format, Uint8 *r, Uint8 *g, Uint8 *b)
Get the RGB components from a pixel of the specified format.
DECLSPEC void SDLCALL SDL_GetRGBA(Uint32 pixel, const SDL_PixelFormat *format, Uint8 *r, Uint8 *g, Uint8 *b, Uint8 *a)
Get the RGBA components from a pixel of the specified format.
const DECLSPEC char *SDLCALL SDL_GetPixelFormatName(Uint32 format)
Get the human readable name of a pixel format.
@ SDL_PIXELFORMAT_ARGB4444
@ SDL_PIXELFORMAT_RGBA5551
@ SDL_PIXELFORMAT_ARGB2101010
@ SDL_PIXELFORMAT_ABGR1555
@ SDL_PIXELFORMAT_ABGR4444
@ SDL_PIXELFORMAT_ARGB8888
@ SDL_PIXELFORMAT_RGBA4444
@ SDL_PIXELFORMAT_INDEX1MSB
DECLSPEC void SDLCALL SDL_FreeFormat(SDL_PixelFormat *format)
Free an SDL_PixelFormat structure.
@ SDL_PIXELFORMAT_INDEX4LSB
GLboolean GLboolean GLboolean b
GLdouble GLdouble GLdouble r
@ SDL_PIXELFORMAT_RGBA8888
DECLSPEC int SDLCALL SDL_SetPaletteColors(SDL_Palette *palette, const SDL_Color *colors, int firstcolor, int ncolors)
Set a range of colors in a palette.
@ SDL_PIXELFORMAT_UNKNOWN
@ SDL_PIXELFORMAT_BGRA5551
@ SDL_PIXELFORMAT_BGRA8888
GLboolean GLboolean GLboolean GLboolean a
@ SDL_PIXELFORMAT_INDEX4MSB
@ SDL_PACKEDLAYOUT_2101010
struct SDL_PixelFormat SDL_PixelFormat
DECLSPEC Uint32 SDLCALL SDL_MasksToPixelFormatEnum(int bpp, Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask)
Convert a bpp and RGBA masks to an enumerated pixel format.
@ SDL_PIXELFORMAT_ABGR8888
DECLSPEC SDL_Palette *SDLCALL SDL_AllocPalette(int ncolors)
Create a palette structure with the specified number of color entries.