diff --git a/client/Graphics.cpp b/client/Graphics.cpp index 9981d400c..4bf27ac63 100644 --- a/client/Graphics.cpp +++ b/client/Graphics.cpp @@ -266,9 +266,7 @@ void Graphics::loadHeroFlagsDetail(std::pair Graphi for(auto & curImg : curImgs) { CSDL_Ext::setDefaultColorKey(curImg.bitmap); - #ifndef VCMI_SDL1 SDL_SetSurfaceBlendMode(curImg.bitmap,SDL_BLENDMODE_NONE); - #endif } } } diff --git a/client/gui/CCursorHandler.cpp b/client/gui/CCursorHandler.cpp index 5b7c27650..326a8a743 100644 --- a/client/gui/CCursorHandler.cpp +++ b/client/gui/CCursorHandler.cpp @@ -27,10 +27,8 @@ void CCursorHandler::initCursor() currentCursor = nullptr; help = CSDL_Ext::newSurface(40,40); - #ifndef VCMI_SDL1 //No blending. Ensure, that we are copying pixels during "screen restore draw" SDL_SetSurfaceBlendMode(help,SDL_BLENDMODE_NONE); - #endif // VCMI_SDL1 SDL_ShowCursor(SDL_DISABLE); changeGraphic(ECursor::ADVENTURE, 0); diff --git a/client/gui/CGuiHandler.cpp b/client/gui/CGuiHandler.cpp index fabdbc268..b1b59e833 100644 --- a/client/gui/CGuiHandler.cpp +++ b/client/gui/CGuiHandler.cpp @@ -63,10 +63,7 @@ void CGuiHandler::processLists(const ui16 activityFlag, std::functiontype == SDL_MOUSEWHEEL) { std::list hlp = wheelInterested; @@ -296,7 +290,6 @@ void CGuiHandler::handleEvent(SDL_Event *sEvent) } } //todo: muiltitouch - #endif // VCMI_SDL1 else if ((sEvent->type==SDL_MOUSEBUTTONUP) && (sEvent->button.button == SDL_BUTTON_LEFT)) { std::list hlp = lclickable; @@ -330,7 +323,6 @@ void CGuiHandler::handleEvent(SDL_Event *sEvent) } } current = nullptr; - } //event end void CGuiHandler::handleMouseMotion(SDL_Event *sEvent) diff --git a/client/gui/CGuiHandler.h b/client/gui/CGuiHandler.h index 09b3e3b8d..d8f9cfb30 100644 --- a/client/gui/CGuiHandler.h +++ b/client/gui/CGuiHandler.h @@ -58,10 +58,9 @@ private: motioninterested, timeinterested, wheelInterested, - doubleClickInterested; - #ifndef VCMI_SDL1 - CIntObjectList textInterested; - #endif // VCMI_SDL1 + doubleClickInterested, + textInterested; + void processLists(const ui16 activityFlag, std::function *)> cb); public: diff --git a/client/gui/CIntObject.h b/client/gui/CIntObject.h index 751c291bc..fe566c7f0 100644 --- a/client/gui/CIntObject.h +++ b/client/gui/CIntObject.h @@ -133,10 +133,8 @@ public: virtual void keyPressed(const SDL_KeyboardEvent & key){} virtual bool captureThisEvent(const SDL_KeyboardEvent & key); //allows refining captureAllKeys against specific events (eg. don't capture ENTER) -#ifndef VCMI_SDL1 virtual void textInputed(const SDL_TextInputEvent & event){}; virtual void textEdited(const SDL_TextEditingEvent & event){}; -#endif // VCMI_SDL1 //mouse movement handling bool strongInterest; //if true - report all mouse movements, if not - only when hovered diff --git a/client/gui/SDL_Extensions.cpp b/client/gui/SDL_Extensions.cpp index c29c4ed6d..d78c64afc 100644 --- a/client/gui/SDL_Extensions.cpp +++ b/client/gui/SDL_Extensions.cpp @@ -967,23 +967,19 @@ SDL_Color CSDL_Ext::makeColor(ui8 r, ui8 g, ui8 b, ui8 a) void CSDL_Ext::startTextInput(SDL_Rect * where) { - #ifndef VCMI_SDL1 if (SDL_IsTextInputActive() == SDL_FALSE) { SDL_StartTextInput(); } SDL_SetTextInputRect(where); - #endif } void CSDL_Ext::stopTextInput() { - #ifndef VCMI_SDL1 if (SDL_IsTextInputActive() == SDL_TRUE) { SDL_StopTextInput(); } - #endif } STRONG_INLINE static uint32_t mapColor(SDL_Surface * surface, SDL_Color color) diff --git a/client/gui/SDL_Extensions.h b/client/gui/SDL_Extensions.h index 0e75478d7..1e9f06edd 100644 --- a/client/gui/SDL_Extensions.h +++ b/client/gui/SDL_Extensions.h @@ -10,15 +10,10 @@ #pragma once #include - -#ifndef VCMI_SDL1 #include -#endif - #include #include #include "../../lib/int3.h" -//#include "../Graphics.h" #include "Geometries.h" #include "../../lib/GameConstants.h" diff --git a/client/widgets/AdventureMapClasses.cpp b/client/widgets/AdventureMapClasses.cpp index 0d31b2ef8..b7014ee8c 100644 --- a/client/widgets/AdventureMapClasses.cpp +++ b/client/widgets/AdventureMapClasses.cpp @@ -1126,8 +1126,6 @@ void CInGameConsole::keyPressed (const SDL_KeyboardEvent & key) } } -#ifndef VCMI_SDL1 - void CInGameConsole::textInputed(const SDL_TextInputEvent & event) { if(!captureAllKeys || enteredText.size() == 0) @@ -1145,8 +1143,6 @@ void CInGameConsole::textEdited(const SDL_TextEditingEvent & event) //do nothing here } -#endif // VCMI_SDL1 - void CInGameConsole::startEnteringText() { CSDL_Ext::startTextInput(&pos); diff --git a/client/widgets/AdventureMapClasses.h b/client/widgets/AdventureMapClasses.h index c14c88eb0..948bfa2df 100644 --- a/client/widgets/AdventureMapClasses.h +++ b/client/widgets/AdventureMapClasses.h @@ -369,10 +369,8 @@ public: void print(const std::string &txt); void keyPressed (const SDL_KeyboardEvent & key); //call-in -#ifndef VCMI_SDL1 void textInputed(const SDL_TextInputEvent & event) override; void textEdited(const SDL_TextEditingEvent & event) override; -#endif // VCMI_SDL1 void startEnteringText(); void endEnteringText(bool printEnteredText); diff --git a/client/widgets/TextControls.h b/client/widgets/TextControls.h index 0039a0688..9f5491a9b 100644 --- a/client/widgets/TextControls.h +++ b/client/widgets/TextControls.h @@ -174,12 +174,8 @@ public: void keyPressed(const SDL_KeyboardEvent & key) override; bool captureThisEvent(const SDL_KeyboardEvent & key) override; -#ifndef VCMI_SDL1 void textInputed(const SDL_TextInputEvent & event) override; void textEdited(const SDL_TextEditingEvent & event) override; - - -#endif // VCMI_SDL1 //Filter that will block all characters not allowed in filenames static void filenameFilter(std::string &text, const std::string & oldText); diff --git a/client/windows/GUIClasses.cpp b/client/windows/GUIClasses.cpp index d014d0201..95516d507 100644 --- a/client/windows/GUIClasses.cpp +++ b/client/windows/GUIClasses.cpp @@ -1089,9 +1089,7 @@ CPuzzleWindow::CPuzzleWindow(const int3 &GrailPos, double discoveredRatio): piecesToRemove.push_back(piece); piece->needRefresh = true; piece->recActions = piece->recActions & ~SHOWALL; - #ifndef VCMI_SDL1 SDL_SetSurfaceBlendMode(piece->bg,SDL_BLENDMODE_BLEND); - #endif // VCMI_SDL1 } } }