diff --git a/AppController.h b/AppController.h index d5e9c17..81967dd 100644 --- a/AppController.h +++ b/AppController.h @@ -1,5 +1,5 @@ #pragma once -#include "SDL/SDL.h" +#include "SDL2/SDL.h" #include "DrawManager.h" #include "InputManager.h" #include "MusicManager.h" diff --git a/DrawManager.cpp b/DrawManager.cpp index 1746d21..5809a46 100644 --- a/DrawManager.cpp +++ b/DrawManager.cpp @@ -1,7 +1,7 @@ #include "DrawManager.h" #include "const.h" #include "fileManager.h" -#include "SDL/SDL_image.h" +#include "SDL2/SDL_image.h" diff --git a/DrawManager.h b/DrawManager.h index 2d1a96c..c4624eb 100644 --- a/DrawManager.h +++ b/DrawManager.h @@ -1,5 +1,5 @@ #pragma once -#include "SDL/SDL.h" +#include "SDL2/SDL.h" class DrawManager { diff --git a/GameController.h b/GameController.h index a63f125..70ba802 100644 --- a/GameController.h +++ b/GameController.h @@ -1,6 +1,6 @@ #pragma once #include -#include "SDL/SDL.h" +#include "SDL2/SDL.h" #include "GameInfo.h" #include "DrawManager.h" #include "InputManager.h" diff --git a/InputManager.cpp b/InputManager.cpp index 473a27d..eb78803 100644 --- a/InputManager.cpp +++ b/InputManager.cpp @@ -36,7 +36,7 @@ InputManager::~InputManager(void) { } void InputManager::Update() { - keystates = SDL_GetKeyState( NULL ); + keystates = SDL_GetKeyboardState( NULL ); teclaSoltada = false; pausaPulsada = false; @@ -98,14 +98,9 @@ void InputManager::Update() { menuPulsat = (event.key.keysym.sym == SDLK_ESCAPE); } - if ( event.type == SDL_ACTIVEEVENT ) { - if (event.active.state & SDL_APPINPUTFOCUS) { - if (event.active.gain) { - finestraActiva = true; - } else { - finestraActiva = false; - } - } + if ( event.type == SDL_WINDOWEVENT ) { + if (event.window.event == SDL_WINDOWEVENT_FOCUS_GAINED) finestraActiva = true; + if (event.window.event == SDL_WINDOWEVENT_FOCUS_LOST) finestraActiva = false; } } } diff --git a/InputManager.h b/InputManager.h index f1a6226..f26acbf 100644 --- a/InputManager.h +++ b/InputManager.h @@ -1,5 +1,5 @@ #pragma once -#include "SDL/SDL.h" +#include "SDL2/SDL.h" #include "GameInfo.h" class InputManager @@ -30,7 +30,7 @@ public: bool finestraActiva; private: - Uint8 *keystates; + const Uint8 *keystates; GameInfo *gameInfo; SDL_Event event; diff --git a/MenuController.h b/MenuController.h index 159a473..f861c87 100644 --- a/MenuController.h +++ b/MenuController.h @@ -1,5 +1,5 @@ #pragma once -#include "SDL/SDL.h" +#include "SDL2/SDL.h" #include "DrawManager.h" #include "InputManager.h" #include "MusicManager.h" @@ -18,7 +18,7 @@ public: private: DrawManager *drawManager; InputManager *inputManager; - MusicManager *musicManager; + MusicManager *musicManager; SDL_Surface *fondo; SDL_Surface *cursor; diff --git a/MortController.h b/MortController.h index 2038f17..1d16756 100644 --- a/MortController.h +++ b/MortController.h @@ -1,5 +1,5 @@ #pragma once -#include "SDL/SDL.h" +#include "SDL2/SDL.h" #include "DrawManager.h" #include "InputManager.h" #include "MusicManager.h" @@ -18,7 +18,7 @@ public: private: DrawManager *drawManager; InputManager *inputManager; - MusicManager *musicManager; + MusicManager *musicManager; SDL_Surface *fondo; SDL_Surface *cursor; diff --git a/MusicManager.h b/MusicManager.h index 3551c51..e9cd840 100644 --- a/MusicManager.h +++ b/MusicManager.h @@ -1,5 +1,5 @@ #pragma once -#include "SDL/SDL_mixer.h" +#include "SDL2/SDL_mixer.h" class MusicManager { diff --git a/PasswordController.h b/PasswordController.h index 76f85e9..1f7015a 100644 --- a/PasswordController.h +++ b/PasswordController.h @@ -1,5 +1,5 @@ #pragma once -#include "SDL/SDL.h" +#include "SDL2/SDL.h" #include "DrawManager.h" #include "InputManager.h" #include "MusicManager.h" @@ -21,7 +21,7 @@ private: DrawManager *drawManager; InputManager *inputManager; - MusicManager *musicManager; + MusicManager *musicManager; SDL_Surface *fondo; SDL_Surface *cursor; diff --git a/PostfaseController.h b/PostfaseController.h index 886bc86..b30a7ff 100644 --- a/PostfaseController.h +++ b/PostfaseController.h @@ -1,5 +1,5 @@ #pragma once -#include "SDL/SDL.h" +#include "SDL2/SDL.h" #include "DrawManager.h" #include "InputManager.h" #include "MusicManager.h" @@ -21,7 +21,7 @@ private: DrawManager *drawManager; InputManager *inputManager; - MusicManager *musicManager; + MusicManager *musicManager; SDL_Surface *fondo; SDL_Surface *font; diff --git a/PrefaseController.h b/PrefaseController.h index fa64a03..6ed659f 100644 --- a/PrefaseController.h +++ b/PrefaseController.h @@ -1,5 +1,5 @@ #pragma once -#include "SDL/SDL.h" +#include "SDL2/SDL.h" #include "DrawManager.h" #include "InputManager.h" #include "MusicManager.h" @@ -21,7 +21,7 @@ private: DrawManager *drawManager; InputManager *inputManager; - MusicManager *musicManager; + MusicManager *musicManager; SDL_Surface *fondo; SDL_Surface *cursor; diff --git a/SequenceController.h b/SequenceController.h index d180699..b2fe2b3 100644 --- a/SequenceController.h +++ b/SequenceController.h @@ -1,5 +1,5 @@ #pragma once -#include "SDL/SDL.h" +#include "SDL2/SDL.h" #include "DrawManager.h" #include "InputManager.h" #include "MusicManager.h" diff --git a/const.h b/const.h index b7cf225..e7b83d2 100644 --- a/const.h +++ b/const.h @@ -1,7 +1,4 @@ #pragma once -#ifndef _CONST_H_ - -#define _CONST_H_ const int SCREEN_WIDTH = 320; const int SCREEN_HEIGHT = 200; @@ -46,4 +43,3 @@ const int MODE_NORMAL = 0; const int MODE_ZOOMX2 = 1; const int MODE_FULLSCREEN = 2; -#endif \ No newline at end of file