diff options
author | Andrei Karas <akaras@inbox.ru> | 2013-08-21 14:37:03 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2013-08-24 21:08:14 +0300 |
commit | ec1beaa2ee07368368e9bd45fe400eedc57419eb (patch) | |
tree | c8f4792dc2316c7cc852bcf6738dff7557d9b872 /src/client.cpp | |
parent | 8d4af08b165e10d7e82380074ce733ee9d068c6a (diff) | |
download | manaverse-ec1beaa2ee07368368e9bd45fe400eedc57419eb.tar.gz manaverse-ec1beaa2ee07368368e9bd45fe400eedc57419eb.tar.bz2 manaverse-ec1beaa2ee07368368e9bd45fe400eedc57419eb.tar.xz manaverse-ec1beaa2ee07368368e9bd45fe400eedc57419eb.zip |
first part of fixes for compilation with SDL2
Diffstat (limited to 'src/client.cpp')
-rw-r--r-- | src/client.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/client.cpp b/src/client.cpp index 5551bd312..38fc440f9 100644 --- a/src/client.cpp +++ b/src/client.cpp @@ -296,8 +296,13 @@ Client::Client(const Options &options) : mState(STATE_CHOOSE_SERVER), mOldState(STATE_START), mIcon(nullptr), +#ifdef USE_SDL2 + mLogicCounterId(0), + mSecondsCounterId(0), +#else mLogicCounterId(nullptr), mSecondsCounterId(nullptr), +#endif mCaption(), mFpsManager(), mSkin(nullptr), @@ -452,11 +457,15 @@ void Client::gameInit() atexit(SDL_Quit); initPacketLimiter(); +#ifndef USE_SDL2 SDL_EnableUNICODE(1); +#endif applyKeyRepeat(); // disable unused SDL events +#ifndef USE_SDL2 SDL_EventState(SDL_VIDEOEXPOSE, SDL_IGNORE); +#endif SDL_EventState(SDL_SYSWMEVENT, SDL_IGNORE); SDL_EventState(SDL_USEREVENT, SDL_IGNORE); @@ -575,7 +584,11 @@ void Client::gameInit() mIcon = IMG_Load(iconFile.c_str()); if (mIcon) { +#ifdef USE_SDL2 + SDL_SetSurfaceAlphaMod(mIcon, 255); +#else SDL_SetAlpha(mIcon, SDL_SRCALPHA, SDL_ALPHA_OPAQUE); +#endif SDL_WM_SetIcon(mIcon, nullptr); } #endif @@ -2874,8 +2887,10 @@ void Client::applyVSync() void Client::applyKeyRepeat() { +#ifndef USE_SDL2 SDL_EnableKeyRepeat(config.getIntValue("repeateDelay"), config.getIntValue("repeateInterval")); +#endif } void Client::setIsMinimized(const bool n) |