mirror of
https://github.com/vcmi/vcmi.git
synced 2025-03-19 21:10:12 +02:00
SDL1 wipe, part 2. Untested.
This commit is contained in:
parent
dca1e28bc1
commit
b6a2323e01
@ -266,9 +266,7 @@ void Graphics::loadHeroFlagsDetail(std::pair<std::vector<CDefEssential *> Graphi
|
||||
for(auto & curImg : curImgs)
|
||||
{
|
||||
CSDL_Ext::setDefaultColorKey(curImg.bitmap);
|
||||
#ifndef VCMI_SDL1
|
||||
SDL_SetSurfaceBlendMode(curImg.bitmap,SDL_BLENDMODE_NONE);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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);
|
||||
|
@ -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)
|
||||
|
@ -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:
|
||||
|
@ -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
|
||||
|
@ -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)
|
||||
|
@ -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"
|
||||
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user