Minor cleanup

Move member initialization to initializer list. Add iostream to logger
for convenience.
This commit is contained in:
Bim Overbohm 2013-05-14 21:45:56 +02:00
parent eb4bafcb2f
commit e8472581fa
2 changed files with 11 additions and 9 deletions

View file

@ -8,12 +8,10 @@
namespace fs = boost::filesystem;
InputManager::InputManager(Window* window) : mWindow(window)
InputManager::InputManager(Window* window) : mWindow(window),
mJoysticks(NULL), mInputConfigs(NULL), mKeyboardInputConfig(NULL), mPrevAxisValues(NULL),
mNumJoysticks(0), mNumPlayers(0)
{
mJoysticks = NULL;
mKeyboardInputConfig = NULL;
mNumJoysticks = 0;
mNumPlayers = 0;
}
InputManager::~InputManager()
@ -66,14 +64,17 @@ void InputManager::deinit()
delete mInputConfigs[i];
}
delete mKeyboardInputConfig;
delete[] mInputConfigs;
mInputConfigs = NULL;
delete[] mJoysticks;
delete[] mInputConfigs;
delete[] mPrevAxisValues;
mJoysticks = NULL;
delete mKeyboardInputConfig;
mKeyboardInputConfig = NULL;
mInputConfigs = NULL;
delete[] mPrevAxisValues;
mPrevAxisValues = NULL;
}
SDL_QuitSubSystem(SDL_INIT_JOYSTICK);

View file

@ -7,6 +7,7 @@ else Log().get(level)
#include <string>
#include <sstream>
#include <iostream>
enum LogLevel { LogError, LogWarning, LogInfo, LogDebug };