dst_rect.h = height;
SDL_BlitSurface(src_surface, &src_rect, dst_surface, &dst_rect);
-#if 1
- SDL_UpdateRect(dst_surface, dst_x, dst_y, width, height);
-#endif
+
+ if (dst_surface == window)
+ SDL_UpdateRect(dst_surface, dst_x, dst_y, width, height);
}
inline void SDLFillRectangle(SDL_Surface *surface, int x, int y,
int to_x, int to_y, unsigned int color)
{
SDL_Rect rect;
- unsigned int color_r = (color >> 2) && 0xff;
- unsigned int color_g = (color >> 1) && 0xff;
- unsigned int color_b = (color >> 0) && 0xff;
+ unsigned int color_r = (color >> 2) & 0xff;
+ unsigned int color_g = (color >> 1) & 0xff;
+ unsigned int color_b = (color >> 0) & 0xff;
if (from_x > to_x)
swap_numbers(&from_x, &to_x);