#include "draw.h" #include "util.h" static xenon_rect current_rect; void damage_add(xenon_rect* region) { int xmin = min(current_rect.x, region->x); int xmax = max(current_rect.x + current_rect.w, region->x + region->w); int ymin = min(current_rect.y, region->y); int ymax = max(current_rect.y + current_rect.h, region->y + region->h); current_rect.x = xmin; current_rect.w = xmax - xmin; current_rect.y = ymin; current_rect.h = ymax - ymin; } void damage_clear() { current_rect.x = 0; current_rect.y = 0; current_rect.w = 0; current_rect.h = 0; } xenon_rect damage_current() { return current_rect; }