Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
1806 | yogev_ezra | 1 | /* |
2 | ------------------------------------------------------------ |
||
3 | Fixed Rate Pig - a fixed logic frame rate demo |
||
4 | ------------------------------------------------------------ |
||
5 | * Copyright (C) 2004 David Olofson |
||
6 | * |
||
7 | * This software is released under the terms of the GPL. |
||
8 | * |
||
9 | * Contact author for permission if you want to use this |
||
10 | * software, or work derived from it, under other terms. |
||
11 | */ |
||
12 | |||
13 | #ifndef PIG_DIRTY_H |
||
14 | #define PIG_DIRTY_H |
||
15 | |||
16 | /* A table of dirtyrects for one display page */ |
||
17 | typedef struct PIG_dirtytable |
||
18 | { |
||
19 | int size; /* Table size */ |
||
20 | SDL_Rect *rects; /* Table of rects */ |
||
21 | int count; /* # of rects currently used */ |
||
22 | int best; /* Merge testing starts here! */ |
||
23 | } PIG_dirtytable; |
||
24 | |||
25 | |||
26 | PIG_dirtytable *pig_dirty_open(int size); |
||
27 | void pig_dirty_close(PIG_dirtytable *pdt); |
||
28 | |||
29 | /* Add rectangle 'dr' to table 'pdt' */ |
||
30 | void pig_dirty_add(PIG_dirtytable *pdt, SDL_Rect *dr); |
||
31 | |||
32 | /* Merge table 'from' into 'pdt' */ |
||
33 | void pig_dirty_merge(PIG_dirtytable *pdt, PIG_dirtytable *from); |
||
34 | |||
35 | /* Extend 'to' to a new rect that includes both 'from' and 'to' */ |
||
36 | void pig_mergerect(SDL_Rect *from, SDL_Rect *to); |
||
37 | |||
38 | /* Clip 'to' into a rect that is the intersection of 'from' and 'to' */ |
||
39 | void pig_intersectrect(SDL_Rect *from, SDL_Rect *to); |
||
40 | |||
41 | #endif /* PIG_DIRTY_H */ |