Codechange: be consistent in naming the paint function Paint()

Also move this function to be a class member. This to allow
further deduplicating of code in a later commit.
This commit is contained in:
Patric Stout
2021-02-20 11:08:20 +01:00
committed by Patric Stout
parent 761efbb457
commit 790fa7102e
11 changed files with 58 additions and 23 deletions

View File

@@ -75,6 +75,7 @@ protected:
Dimension GetScreenSize() const override;
float GetDPIScale() override;
void InputLoop() override;
void Paint() override;
private:
bool PollEvent();
@@ -89,7 +90,6 @@ private:
void UpdatePalette(uint first_color, uint num_colors);
void CheckPaletteAnim();
void Draw(bool force_update = false);
void BlitIndexedToView32(int left, int top, int right, int bottom);
};

View File

@@ -465,10 +465,10 @@ void VideoDriver_Cocoa::BlitIndexedToView32(int left, int top, int right, int bo
}
/**
* Draw window.
* Paint window.
* @param force_update Whether to redraw unconditionally
*/
void VideoDriver_Cocoa::Draw(bool force_update)
void VideoDriver_Cocoa::Paint()
{
PerformanceMeasurer framerate(PFE_VIDEO);
@@ -502,9 +502,8 @@ void VideoDriver_Cocoa::Draw(bool force_update)
dirtyrect.size.height = this->dirty_rects[i].bottom - this->dirty_rects[i].top;
/* Normally drawRect will be automatically called by Mac OS X during next update cycle,
* and then blitting will occur. If force_update is true, it will be done right now. */
* and then blitting will occur. */
[ this->cocoaview setNeedsDisplayInRect:[ this->cocoaview getVirtualRect:dirtyrect ] ];
if (force_update) [ this->cocoaview displayIfNeeded ];
}
this->num_dirty_rects = 0;
@@ -708,7 +707,7 @@ void VideoDriver_Cocoa::GameLoop()
UpdateWindows();
this->CheckPaletteAnim();
this->Draw();
this->Paint();
}
/* If we are not in fast-forward, create some time between calls to ease up CPU usage. */