kolibrios-fun/programs/games/pig/trunk/dirty.h
Yogev Ezra 7a91a704c5 Added sources of the following games: mario2, megamaze, MSquare, pig, soko.
git-svn-id: svn://kolibrios.org@1806 a494cfbc-eb01-0410-851d-a64ba20cac60
2011-01-30 11:17:50 +00:00

42 lines
1.2 KiB
C

/*
------------------------------------------------------------
Fixed Rate Pig - a fixed logic frame rate demo
------------------------------------------------------------
* Copyright (C) 2004 David Olofson <david@olofson.net>
*
* This software is released under the terms of the GPL.
*
* Contact author for permission if you want to use this
* software, or work derived from it, under other terms.
*/
#ifndef PIG_DIRTY_H
#define PIG_DIRTY_H
/* A table of dirtyrects for one display page */
typedef struct PIG_dirtytable
{
int size; /* Table size */
SDL_Rect *rects; /* Table of rects */
int count; /* # of rects currently used */
int best; /* Merge testing starts here! */
} PIG_dirtytable;
PIG_dirtytable *pig_dirty_open(int size);
void pig_dirty_close(PIG_dirtytable *pdt);
/* Add rectangle 'dr' to table 'pdt' */
void pig_dirty_add(PIG_dirtytable *pdt, SDL_Rect *dr);
/* Merge table 'from' into 'pdt' */
void pig_dirty_merge(PIG_dirtytable *pdt, PIG_dirtytable *from);
/* Extend 'to' to a new rect that includes both 'from' and 'to' */
void pig_mergerect(SDL_Rect *from, SDL_Rect *to);
/* Clip 'to' into a rect that is the intersection of 'from' and 'to' */
void pig_intersectrect(SDL_Rect *from, SDL_Rect *to);
#endif /* PIG_DIRTY_H */