diff --git a/appimage/CoilsOfHate.appdata.xml b/appimage/CoilsOfHate.appdata.xml new file mode 100644 index 0000000..13b87ad --- /dev/null +++ b/appimage/CoilsOfHate.appdata.xml @@ -0,0 +1,20 @@ + + + com.games.CoilsOfHate + CC0-1.0 + GPL-3.0 + com.games.CoilsOfHate + Coils of Hate (SDL) + +

This is an Implementation of Coils of Hate gamebook in C++ and SDL.

+
+ https://github.com/daelsepara/sdl-coils/ + + + https://raw.githubusercontent.com/daelsepara/sdl-coils/main/src/icons/snake.png + + + + com.games.CoilsOfHate.desktop + +
diff --git a/appimage/CoilsOfHate.desktop b/appimage/CoilsOfHate.desktop new file mode 100644 index 0000000..02b8a87 --- /dev/null +++ b/appimage/CoilsOfHate.desktop @@ -0,0 +1,10 @@ +[Desktop Entry] +Name=Coils of Hate +Exec=CoilsOfHate.exe +TryExec=CoilsOfHate.exe +Icon=snake +Terminal=false +Categories=Game; +Type=Application +Name[en_DK]=Coils of Hate +Name[en_US]=Coils of Hate diff --git a/build/amd64/debian/CoilsOfHate.desktop b/build/amd64/debian/CoilsOfHate.desktop index d76b339..0000a01 100644 --- a/build/amd64/debian/CoilsOfHate.desktop +++ b/build/amd64/debian/CoilsOfHate.desktop @@ -1,7 +1,7 @@ [Desktop Entry] Name=The Coils of Hate Comment=The Coils of Hate -Version=1.0.4 +Version=1.0.5 TryExec=/usr/local/games/CoilsOfHate/CoilsOfHate.exe Exec=/usr/local/games/CoilsOfHate/CoilsOfHate.exe Icon=/usr/local/games/CoilsOfHate/icons/snake.png diff --git a/build/amd64/debian/control b/build/amd64/debian/control index 732d5cb..e4b46ab 100644 --- a/build/amd64/debian/control +++ b/build/amd64/debian/control @@ -1,5 +1,5 @@ Package: coils-of-hate -Version: 1.0.4 +Version: 1.0.5 Maintainer: Dael Separa Architecture: amd64 Description: The Coils of Hate (SDL) diff --git a/build/armhf/raspbian/CoilsOfHate.desktop b/build/armhf/raspbian/CoilsOfHate.desktop index d76b339..0000a01 100644 --- a/build/armhf/raspbian/CoilsOfHate.desktop +++ b/build/armhf/raspbian/CoilsOfHate.desktop @@ -1,7 +1,7 @@ [Desktop Entry] Name=The Coils of Hate Comment=The Coils of Hate -Version=1.0.4 +Version=1.0.5 TryExec=/usr/local/games/CoilsOfHate/CoilsOfHate.exe Exec=/usr/local/games/CoilsOfHate/CoilsOfHate.exe Icon=/usr/local/games/CoilsOfHate/icons/snake.png diff --git a/build/armhf/raspbian/control b/build/armhf/raspbian/control index be715fb..765bb9c 100644 --- a/build/armhf/raspbian/control +++ b/build/armhf/raspbian/control @@ -1,5 +1,5 @@ Package: coils-of-hate -Version: 1.0.4 +Version: 1.0.5 Maintainer: Dael Separa Architecture: armhf Description: The Coils of Hate (SDL) diff --git a/build/i386/debian/CoilsOfHate.desktop b/build/i386/debian/CoilsOfHate.desktop index d76b339..0000a01 100644 --- a/build/i386/debian/CoilsOfHate.desktop +++ b/build/i386/debian/CoilsOfHate.desktop @@ -1,7 +1,7 @@ [Desktop Entry] Name=The Coils of Hate Comment=The Coils of Hate -Version=1.0.4 +Version=1.0.5 TryExec=/usr/local/games/CoilsOfHate/CoilsOfHate.exe Exec=/usr/local/games/CoilsOfHate/CoilsOfHate.exe Icon=/usr/local/games/CoilsOfHate/icons/snake.png diff --git a/build/i386/debian/control b/build/i386/debian/control index 41326ae..e6d0083 100644 --- a/build/i386/debian/control +++ b/build/i386/debian/control @@ -1,5 +1,5 @@ Package: coils-of-hate -Version: 1.0.4 +Version: 1.0.5 Maintainer: Dael Separa Architecture: i386 Description: The Coils of Hate (SDL) diff --git a/src/CoilsOfHate.cpp b/src/CoilsOfHate.cpp index 30aa278..6384bb0 100644 --- a/src/CoilsOfHate.cpp +++ b/src/CoilsOfHate.cpp @@ -66,6 +66,7 @@ Story::Base *processChoices(SDL_Window *window, SDL_Renderer *renderer, Characte Story::Base *renderChoices(SDL_Window *window, SDL_Renderer *renderer, Character::Base &player, Story::Base *story); void clipValue(int &val, int min, int max); +void createMouseMotion(int x, int y, int xrel, int yrel); void renderAdventurer(SDL_Window *window, SDL_Renderer *renderer, TTF_Font *font, Character::Base &player, Character::Gender gender); SDL_Surface *createImage(const char *image) @@ -166,8 +167,8 @@ void renderImage(SDL_Renderer *renderer, SDL_Surface *image, int x, int y) int fitImage(SDL_Renderer *renderer, SDL_Surface *image, int x, int y, int w, int h) { - int splash_h = image->h; - int splash_w = w; + auto splash_h = image->h; + auto splash_w = w; if (image && renderer) { @@ -214,8 +215,8 @@ int fitImage(SDL_Renderer *renderer, SDL_Surface *image, int x, int y, int w, in void stretchImage(SDL_Renderer *renderer, SDL_Surface *image, int x, int y, int w, int h) { - int splash_h = image->h; - int splash_w = w; + auto splash_h = image->h; + auto splash_w = w; if (image && renderer) { @@ -383,8 +384,8 @@ void renderTextButtons(SDL_Renderer *renderer, std::vector controls, { auto text = createText(controls[i].Text, ttf, fontsize, fg, controls[i].W, style); - int x = controls[i].X + (controls[i].W - text->w) / 2; - int y = controls[i].Y + (controls[i].H - text->h) / 2; + auto x = controls[i].X + (controls[i].W - text->w) / 2; + auto y = controls[i].Y + (controls[i].H - text->h) / 2; SDL_Rect rect; @@ -496,10 +497,10 @@ std::vector createHTextButtons(const char **choices, int num, int te for (auto i = 0; i < num; i++) { - int left = i > 0 ? i - 1 : i; - int right = i < num - 1 ? i + 1 : i; - int up = i; - int down = i; + auto left = i > 0 ? i - 1 : i; + auto right = i < num - 1 ? i + 1 : i; + auto up = i; + auto down = i; auto x = text_x + i * (text_buttonw + text_space * 2) + text_space; @@ -561,7 +562,7 @@ std::vector