- sdl_rect.x = clipping_rect.x;
- sdl_rect.y = clipping_rect.y;
- sdl_rect.w = clipping_rect.width;
- sdl_rect.h = clipping_rect.height;
+ sdl_rect.x = gfx->clipping_rect.x;
+ sdl_rect.y = gfx->clipping_rect.y;
+ sdl_rect.w = gfx->clipping_recvoid fill_rect(const Rect &rect, int r, int g, int b)
+{
+ Rect drect = rect;
+ Rect screen_rect = get_screen_size();
+
+ if(drect.x < clipping_rect.x) {
+ drect.width -= clipping_rect.x - drect.x;
+ drect.x = clipping_rect.x;
+ }
+
+ if(drect.y < clipping_rect.y) {
+ drect.height -= clipping_rect.y - drect.y;
+ drect.y = clipping_rect.y;
+ }
+
+ if(drect.x + drect.width >= clipping_rect.x + clipping_rect.width) {
+ drect.width = clipping_rect.width + clipping_rect.x - drect.x;
+ }