1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-01-24 03:47:18 +02:00

Mobile platforms will use software cursor as default

This commit is contained in:
Ivan Savenko 2023-01-19 18:14:51 +02:00
parent f5a7f5173f
commit 5484efde90

View File

@ -4,30 +4,39 @@
* Authors: listed in file AUTHORS in main folder
*
* License: GNU General Public License v2.0 or later
* Full text of license available in license.txt file, in main folder
*
*/
#include "StdInc.h"
#include "CursorHandler.h"
* Full text of license available in license.txt file, in main folder
*
*/
#include "StdInc.h"
#include "CursorHandler.h"
#include <SDL.h>
#include "SDL_Extensions.h"
#include "CGuiHandler.h"
#include "CAnimation.h"
#include "../../lib/CConfigHandler.h"
//#include "../CMT.h"
std::unique_ptr<ICursor> CursorHandler::createCursor()
{
if (settings["video"]["softwareCursor"].Bool())
return std::make_unique<CursorSoftware>();
else
return std::make_unique<CursorHardware>();
}
CursorHandler::CursorHandler()
#include "CAnimation.h"
#include "../../lib/CConfigHandler.h"
std::unique_ptr<ICursor> CursorHandler::createCursor()
{
if (settings["video"]["cursor"].String() == "auto")
{
#if defined(VCMI_ANDROID) || defined(VCMI_IOS)
return std::make_unique<CursorSoftware>();
#else
return std::make_unique<CursorHardware>();
#endif
}
if (settings["video"]["cursor"].String() == "hardware")
return std::make_unique<CursorHardware>();
assert(settings["video"]["cursor"].String() == "software");
return std::make_unique<CursorSoftware>();
}
CursorHandler::CursorHandler()
: cursor(createCursor())
, frameTime(0.f)
, showing(false)