Mercurial > hg > dmlib
comparison dmlib.h @ 90:1ab3fd8b9afc
Move some very tiny gfx functions to the dmlib header as static inline ones.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Tue, 02 Oct 2012 16:37:58 +0300 |
parents | f28cd66356f6 |
children | 0430f484641b |
comparison
equal
deleted
inserted
replaced
89:b10884934aca | 90:1ab3fd8b9afc |
---|---|
242 #ifdef DM_GFX_MISC | 242 #ifdef DM_GFX_MISC |
243 void dmFillRect(SDL_Surface *screen, int x0, int y0, int x1, int y1, const Uint32 col); | 243 void dmFillRect(SDL_Surface *screen, int x0, int y0, int x1, int y1, const Uint32 col); |
244 void dmDrawHLine(SDL_Surface *screen, int x0, int x1, int yc, const Uint32 col); | 244 void dmDrawHLine(SDL_Surface *screen, int x0, int x1, int yc, const Uint32 col); |
245 void dmDrawVLine(SDL_Surface *screen, int y0, int y1, int xc, const Uint32 col); | 245 void dmDrawVLine(SDL_Surface *screen, int y0, int y1, int xc, const Uint32 col); |
246 void dmDrawBox3D(SDL_Surface *screen, int x0, int y0, int x1, int y1, Uint32 bgcol, Uint32 ucol, Uint32 dcol); | 246 void dmDrawBox3D(SDL_Surface *screen, int x0, int y0, int x1, int y1, Uint32 bgcol, Uint32 ucol, Uint32 dcol); |
247 void dmClearSurface(SDL_Surface *screen, const Uint32 col); | 247 |
248 Uint32 dmMapRGB(SDL_Surface *screen, int r, int g, int b); | 248 static inline void dmClearSurface(SDL_Surface *screen, const Uint32 col) |
249 Uint32 dmMapRGBA(SDL_Surface *screen, int r, int g, int b, int a); | 249 { |
250 int dmDirectBlitSurface(SDL_Surface *bmp, SDL_Surface *screen); | 250 SDL_FillRect(screen, NULL, col); |
251 } | |
252 | |
253 | |
254 static inline Uint32 dmMapRGB(SDL_Surface *screen, int r, int g, int b) | |
255 { | |
256 return SDL_MapRGB(screen->format, r, g, b); | |
257 } | |
258 | |
259 | |
260 static inline Uint32 dmMapRGBA(SDL_Surface *screen, int r, int g, int b, int a) | |
261 { | |
262 return SDL_MapRGBA(screen->format, r, g, b, a); | |
263 } | |
264 | |
265 | |
266 static inline int dmDirectBlitSurface(SDL_Surface *bmp, SDL_Surface *screen) | |
267 { | |
268 return SDL_BlitSurface(bmp, NULL, screen, NULL); | |
269 } | |
251 #endif | 270 #endif |
252 | 271 |
253 | 272 |
254 /* Global variables | 273 /* Global variables |
255 */ | 274 */ |