Optimizations for Graphics.cpp

This commit is contained in:
DepressedTWM 2026-06-01 14:51:31 -04:00
parent fd9805fd84
commit 71cc32c838
2 changed files with 8 additions and 8 deletions

View file

@ -654,7 +654,7 @@ void Graphics::freeze(){
p->compositeToBuffer(p->frozenScene); p->compositeToBuffer(p->frozenScene);
} }
void Graphics::transition(int duration, const char *filename, int vague){ void Graphics::transition(unsigned short duration, const char *filename, int vague){
p->checkSyncLock(); p->checkSyncLock();
if (!p->frozen) if (!p->frozen)
@ -783,14 +783,14 @@ void Graphics::setFrameRate(int value){
p->fpsLimiter.setDesiredFPS(p->frameRate); p->fpsLimiter.setDesiredFPS(p->frameRate);
} }
void Graphics::wait(int duration){ void Graphics::wait(unsigned int duration){
for (int i = 0; i < duration; ++i){ for (int i = 0; i < duration; ++i){
p->checkShutDownReset(); p->checkShutDownReset();
p->redrawScreen(); p->redrawScreen();
} }
} }
void Graphics::fadeout(int duration){ void Graphics::fadeout(unsigned int duration){
FBO::unbind(); FBO::unbind();
float curr = p->brightness; float curr = p->brightness;
@ -816,7 +816,7 @@ void Graphics::fadeout(int duration){
} }
} }
void Graphics::fadein(int duration){ void Graphics::fadein(unsigned int duration){
FBO::unbind(); FBO::unbind();
float curr = p->brightness; float curr = p->brightness;

View file

@ -36,16 +36,16 @@ class Graphics{
public: public:
void update(bool limitFps = true); void update(bool limitFps = true);
void freeze(); void freeze();
void transition(int duration = 8, const char *filename = "", int vague = 40); void transition(unsigned short duration = 8, const char *filename = "", int vague = 40);
void frameReset(); void frameReset();
DECL_ATTR( FrameRate, int ) DECL_ATTR( FrameRate, int )
DECL_ATTR( FrameCount, int ) DECL_ATTR( FrameCount, int )
DECL_ATTR( Brightness, int ) DECL_ATTR( Brightness, int )
void wait(int duration); void wait(unsigned int duration);
void fadeout(int duration); void fadeout(unsigned int duration);
void fadein(int duration); void fadein(unsigned int duration);
Bitmap *snapToBitmap(); Bitmap *snapToBitmap();