Adds window icon

- Fixes bug where you could move when falling.
This commit is contained in:
Linus Probert 2018-08-15 08:08:18 +02:00
parent 6af8d9dd8f
commit 9a610d5f88
4 changed files with 6 additions and 2 deletions

BIN
assets/Extras/icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 640 B

View File

@ -51,6 +51,7 @@
#include "input.h" #include "input.h"
#include "screen.h" #include "screen.h"
#include "hiscore.h" #include "hiscore.h"
#include "io_util.h"
typedef enum Turn_t { typedef enum Turn_t {
PLAYER, PLAYER,
@ -143,6 +144,9 @@ bool initSDL(void)
return false; return false;
} }
// Set the window icon
SDL_SetWindowIcon(gWindow, IMG_Load_RW(io_load_rwops("Extras/icon.png"), true));
gRenderer = SDL_CreateRenderer(gWindow, -1, gRenderer = SDL_CreateRenderer(gWindow, -1,
SDL_RENDERER_ACCELERATED | SDL_RENDERER_TARGETTEXTURE); SDL_RENDERER_ACCELERATED | SDL_RENDERER_TARGETTEXTURE);
if (gRenderer == NULL) if (gRenderer == NULL)

View File

@ -576,7 +576,7 @@ void player_update(UpdateData *data)
return; return;
check_skill_activation(data); check_skill_activation(data);
if (!check_skill_trigger(data)) if (player->state != FALLING && !check_skill_trigger(data))
handle_next_move(data); handle_next_move(data);
if (player->state == FALLING && player->stats.hp > 0) { if (player->state == FALLING && player->stats.hp > 0) {

View File

@ -434,7 +434,7 @@ skill_create(enum SkillType t)
return NULL; return NULL;
} }
#ifdef DEBUG #ifdef DEBUG_SKILLS
skill->levelcap = 1; skill->levelcap = 1;
#endif #endif
return skill; return skill;