initialize values correctly for older compilers

This commit is contained in:
Bigpet 2013-11-24 06:32:19 +01:00
parent af2e18dcc3
commit 0d50f78705
2 changed files with 11 additions and 13 deletions

View File

@ -10,7 +10,7 @@ extern "C" {
}
}
SDLJoystick::SDLJoystick(bool init_SDL ){
SDLJoystick::SDLJoystick(bool init_SDL ): running(true),joy(NULL),thread(NULL){
if (init_SDL)
{
SDL_Init(SDL_INIT_JOYSTICK | SDL_INIT_VIDEO
@ -119,7 +119,6 @@ void SDLJoystick::ProcessInput(SDL_Event &event){
}
}
void SDLJoystick::runLoop(){
while (running){
SDL_Event evt;
@ -128,4 +127,4 @@ void SDLJoystick::runLoop(){
ProcessInput(evt);
}
}
}
}

View File

@ -1,19 +1,18 @@
//#ifdef _WIN32
//#include "SDL/SDL.h"
//#include "SDL/SDL_joystick.h"
//#include "SDL/SDL_thread.h"
//#else
#pragma once
#ifdef _WIN32
#include "SDL/SDL.h"
#include "SDL/SDL_joystick.h"
#include "SDL/SDL_thread.h"
#else
#include "SDL.h"
#include "SDL_joystick.h"
#include "SDL_thread.h"
//#endif
#endif
#include "input/input_state.h"
#include "input/keycodes.h"
#include "net/resolve.h"
#include "base/NKCodeFromSDL.h"
#include "base/NativeApp.h"
extern "C" {
@ -90,8 +89,8 @@ private:
std::map<int, int> SDLJoyButtonMap;
std::map<int, int> SDLJoyAxisMap;
SDL_Joystick *joy = NULL;
SDL_Thread *thread = NULL;
bool running = true;
SDL_Joystick *joy ;
SDL_Thread *thread ;
bool running ;
};