From 9d592045317ca66be415e60ba4c2db90b5d7ad3e Mon Sep 17 00:00:00 2001 From: Piotr Dziwinski Date: Mon, 23 Jul 2012 21:41:27 +0200 Subject: Cursor drawing - fixed cursor drawing in CEngine - changed event loop to generate more events --- src/graphics/common/engine.h | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) (limited to 'src/graphics/common/engine.h') diff --git a/src/graphics/common/engine.h b/src/graphics/common/engine.h index b1510fd..de4a115 100644 --- a/src/graphics/common/engine.h +++ b/src/graphics/common/engine.h @@ -360,6 +360,7 @@ enum EngineTextureMapping ENG_TEX_MAPPING_1Z = 6 }; + /** \enum EngineRenderState \brief Render state of graphics engine @@ -408,6 +409,7 @@ enum EngineRenderState ENG_RSTATE_TCOLOR_WHITE = (1<<17) }; + /** \enum EngineMouseType \brief Type of mouse cursor displayed in-game */ @@ -452,6 +454,39 @@ enum EngineMouseType ENG_MOUSE_COUNT }; +/** + \struct EngineMouse + \brief Information about mouse cursor */ +struct EngineMouse +{ + //! Index of texture element for 1st image + int icon1; + //! Index of texture element for 2nd image + int icon2; + //! Shadow texture part + int iconShadow; + //! Mode to render 1st image in + Gfx::EngineRenderState mode1; + //! Mode to render 2nd image in + Gfx::EngineRenderState mode2; + //! Hot point + Math::Point hotPoint; + + EngineMouse(int icon1 = -1, int icon2 = -1, int iconShadow = -1, + Gfx::EngineRenderState mode1 = Gfx::ENG_RSTATE_NORMAL, + Gfx::EngineRenderState mode2 = Gfx::ENG_RSTATE_NORMAL, + Math::Point hotPoint = Math::Point()) + { + this->icon1 = icon1; + this->icon2 = icon2; + this->iconShadow = iconShadow; + this->mode1 = mode1; + this->mode2 = mode2; + this->hotPoint = hotPoint; + } +}; + + /** \class CEngine \brief The graphics engine @@ -934,6 +969,8 @@ protected: std::map m_texNameMap; std::map m_revTexNameMap; + Gfx::EngineMouse m_mice[Gfx::ENG_MOUSE_COUNT]; + Math::Point m_mouseSize; Gfx::EngineMouseType m_mouseType; Math::Point m_mousePos; bool m_mouseVisible; -- cgit v1.2.3-1-g7c22