Paths ready for SDL2

This commit is contained in:
2021-05-09 06:49:15 +02:00
parent 4cd02fe5dc
commit 6fb53a6435
14 changed files with 22 additions and 31 deletions

View File

@@ -1,5 +1,5 @@
#pragma once
#include "SDL/SDL.h"
#include "SDL2/SDL.h"
#include "DrawManager.h"
#include "InputManager.h"
#include "MusicManager.h"

View File

@@ -1,7 +1,7 @@
#include "DrawManager.h"
#include "const.h"
#include "fileManager.h"
#include "SDL/SDL_image.h"
#include "SDL2/SDL_image.h"

View File

@@ -1,5 +1,5 @@
#pragma once
#include "SDL/SDL.h"
#include "SDL2/SDL.h"
class DrawManager
{

View File

@@ -1,6 +1,6 @@
#pragma once
#include <list>
#include "SDL/SDL.h"
#include "SDL2/SDL.h"
#include "GameInfo.h"
#include "DrawManager.h"
#include "InputManager.h"

View File

@@ -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;
}
}
}

View File

@@ -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;

View File

@@ -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;

View File

@@ -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;

View File

@@ -1,5 +1,5 @@
#pragma once
#include "SDL/SDL_mixer.h"
#include "SDL2/SDL_mixer.h"
class MusicManager
{

View File

@@ -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;

View File

@@ -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;

View File

@@ -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;

View File

@@ -1,5 +1,5 @@
#pragma once
#include "SDL/SDL.h"
#include "SDL2/SDL.h"
#include "DrawManager.h"
#include "InputManager.h"
#include "MusicManager.h"

View File

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