From ec1beaa2ee07368368e9bd45fe400eedc57419eb Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 21 Aug 2013 14:37:03 +0300 Subject: first part of fixes for compilation with SDL2 --- src/client.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/client.cpp') 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) -- cgit v1.2.3-60-g2f50