SDL1 wipe, part 2. Untested.

This commit is contained in:
AlexVinS
2015-06-21 01:59:31 +03:00
parent dca1e28bc1
commit b6a2323e01
11 changed files with 3 additions and 39 deletions
-2
View File
@@ -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);
-8
View File
@@ -63,10 +63,7 @@ void CGuiHandler::processLists(const ui16 activityFlag, std::function<void (std:
processList(CIntObject::TIME,activityFlag,&timeinterested,cb);
processList(CIntObject::WHEEL,activityFlag,&wheelInterested,cb);
processList(CIntObject::DOUBLECLICK,activityFlag,&doubleClickInterested,cb);
#ifndef VCMI_SDL1
processList(CIntObject::TEXTINPUT,activityFlag,&textInterested,cb);
#endif // VCMI_SDL1
}
void CGuiHandler::handleElementActivate(CIntObject * elem, ui16 activityFlag)
@@ -197,9 +194,7 @@ void CGuiHandler::handleEvent(SDL_Event *sEvent)
if(key.keysym.sym == SDLK_KP_ENTER)
{
key.keysym.sym = (SDLKey)SDLK_RETURN;
#ifndef VCMI_SDL1
key.keysym.scancode = SDL_SCANCODE_RETURN;
#endif // VCMI_SDL1
}
bool keysCaptured = false;
@@ -271,7 +266,6 @@ void CGuiHandler::handleEvent(SDL_Event *sEvent)
}
}
}
#ifndef VCMI_SDL1 //SDL2x only events
else if (sEvent->type == SDL_MOUSEWHEEL)
{
std::list<CIntObject*> 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<CIntObject*> hlp = lclickable;
@@ -330,7 +323,6 @@ void CGuiHandler::handleEvent(SDL_Event *sEvent)
}
}
current = nullptr;
} //event end
void CGuiHandler::handleMouseMotion(SDL_Event *sEvent)
+3 -4
View File
@@ -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<void (std::list<CIntObject*> *)> cb);
public:
-2
View File
@@ -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
-4
View File
@@ -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)
-5
View File
@@ -10,15 +10,10 @@
#pragma once
#include <SDL_version.h>
#ifndef VCMI_SDL1
#include <SDL_render.h>
#endif
#include <SDL_video.h>
#include <SDL_events.h>
#include "../../lib/int3.h"
//#include "../Graphics.h"
#include "Geometries.h"
#include "../../lib/GameConstants.h"