mirror of
https://port.numenaute.org/aleajactaest/khanat-opennel-code.git
synced 2024-11-18 05:11:42 +00:00
Fixed: #1034 Implement CCustomMouse for Linux
This commit is contained in:
parent
42b7d0148b
commit
19191f88f4
9 changed files with 28 additions and 8 deletions
|
@ -173,7 +173,7 @@ CDriverD3D::CDriverD3D()
|
||||||
_CurrRot = 0;
|
_CurrRot = 0;
|
||||||
_CurrHotSpotX = 0;
|
_CurrHotSpotX = 0;
|
||||||
_CurrHotSpotY = 0;
|
_CurrHotSpotY = 0;
|
||||||
_CursorScale = 0.85f;
|
_CursorScale = 1.f;
|
||||||
|
|
||||||
_UserViewMtx.identity();
|
_UserViewMtx.identity();
|
||||||
_UserModelMtx.identity();
|
_UserModelMtx.identity();
|
||||||
|
|
|
@ -923,14 +923,15 @@ public:
|
||||||
// see if system cursor is currently captured
|
// see if system cursor is currently captured
|
||||||
virtual bool isSystemCursorCaptured();
|
virtual bool isSystemCursorCaptured();
|
||||||
|
|
||||||
virtual void setHardwareCursorScale(float scale) { _CursorScale = scale; }
|
|
||||||
|
|
||||||
// Add a new cursor (name is case unsensitive)
|
// Add a new cursor (name is case unsensitive)
|
||||||
virtual void addCursor(const std::string &name, const NLMISC::CBitmap &bitmap);
|
virtual void addCursor(const std::string &name, const NLMISC::CBitmap &bitmap);
|
||||||
|
|
||||||
// Display a cursor from its name (case unsensitive)
|
// Display a cursor from its name (case unsensitive)
|
||||||
virtual void setCursor(const std::string &name, NLMISC::CRGBA col, uint8 rot, sint hotSpotX, sint hotSpotY, bool forceRebuild = false);
|
virtual void setCursor(const std::string &name, NLMISC::CRGBA col, uint8 rot, sint hotSpotX, sint hotSpotY, bool forceRebuild = false);
|
||||||
|
|
||||||
|
// Change default scale for all cursors
|
||||||
|
virtual void setCursorScale(float scale);
|
||||||
|
|
||||||
virtual NLMISC::IMouseDevice *enableLowLevelMouse(bool enable, bool exclusive);
|
virtual NLMISC::IMouseDevice *enableLowLevelMouse(bool enable, bool exclusive);
|
||||||
virtual NLMISC::IKeyboardDevice *enableLowLevelKeyboard(bool enable);
|
virtual NLMISC::IKeyboardDevice *enableLowLevelKeyboard(bool enable);
|
||||||
virtual NLMISC::IInputDeviceManager *getLowLevelInputDeviceManager();
|
virtual NLMISC::IInputDeviceManager *getLowLevelInputDeviceManager();
|
||||||
|
|
|
@ -300,6 +300,12 @@ void CDriverD3D::setCursor(const std::string &name, NLMISC::CRGBA col, uint8 rot
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// *************************************************************************************
|
||||||
|
void CDriverD3D::setCursorScale(float scale)
|
||||||
|
{
|
||||||
|
_CursorScale = scale;
|
||||||
|
}
|
||||||
|
|
||||||
// *************************************************************************************
|
// *************************************************************************************
|
||||||
nlCursor CDriverD3D::buildCursor(const CBitmap &src, NLMISC::CRGBA col, uint8 rot, sint hotSpotX, sint hotSpotY)
|
nlCursor CDriverD3D::buildCursor(const CBitmap &src, NLMISC::CRGBA col, uint8 rot, sint hotSpotX, sint hotSpotY)
|
||||||
{
|
{
|
||||||
|
|
|
@ -223,7 +223,7 @@ CDriverGL::CDriverGL()
|
||||||
_CurrRot = 0;
|
_CurrRot = 0;
|
||||||
_CurrHotSpotX = 0;
|
_CurrHotSpotX = 0;
|
||||||
_CurrHotSpotY = 0;
|
_CurrHotSpotY = 0;
|
||||||
_CursorScale = 0.85f;
|
_CursorScale = 1.f;
|
||||||
_MouseCaptured = false;
|
_MouseCaptured = false;
|
||||||
|
|
||||||
_NeedToRestaureGammaRamp = false;
|
_NeedToRestaureGammaRamp = false;
|
||||||
|
|
|
@ -523,14 +523,15 @@ public:
|
||||||
// see if system cursor is currently captured
|
// see if system cursor is currently captured
|
||||||
virtual bool isSystemCursorCaptured();
|
virtual bool isSystemCursorCaptured();
|
||||||
|
|
||||||
virtual void setHardwareCursorScale(float scale) { _CursorScale = scale; }
|
|
||||||
|
|
||||||
// Add a new cursor (name is case unsensitive)
|
// Add a new cursor (name is case unsensitive)
|
||||||
virtual void addCursor(const std::string &name, const NLMISC::CBitmap &bitmap);
|
virtual void addCursor(const std::string &name, const NLMISC::CBitmap &bitmap);
|
||||||
|
|
||||||
// Display a cursor from its name (case unsensitive)
|
// Display a cursor from its name (case unsensitive)
|
||||||
virtual void setCursor(const std::string &name, NLMISC::CRGBA col, uint8 rot, sint hotSpotX, sint hotSpotY, bool forceRebuild = false);
|
virtual void setCursor(const std::string &name, NLMISC::CRGBA col, uint8 rot, sint hotSpotX, sint hotSpotY, bool forceRebuild = false);
|
||||||
|
|
||||||
|
// Change default scale for all cursors
|
||||||
|
virtual void setCursorScale(float scale);
|
||||||
|
|
||||||
virtual NLMISC::IMouseDevice *enableLowLevelMouse(bool enable, bool exclusive);
|
virtual NLMISC::IMouseDevice *enableLowLevelMouse(bool enable, bool exclusive);
|
||||||
|
|
||||||
virtual NLMISC::IKeyboardDevice *enableLowLevelKeyboard(bool enable);
|
virtual NLMISC::IKeyboardDevice *enableLowLevelKeyboard(bool enable);
|
||||||
|
|
|
@ -367,6 +367,12 @@ void CDriverGL::setCursor(const std::string &name, NLMISC::CRGBA col, uint8 rot,
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// *************************************************************************************
|
||||||
|
void CDriverGL::setCursorScale(float scale)
|
||||||
|
{
|
||||||
|
_CursorScale = scale;
|
||||||
|
}
|
||||||
|
|
||||||
// *************************************************************************************
|
// *************************************************************************************
|
||||||
nlCursor CDriverGL::buildCursor(const CBitmap &src, NLMISC::CRGBA col, uint8 rot, sint hotSpotX, sint hotSpotY)
|
nlCursor CDriverGL::buildCursor(const CBitmap &src, NLMISC::CRGBA col, uint8 rot, sint hotSpotX, sint hotSpotY)
|
||||||
{
|
{
|
||||||
|
|
|
@ -1664,6 +1664,13 @@ void CDriverUser::setCursor(const std::string &name, NLMISC::CRGBA col, uint8
|
||||||
_Driver->setCursor(name, col, rot, hotSpotX, hotSpotY, forceRebuild);
|
_Driver->setCursor(name, col, rot, hotSpotX, hotSpotY, forceRebuild);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CDriverUser::setCursorScale(float scale)
|
||||||
|
{
|
||||||
|
NL3D_HAUTO_UI_DRIVER;
|
||||||
|
|
||||||
|
_Driver->setCursorScale(scale);
|
||||||
|
}
|
||||||
|
|
||||||
// ***************************************************************************
|
// ***************************************************************************
|
||||||
// ***************************************************************************
|
// ***************************************************************************
|
||||||
// Async Texture loading mgt
|
// Async Texture loading mgt
|
||||||
|
|
|
@ -157,7 +157,6 @@ void CInputHandlerManager::operator ()(const NLMISC::CEvent &event)
|
||||||
_MouseButtonsReleased = noButton;
|
_MouseButtonsReleased = noButton;
|
||||||
_MouseButtonsState = noButton;
|
_MouseButtonsState = noButton;
|
||||||
_Focus = false;
|
_Focus = false;
|
||||||
// Driver->setFocus(false);
|
|
||||||
|
|
||||||
if (!_SkipInterfaceManager)
|
if (!_SkipInterfaceManager)
|
||||||
{
|
{
|
||||||
|
|
|
@ -729,7 +729,7 @@ void CViewRenderer::loadTextures (const std::string &textureFileName, const std:
|
||||||
|
|
||||||
_GlobalTextures.push_back (gt);
|
_GlobalTextures.push_back (gt);
|
||||||
|
|
||||||
// Driver->setHardwareCursorScale(ClientCfg.HardwareCursorScale);
|
Driver->setCursorScale(ClientCfg.HardwareCursorScale);
|
||||||
|
|
||||||
char bufTmp[256], tgaName[256];
|
char bufTmp[256], tgaName[256];
|
||||||
string sTGAname;
|
string sTGAname;
|
||||||
|
|
Loading…
Reference in a new issue