Skip to content

Commit

Permalink
fix: screen stutter
Browse files Browse the repository at this point in the history
  • Loading branch information
daelsepara committed Aug 16, 2024
1 parent 0a8e5e2 commit cd55056
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 14 deletions.
2 changes: 1 addition & 1 deletion build/amd64/debian/HeartOfIce.desktop
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[Desktop Entry]
Name=Heart of Ice
Comment=Heart of Ice
Version=1.0.5
Version=1.0.6
TryExec=/usr/local/games/HeartOfIce/HeartOfIce.exe
Exec=/usr/local/games/HeartOfIce/HeartOfIce.exe
Icon=/usr/local/games/HeartOfIce/icons/snowflakes.png
Expand Down
2 changes: 1 addition & 1 deletion build/amd64/debian/control
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Package: heart-of-ice
Version: 1.0.5
Version: 1.0.6
Maintainer: Dael Separa <dael.separa@gmail.com>
Architecture: amd64
Description: Heart of Ice (SDL)
Expand Down
2 changes: 1 addition & 1 deletion build/armhf/raspbian/HeartOfIce.desktop
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[Desktop Entry]
Name=Heart of Ice
Comment=Heart of Ice
Version=1.0.5
Version=1.0.6
TryExec=/usr/local/games/HeartOfIce/HeartOfIce.exe
Exec=/usr/local/games/HeartOfIce/HeartOfIce.exe
Icon=/usr/local/games/HeartOfIce/icons/snowflakes.png
Expand Down
2 changes: 1 addition & 1 deletion build/armhf/raspbian/control
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Package: heart-of-ice
Version: 1.0.5
Version: 1.0.6
Maintainer: Dael Separa <dael.separa@gmail.com>
Architecture: armhf
Description: Heart of Ice (SDL)
Expand Down
2 changes: 1 addition & 1 deletion build/i386/debian/HeartOfIce.desktop
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[Desktop Entry]
Name=Heart of Ice
Comment=Heart of Ice
Version=1.0.5
Version=1.0.6
TryExec=/usr/local/games/HeartOfIce/HeartOfIce.exe
Exec=/usr/local/games/HeartOfIce/HeartOfIce.exe
Icon=/usr/local/games/HeartOfIce/icons/snowflakes.png
Expand Down
2 changes: 1 addition & 1 deletion build/i386/debian/control
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Package: heart-of-ice
Version: 1.0.5
Version: 1.0.6
Maintainer: Dael Separa <dael.separa@gmail.com>
Architecture: i386
Description: Heart of Ice (SDL)
Expand Down
18 changes: 10 additions & 8 deletions src/HeartOfIce.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,13 @@ SDL_Surface *createImage(const char *image)
return surface;
}

void initWindowRenderer(SDL_Renderer *renderer)
{
SDL_SetRenderDrawColor(renderer, 0, 0, 0, 255);
SDL_RenderClear(renderer);
SDL_RenderPresent(renderer);
}

void createWindow(Uint32 flags, SDL_Window **window, SDL_Renderer **renderer, const char *title, const char *icon)
{
// The window we'll be rendering to
Expand Down Expand Up @@ -122,13 +129,7 @@ void createWindow(Uint32 flags, SDL_Window **window, SDL_Renderer **renderer, co
surface = NULL;
}

SDL_SetRenderDrawColor(*renderer, 0, 0, 0, 255);
SDL_RenderClear(*renderer);
SDL_RenderPresent(*renderer);

SDL_SetRenderDrawColor(*renderer, 0, 0, 0, 255);
SDL_RenderClear(*renderer);
SDL_RenderPresent(*renderer);
initWindowRenderer(*renderer);
}
}

Expand Down Expand Up @@ -362,6 +363,7 @@ void putText(SDL_Renderer *renderer, const char *text, TTF_Font *font, int space
void fillWindow(SDL_Renderer *renderer, Uint32 color)
{
SDL_SetRenderDrawColor(renderer, R(color), G(color), B(color), A(color));

SDL_RenderClear(renderer);
}

Expand Down Expand Up @@ -4588,7 +4590,7 @@ bool processStory(SDL_Window *window, SDL_Renderer *renderer, Character::Base &p

fillWindow(renderer, intWH);

//Fill the surface with background
// Fill the surface with background
stretchImage(renderer, background, 0, 0, SCREEN_WIDTH, buttony - button_space);

if (splash)
Expand Down

0 comments on commit cd55056

Please sign in to comment.