1 /***********************************************************
2 * Rocks'n'Diamonds -- McDuffin Strikes Back! *
3 *----------------------------------------------------------*
4 * ©1995 Artsoft Development *
6 * 33659 Bielefeld-Senne *
7 * Telefon: (0521) 493245 *
8 * eMail: aeglos@valinor.owl.de *
9 * aeglos@uni-paderborn.de *
10 * q99492@pbhrzx.uni-paderborn.de *
11 *----------------------------------------------------------*
13 ***********************************************************/
15 #ifdef USE_SDL_LIBRARY
20 inline void SDLCopyArea(SDL_Surface *src_surface, SDL_Surface *dst_surface,
22 int width, int height,
25 SDL_Rect src_rect, dst_rect;
37 SDL_BlitSurface(src_surface, &src_rect, dst_surface, &dst_rect);
38 SDL_UpdateRect(dst_surface, dst_x, dst_y, width, height);
41 inline void SDLFillRectangle(SDL_Surface *surface, int x, int y,
42 int width, int height, unsigned int color)
45 unsigned int color_r = (color >> 2) && 0xff;
46 unsigned int color_g = (color >> 1) && 0xff;
47 unsigned int color_b = (color >> 0) && 0xff;
54 SDL_FillRect(surface, &rect,
55 SDL_MapRGB(surface->format, color_r, color_g, color_b));
58 inline void SDLDrawSimpleLine(SDL_Surface *surface, int from_x, int from_y,
59 int to_x, int to_y, unsigned int color)
62 unsigned int color_r = (color >> 2) && 0xff;
63 unsigned int color_g = (color >> 1) && 0xff;
64 unsigned int color_b = (color >> 0) && 0xff;
67 swap_numbers(&from_x, &to_x);
70 swap_numbers(&from_y, &to_y);
74 rect.w = (to_x - from_x + 1);
75 rect.h = (to_y - from_y + 1);
77 SDL_FillRect(surface, &rect,
78 SDL_MapRGB(surface->format, color_r, color_g, color_b));
81 #endif /* USE_SDL_LIBRARY */