Skip to content

Commit

Permalink
add appimage metadata, 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 2b5b52c commit 7d76520
Show file tree
Hide file tree
Showing 9 changed files with 83 additions and 38 deletions.
2 changes: 1 addition & 1 deletion build/amd64/debian/DownAmongTheDeadMen.desktop
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[Desktop Entry]
Name=Down Among the Dead Men
Comment=Down Among the Dead Men
Version=1.0.3
Version=1.0.4
TryExec=/usr/local/games/DownAmongTheDeadMen/DownAmongTheDeadMen.exe
Exec=/usr/local/games/DownAmongTheDeadMen/DownAmongTheDeadMen.exe
Icon=/usr/local/games/DownAmongTheDeadMen/icons/pirate-ship.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: down-among-deadmen
Version: 1.0.3
Version: 1.0.4
Maintainer: Dael Separa <dael.separa@gmail.com>
Architecture: amd64
Description: Down Among the Dead Men (SDL)
Expand Down
20 changes: 20 additions & 0 deletions build/appimage/DownAmongTheDeadMen.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.DownAmongTheDeadMen</id>
<metadata_license>CC0-1.0</metadata_license>
<project_license>GPL-3.0</project_license>
<name>com.games.DownAmongTheDeadMen</name>
<summary>Down Among the Dead Men (SDL)</summary>
<description>
<p>This is an Implementation of Down Among the Dead Men gamebook in C++ and SDL.</p>
</description>
<url type="homepage">https://github.com/daelsepara/sdl-dead/</url>
<screenshots>
<screenshot typegi="default">
<image>https://raw.githubusercontent.com/daelsepara/sdl-dead/main/src/icons/pirate-ship.png</image>
</screenshot>
</screenshots>
<provides>
<id>com.games.DownAmongTheDeadMen.desktop</id>
</provides>
</component>
10 changes: 10 additions & 0 deletions build/appimage/DownAmongTheDeadMen.desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[Desktop Entry]
Name=Down Among the Dead Men
Exec=DownAmongTheDeadMen.exe
TryExec=DownAmongTheDeadMen.exe
Icon=pirate-ship
Terminal=false
Categories=Game;
Type=Application
Name[en_DK]=Down Among the Dead Men
Name[en_US]=Down Among the Dead Men
2 changes: 1 addition & 1 deletion build/armhf/raspbian/DownAmongTheDeadMen.desktop
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[Desktop Entry]
Name=Down Among the Dead Men
Comment=Down Among the Dead Men
Version=1.0.3
Version=1.0.4
TryExec=/usr/local/games/DownAmongTheDeadMen/DownAmongTheDeadMen.exe
Exec=/usr/local/games/DownAmongTheDeadMen/DownAmongTheDeadMen.exe
Icon=/usr/local/games/DownAmongTheDeadMen/icons/pirate-ship.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: down-among-deadmen
Version: 1.0.3
Version: 1.0.4
Maintainer: Dael Separa <dael.separa@gmail.com>
Architecture: armhf
Description: Down Among the Dead Men (SDL)
Expand Down
2 changes: 1 addition & 1 deletion build/i386/debian/DownAmongTheDeadMen.desktop
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[Desktop Entry]
Name=Down Among the Dead Men
Comment=Down Among the Dead Men
Version=1.0.3
Version=1.0.4
TryExec=/usr/local/games/DownAmongTheDeadMen/DownAmongTheDeadMen.exe
Exec=/usr/local/games/DownAmongTheDeadMen/DownAmongTheDeadMen.exe
Icon=/usr/local/games/DownAmongTheDeadMen/icons/pirate-ship.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: down-among-deadmen
Version: 1.0.3
Version: 1.0.4
Maintainer: Dael Separa <dael.separa@gmail.com>
Architecture: i386
Description: Down Among the Dead Men (SDL)
Expand Down
79 changes: 47 additions & 32 deletions src/DownAmongTheDeadMen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -122,14 +122,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 @@ -688,9 +680,9 @@ bool characterScreen(SDL_Window *window, SDL_Renderer *renderer, Character::Base

renderButtons(renderer, controls, current, intGR, space, space / 2);

bool scrollUp = false;
bool scrollDown = false;
bool hold = false;
auto scrollUp = false;
auto scrollDown = false;
auto hold = false;

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

Expand Down Expand Up @@ -787,8 +779,8 @@ bool glossaryScreen(SDL_Window *window, SDL_Renderer *renderer, std::vector<Skil

renderButtons(renderer, controls, current, intGR, border_space, border_pts, (offset > 0), glossary && offset < (glossary->h - text_bounds + 2 * space));

bool scrollUp = false;
bool scrollDown = false;
auto scrollUp = false;
auto scrollDown = false;

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

Expand Down Expand Up @@ -2030,9 +2022,9 @@ Character::Base customCharacter(SDL_Window *window, SDL_Renderer *renderer)

auto font = TTF_OpenFont(FONT_FILE, font_size);

bool scrollUp = false;
bool scrollDown = false;
bool hold = false;
auto scrollUp = false;
auto scrollDown = false;
auto hold = false;
auto scrollSpeed = 1;
auto selection = std::vector<int>();
auto infoh = 0.07 * SCREEN_HEIGHT;
Expand Down Expand Up @@ -2348,9 +2340,9 @@ Character::Base selectCharacter(SDL_Window *window, SDL_Renderer *renderer)

renderTextButtons(renderer, controls, FONT_FILE, current, clrWH, intBK, intRD, font20, TTF_STYLE_NORMAL);

bool scrollUp = false;
bool scrollDown = false;
bool hold = false;
auto scrollUp = false;
auto scrollDown = false;
auto hold = false;

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

Expand Down Expand Up @@ -2472,9 +2464,9 @@ bool aboutScreen(SDL_Window *window, SDL_Renderer *renderer)
renderText(renderer, text, intGN, startx * 2 + splashw, starty, SCREEN_HEIGHT * (1.0 - 2 * Margin), 0);
renderTextButtons(renderer, controls, FONT_FILE, current, clrWH, intBK, intRD, font_size, TTF_STYLE_NORMAL);

bool scrollUp = false;
bool scrollDown = false;
bool hold = false;
auto scrollUp = false;
auto scrollDown = false;
auto hold = false;

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

Expand Down Expand Up @@ -3723,9 +3715,9 @@ bool mapScreen(SDL_Window *window, SDL_Renderer *renderer)

renderButtons(renderer, controls, current, intGR, 8, 4);

bool scrollUp = false;
bool scrollDown = false;
bool hold = false;
auto scrollUp = false;
auto scrollDown = false;
auto hold = false;

if (map_colonies && map_jollyboat)
{
Expand Down Expand Up @@ -4015,8 +4007,8 @@ Story::Base *processChoices(SDL_Window *window, SDL_Renderer *renderer, Characte
}
else
{
bool loaded = true;
int weapons = 0;
auto loaded = true;
auto weapons = 0;

for (auto i = 0; i < story->Choices[current].Items.size(); i++)
{
Expand Down Expand Up @@ -5012,8 +5004,8 @@ bool processStory(SDL_Window *window, SDL_Renderer *renderer, Character::Base &p
}
}

bool scrollUp = false;
bool scrollDown = false;
auto scrollUp = false;
auto scrollDown = false;

renderButtons(renderer, controls, current, intGR, border_space, border_pts, (offset > 0), text && offset < (text->h - text_bounds + 2 * space));

Expand Down Expand Up @@ -5394,6 +5386,8 @@ bool mainScreen(SDL_Window *window, SDL_Renderer *renderer, int storyID)

auto done = false;

auto first = true;

while (!done)
{
// Fill the surface with background
Expand All @@ -5403,12 +5397,33 @@ bool mainScreen(SDL_Window *window, SDL_Renderer *renderer, int storyID)
renderText(renderer, text, intGN, startx * 2 + splashw, starty, SCREEN_HEIGHT * (1.0 - 2 * Margin), 0);
renderTextButtons(renderer, controls, FONT_FILE, current, clrWH, intBK, intRD, font_size, TTF_STYLE_NORMAL);

bool scrollUp = false;
bool scrollDown = false;
bool hold = false;
auto scrollUp = false;
auto scrollDown = false;
auto hold = false;

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 7d76520

Please sign in to comment.