blob: 5ad38eda882721ff91f43f1285f7ae76daed4e5e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
#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;
}
|