瀏覽代碼

Remove unused default cursor

Ivan Savenko 3 月之前
父節點
當前提交
a53aadf53a
共有 2 個文件被更改,包括 2 次插入22 次删除
  1. 2 12
      client/gui/CursorHandler.cpp
  2. 0 10
      client/gui/CursorHandler.h

+ 2 - 12
client/gui/CursorHandler.cpp

@@ -42,7 +42,8 @@ CursorHandler::CursorHandler()
 	, showing(false)
 	, pos(0,0)
 	, dndObject(nullptr)
-	, type(Cursor::Type::DEFAULT)
+	, type(Cursor::Type::ADVENTURE)
+	, frame(0)
 {
 	showType = dynamic_cast<CursorSoftware *>(cursor.get()) ? Cursor::ShowType::SOFTWARE : Cursor::ShowType::HARDWARE;
 }
@@ -75,11 +76,6 @@ void CursorHandler::changeGraphic(Cursor::Type type, size_t index)
 	cursor->setImage(getCurrentImage(), getPivotOffset());
 }
 
-void CursorHandler::set(Cursor::Default index)
-{
-	changeGraphic(Cursor::Type::DEFAULT, static_cast<size_t>(index));
-}
-
 void CursorHandler::set(Cursor::Map index)
 {
 	changeGraphic(Cursor::Type::ADVENTURE, static_cast<size_t>(index));
@@ -116,11 +112,6 @@ void CursorHandler::cursorMove(const int & x, const int & y)
 	cursor->setCursorPosition(pos);
 }
 
-Point CursorHandler::getPivotOffsetDefault(size_t index)
-{
-	return {0, 0};
-}
-
 Point CursorHandler::getPivotOffsetMap(size_t index)
 {
 	static const std::array<Point, 43> offsets = {{
@@ -224,7 +215,6 @@ Point CursorHandler::getPivotOffset()
 	switch (type) {
 	case Cursor::Type::ADVENTURE: return getPivotOffsetMap(frame);
 	case Cursor::Type::COMBAT:    return getPivotOffsetCombat(frame);
-	case Cursor::Type::DEFAULT:   return getPivotOffsetDefault(frame);
 	case Cursor::Type::SPELLBOOK: return getPivotOffsetSpellcast();
 	};
 

+ 0 - 10
client/gui/CursorHandler.h

@@ -21,7 +21,6 @@ namespace Cursor
 	enum class Type {
 		ADVENTURE, // set of various cursors for adventure map
 		COMBAT,    // set of various cursors for combat
-		DEFAULT,   // default arrow and hourglass cursors
 		SPELLBOOK  // animated cursor for spellcasting
 	};
 
@@ -30,12 +29,6 @@ namespace Cursor
 		HARDWARE
 	};
 
-	enum class Default {
-		POINTER      = 0,
-		//ARROW_COPY = 1, // probably unused
-		HOURGLASS  = 2,
-	};
-
 	enum class Combat {
 		BLOCKED        = 0,
 		MOVE           = 1,
@@ -154,7 +147,6 @@ public:
 	void dragAndDropCursor(const AnimationPath & path, size_t index);
 
 	/// Changes cursor to specified index
-	void set(Cursor::Default index);
 	void set(Cursor::Map index);
 	void set(Cursor::Combat index);
 	void set(Cursor::Spellcast index);
@@ -165,7 +157,6 @@ public:
 	{
 		bool typeValid = true;
 
-		typeValid &= (std::is_same<Index, Cursor::Default>::value   )|| type != Cursor::Type::DEFAULT;
 		typeValid &= (std::is_same<Index, Cursor::Map>::value       )|| type != Cursor::Type::ADVENTURE;
 		typeValid &= (std::is_same<Index, Cursor::Combat>::value    )|| type != Cursor::Type::COMBAT;
 		typeValid &= (std::is_same<Index, Cursor::Spellcast>::value )|| type != Cursor::Type::SPELLBOOK;
@@ -176,7 +167,6 @@ public:
 	}
 
 	Point getPivotOffsetSpellcast();
-	Point getPivotOffsetDefault(size_t index);
 	Point getPivotOffsetMap(size_t index);
 	Point getPivotOffsetCombat(size_t index);