00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef sge_surface_H
00019 #define sge_surface_H
00020
00021 #include "SDL.h"
00022 #include "sge_internal.h"
00023
00024
00025
00026
00027
00028 #define sge_copy_sblock8 sge_write_block8
00029 #define sge_copy_sblock16 sge_write_block16
00030 #define sge_copy_sblock32 sge_write_block32
00031 #define sge_get_sblock8 sge_read_block8
00032 #define sge_get_sblock16 sge_read_block16
00033 #define sge_get_sblock32 sge_read_block32
00034
00035
00036 #ifdef _SGE_C
00037 extern "C" {
00038 #endif
00039 DECLSPEC void sge_Update_OFF(void);
00040 DECLSPEC void sge_Update_ON(void);
00041 DECLSPEC void sge_Lock_OFF(void);
00042 DECLSPEC void sge_Lock_ON(void);
00043 DECLSPEC Uint8 sge_getUpdate(void);
00044 DECLSPEC Uint8 sge_getLock(void);
00045 DECLSPEC void sge_UpdateRect(SDL_Surface *screen, Sint16 x, Sint16 y, Uint16 w, Uint16 h);
00046 DECLSPEC SDL_Surface *sge_CreateAlphaSurface(Uint32 flags, int width, int height);
00047 DECLSPEC Uint32 sge_MapAlpha(Uint8 R, Uint8 G, Uint8 B, Uint8 A);
00048 DECLSPEC void sge_SetError(const char *format, ...);
00049
00050 DECLSPEC void _PutPixel(SDL_Surface *surface, Sint16 x, Sint16 y, Uint32 color);
00051 DECLSPEC void _PutPixel8(SDL_Surface *surface, Sint16 x, Sint16 y, Uint32 color);
00052 DECLSPEC void _PutPixel16(SDL_Surface *surface, Sint16 x, Sint16 y, Uint32 color);
00053 DECLSPEC void _PutPixel24(SDL_Surface *surface, Sint16 x, Sint16 y, Uint32 color);
00054 DECLSPEC void _PutPixel32(SDL_Surface *surface, Sint16 x, Sint16 y, Uint32 color);
00055 DECLSPEC void _PutPixelX(SDL_Surface *dest,Sint16 x,Sint16 y,Uint32 color);
00056
00057 DECLSPEC Sint32 sge_CalcYPitch(SDL_Surface *dest,Sint16 y);
00058 DECLSPEC void sge_pPutPixel(SDL_Surface *surface, Sint16 x, Sint32 ypitch, Uint32 color);
00059
00060 DECLSPEC void sge_PutPixel(SDL_Surface *surface, Sint16 x, Sint16 y, Uint32 color);
00061 DECLSPEC Uint32 sge_GetPixel(SDL_Surface *surface, Sint16 x, Sint16 y);
00062
00063 DECLSPEC void _PutPixelAlpha(SDL_Surface *surface, Sint16 x, Sint16 y, Uint32 color, Uint8 alpha);
00064 DECLSPEC void sge_PutPixelAlpha(SDL_Surface *surface, Sint16 x, Sint16 y, Uint32 color, Uint8 alpha);
00065
00066 DECLSPEC void sge_write_block8(SDL_Surface *Surface, Uint8 *block, Sint16 y);
00067 DECLSPEC void sge_write_block16(SDL_Surface *Surface, Uint16 *block, Sint16 y);
00068 DECLSPEC void sge_write_block32(SDL_Surface *Surface, Uint32 *block, Sint16 y);
00069 DECLSPEC void sge_read_block8(SDL_Surface *Surface, Uint8 *block, Sint16 y);
00070 DECLSPEC void sge_read_block16(SDL_Surface *Surface, Uint16 *block, Sint16 y);
00071 DECLSPEC void sge_read_block32(SDL_Surface *Surface, Uint32 *block, Sint16 y);
00072
00073 DECLSPEC void sge_ClearSurface(SDL_Surface *Surface, Uint32 color);
00074 DECLSPEC int sge_BlitTransparent(SDL_Surface *Src, SDL_Surface *Dest, Sint16 SrcX, Sint16 SrcY, Sint16 DestX, Sint16 DestY, Sint16 W, Sint16 H, Uint32 Clear, Uint8 Alpha);
00075 DECLSPEC int sge_Blit(SDL_Surface *Src, SDL_Surface *Dest, Sint16 SrcX, Sint16 SrcY, Sint16 DestX, Sint16 DestY, Sint16 W, Sint16 H);
00076 DECLSPEC SDL_Surface *sge_copy_surface(SDL_Surface *src);
00077 DECLSPEC SDL_Surface *sge_copy_surface(SDL_Surface *src, Sint16 SrcX, Sint16 SrcY, Sint16 W, Sint16 H);
00078
00079 DECLSPEC SDL_Color sge_GetRGB(SDL_Surface *Surface, Uint32 Color);
00080 DECLSPEC SDL_Color sge_FillPaletteEntry (Uint8 R, Uint8 G, Uint8 B);
00081 DECLSPEC void sge_Fader(SDL_Surface *Surface, Uint8 sR,Uint8 sG,Uint8 sB, Uint8 dR,Uint8 dG,Uint8 dB,Uint32 *ctab,int start, int stop);
00082 DECLSPEC void sge_AlphaFader(Uint8 sR,Uint8 sG,Uint8 sB,Uint8 sA, Uint8 dR,Uint8 dG,Uint8 dB,Uint8 dA, Uint32 *ctab,int start, int stop);
00083 DECLSPEC void sge_SetupRainbowPalette(SDL_Surface *Surface,Uint32 *ctab,int intensity, int start, int stop);
00084 DECLSPEC void sge_SetupBWPalette(SDL_Surface *Surface,Uint32 *ctab,int start, int stop);
00085 #ifdef _SGE_C
00086 }
00087 #endif
00088
00089 #ifndef sge_C_ONLY
00090 DECLSPEC void _PutPixel(SDL_Surface *screen, Sint16 x, Sint16 y, Uint8 R, Uint8 G, Uint8 B);
00091 DECLSPEC void sge_PutPixel(SDL_Surface *screen, Sint16 x, Sint16 y, Uint8 R, Uint8 G, Uint8 B);
00092 DECLSPEC void _PutPixelAlpha(SDL_Surface *surface, Sint16 x, Sint16 y, Uint8 R, Uint8 G, Uint8 B, Uint8 alpha);
00093 DECLSPEC void sge_PutPixelAlpha(SDL_Surface *surface, Sint16 x, Sint16 y, Uint8 R, Uint8 G, Uint8 B, Uint8 alpha);
00094 DECLSPEC void sge_ClearSurface(SDL_Surface *Surface, Uint8 R, Uint8 G, Uint8 B);
00095 #endif
00096
00097
00098 #endif