Import coco-planes 0.1.0 upstream source snapshot

Original author: Pierre Sarrazin. Preserve upstream GPLv3-or-later and file-specific notices.
Source: http://sarrazip.com/dev/coco-planes-0.1.0.tar.gz
Archive SHA-256: 29191e6ba225965caa637ee726e1189639dc7fcdf2b68310fb93fbffd56c9c52
This commit is contained in:
Brian Holman committed 2026-11-09 23:39:59 -07:00
commit 7939132267
78 files changed
+6990

No files matched your search

+64
View File
@@ -0,0 +1,64 @@
/* DirtyRectList.h
Copyright (C) 2026 Pierre Sarrazin <http://sarrazip.com/>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef _H_DirtyRectList
#define _H_DirtyRectList
#include "DirtyRect.h"
enum
{
DirtyRectList_MAX_DIRTY_RECTS = 24, // must be <= 255
};
typedef struct DirtyRectList
{
byte count;
byte peak;
DirtyRect rects[DirtyRectList_MAX_DIRTY_RECTS];
} DirtyRectList;
void DirtyRectList_init(DirtyRectList *self);
// Remembers that the rectangle whose top-left byte is 'addr'
// is now "dirty" in the given "dirty list", which is supposed to
// correspond with the current screen page.
//
// Each dirty rectangle is DirtyRect_WIDTH bytes wide.
//
// numRows: Number of pixel rows of the dirty rectangle (must NOT be zero).
//
// Returns FALSE if there is no room for the new dirty rectangle
// in 'dirtyList' (re: DirtyRectList_MAX_DIRTY_RECTS).
//
// Increments the count field in the given dirty list.
// Updates self->peak if NDEBUG is not defined.
//
BOOL DirtyRectList_add(DirtyRectList *self, byte *addr, byte numRows);
// Calls DirtyRect_clean() for every dirty rectangle in the list,
// then clears that list.
//
void DirtyRectList_clean(DirtyRectList *self);
#endif /* _H_DirtyRectList */