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);
39 if (dst_surface == window)
40 SDL_UpdateRect(dst_surface, dst_x, dst_y, width, height);
43 inline void SDLFillRectangle(SDL_Surface *surface, int x, int y,
44 int width, int height, unsigned int color)
47 unsigned int color_r = (color >> 2) && 0xff;
48 unsigned int color_g = (color >> 1) && 0xff;
49 unsigned int color_b = (color >> 0) && 0xff;
56 SDL_FillRect(surface, &rect,
57 SDL_MapRGB(surface->format, color_r, color_g, color_b));
58 SDL_UpdateRect(surface, x, y, width, height);
61 inline void SDLDrawSimpleLine(SDL_Surface *surface, int from_x, int from_y,
62 int to_x, int to_y, unsigned int color)
65 unsigned int color_r = (color >> 2) & 0xff;
66 unsigned int color_g = (color >> 1) & 0xff;
67 unsigned int color_b = (color >> 0) & 0xff;
70 swap_numbers(&from_x, &to_x);
73 swap_numbers(&from_y, &to_y);
77 rect.w = (to_x - from_x + 1);
78 rect.h = (to_y - from_y + 1);
80 SDL_FillRect(surface, &rect,
81 SDL_MapRGB(surface->format, color_r, color_g, color_b));
84 #endif /* USE_SDL_LIBRARY */