Skip to content

Commit

Permalink
Add build metadata for appimage. Fix initial screen flicker
Browse files Browse the repository at this point in the history
  • Loading branch information
daelsepara committed Aug 16, 2024
1 parent 496fe7c commit 5e26d02
Show file tree
Hide file tree
Showing 9 changed files with 60 additions and 15 deletions.
2 changes: 1 addition & 1 deletion build/amd64/debian/NecklaceOfSkulls.desktop
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[Desktop Entry]
Name=Necklace of Skulls
Comment=Necklace of Skulls
Version=1.0.5
Version=1.0.6
TryExec=/usr/local/games/NecklaceOfSkulls/NecklaceOfSkulls.exe
Exec=/usr/local/games/NecklaceOfSkulls/NecklaceOfSkulls.exe
Icon=/usr/local/games/NecklaceOfSkulls/icons/maya.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: necklace-of-skulls
Version: 1.0.5
Version: 1.0.6
Maintainer: Dael Separa <dael.separa@gmail.com>
Architecture: amd64
Description: Necklace of Skulls (SDL)
Expand Down
20 changes: 20 additions & 0 deletions build/appimage/NecklaceOfSkulls.appdata.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<component type="desktop-application">
<id>com.games.NecklaceOfSkulls</id>
<metadata_license>CC0-1.0</metadata_license>
<project_license>GPL-3.0</project_license>
<name>com.games.NecklaceOfSkulls</name>
<summary>Necklace of Skulls (SDL)</summary>
<description>
<p>This is an Implementation of Necklace of Skulls gamebook in C++ and SDL.</p>
</description>
<url type="homepage">https://github.com/daelsepara/sdl-skulls/</url>
<screenshots>
<screenshot typegi="default">
<image>https://raw.githubusercontent.com/daelsepara/sdl-skulls/main/src/icons/maya.png</image>
</screenshot>
</screenshots>
<provides>
<id>com.games.NecklaceOfSkulls.desktop</id>
</provides>
</component>
10 changes: 10 additions & 0 deletions build/appimage/NecklaceOfSkulls.desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[Desktop Entry]
Name=Necklace of Skulls
Exec=NecklaceOfSkulls.exe
TryExec=NecklaceOfSkulls.exe
Icon=maya
Terminal=false
Categories=Game;
Type=Application
Name[en_DK]=Necklace of Skulls
Name[en_US]=Necklace of Skulls
2 changes: 1 addition & 1 deletion build/armhf/raspbian/NecklaceOfSkulls.desktop
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[Desktop Entry]
Name=Necklace of Skulls
Comment=Necklace of Skulls
Version=1.0.5
Version=1.0.6
TryExec=/usr/local/games/NecklaceOfSkulls/NecklaceOfSkulls.exe
Exec=/usr/local/games/NecklaceOfSkulls/NecklaceOfSkulls.exe
Icon=/usr/local/games/NecklaceOfSkulls/icons/maya.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: necklace-of-skulls
Version: 1.0.5
Version: 1.0.6
Maintainer: Dael Separa <dael.separa@gmail.com>
Architecture: armhf
Description: Necklace of Skulls (SDL)
Expand Down
2 changes: 1 addition & 1 deletion build/i386/debian/NecklaceOfSkulls.desktop
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[Desktop Entry]
Name=Necklace of Skulls
Comment=Necklace of Skulls
Version=1.0.5
Version=1.0.6
TryExec=/usr/local/games/NecklaceOfSkulls/NecklaceOfSkulls.exe
Exec=/usr/local/games/NecklaceOfSkulls/NecklaceOfSkulls.exe
Icon=/usr/local/games/NecklaceOfSkulls/icons/maya.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: necklace-of-skulls
Version: 1.0.5
Version: 1.0.6
Maintainer: Dael Separa <dael.separa@gmail.com>
Architecture: i386
Description: Necklace of Skulls (SDL)
Expand Down
33 changes: 24 additions & 9 deletions src/NecklaceOfSkulls.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -127,14 +127,6 @@ 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);
}
}

Expand Down Expand Up @@ -6000,7 +5992,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 Expand Up @@ -6503,6 +6495,8 @@ bool mainScreen(SDL_Window *window, SDL_Renderer *renderer, int storyID)

auto text_space = 8;

auto first = true;

while (!done)
{
// Fill the surface with background
Expand All @@ -6522,6 +6516,27 @@ bool mainScreen(SDL_Window *window, SDL_Renderer *renderer, int storyID)

Control::Type result;

if (first)
{
SDL_Event user_event;

user_event.type = SDL_MOUSEMOTION;

user_event.motion.x = controls[0].X;

user_event.motion.y = controls[0].Y;

user_event.motion.xrel = controls[0].W / 2;

user_event.motion.yrel = controls[0].H / 2;

SDL_PushEvent(&user_event);

SDL_PumpEvents();

first = false;
}

done = Input::GetInput(renderer, controls, current, selected, scrollUp, scrollDown, hold);

if (selected && current >= 0 && current < controls.size())
Expand Down

0 comments on commit 5e26d02

Please sign in to comment.