summaryrefslogtreecommitdiff
path: root/src/video/cocoa/cocoa_v.h
diff options
context:
space:
mode:
authorMichael Lutz <michi@icosahedron.de>2021-02-20 19:01:45 +0100
committerMichael Lutz <michi@icosahedron.de>2021-02-20 21:14:44 +0100
commitf3c192c63d77de641c84fd2d808e11418b9c15fd (patch)
tree1a3fbb4a4ad96fc37a255d13cfd8c5425579a2fc /src/video/cocoa/cocoa_v.h
parent61275df7dafaca3a8c6c6d726ad399dd055263e3 (diff)
downloadopenttd-f3c192c63d77de641c84fd2d808e11418b9c15fd.tar.xz
Codechange: [OSX] Only keep a total dirty rect for drawing.
When drawing an 8bpp screen buffer, palette resolving was done for each dirty rectangle. In areas with high activity, this would mean a pixel might have been resolved multiple times. Also, if too many individual updates were queued, the whole screen would be refreshed, even if unnecessary. All other drivers only keep one overall dirty rect, so do it here as well.
Diffstat (limited to 'src/video/cocoa/cocoa_v.h')
-rw-r--r--src/video/cocoa/cocoa_v.h4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/video/cocoa/cocoa_v.h b/src/video/cocoa/cocoa_v.h
index 7e4d8c9fd..f9f678157 100644
--- a/src/video/cocoa/cocoa_v.h
+++ b/src/video/cocoa/cocoa_v.h
@@ -32,10 +32,8 @@ private:
void *pixel_buffer; ///< used for direct pixel access
void *window_buffer; ///< Colour translation from palette to screen
- static const int MAX_DIRTY_RECTS = 100;
+ Rect dirty_rect; ///< Region of the screen that needs redrawing.
- Rect dirty_rects[MAX_DIRTY_RECTS]; ///< dirty rectangles
- uint num_dirty_rects; ///< Number of dirty rectangles
uint32 palette[256]; ///< Colour Palette
public: