From: <Kha...@us...> - 2009-11-23 21:29:15
|
Revision: 4778 http://planeshift.svn.sourceforge.net/planeshift/?rev=4778&view=rev Author: Khakilord Date: 2009-11-23 21:29:05 +0000 (Mon, 23 Nov 2009) Log Message: ----------- Added basic hardware mouse cursor support for Linux and Mac, enabled via PlaneShift.GUI.BasicCursor Modified Paths: -------------- trunk/src/common/paws/pawsmouse.cpp trunk/src/common/paws/pawsmouse.h Modified: trunk/src/common/paws/pawsmouse.cpp =================================================================== --- trunk/src/common/paws/pawsmouse.cpp 2009-11-23 18:57:32 UTC (rev 4777) +++ trunk/src/common/paws/pawsmouse.cpp 2009-11-23 21:29:05 UTC (rev 4778) @@ -27,6 +27,7 @@ #include <igraphic/imageio.h> #include <iutil/vfs.h> #include <csutil/databuf.h> +#include <csutil/cfgmgr.h> #include "pawsmouse.h" #include "pawsmanager.h" @@ -49,6 +50,9 @@ crosshair = false; crosshairImage = PawsManager::GetSingleton().GetTextureManager()->GetPawsImage("Crosshair Mouse Pointer"); useOS = false; + csRef<iConfigManager> cfg = csQueryRegistry<iConfigManager> (PawsManager::GetSingleton().GetObjectRegistry()); + basicCursor = cfg->GetBool("PlaneShift.GUI.BasicCursor"); + } pawsMouse::~pawsMouse() @@ -66,6 +70,12 @@ void pawsMouse::ChangeImage( const char* imageName ) { + if(basicCursor) + { + graphics3D->GetDriver2D()->SetMouseCursor(csmcArrow); + useOS = true; + return; + } cursorImage = PawsManager::GetSingleton().GetTextureManager()->GetPawsImage(imageName); if (!cursorImage.IsValid()) { @@ -77,6 +87,12 @@ void pawsMouse::ChangeImage(csRef<iPawsImage> drawable) { + if(basicCursor) + { + graphics3D->GetDriver2D()->SetMouseCursor(csmcArrow); + useOS = true; + return; + } cursorImage = drawable; SetOSMouse(cursorImage); } @@ -122,14 +138,19 @@ void pawsMouse::Hide(bool h) { hidden = h; -#ifdef CS_PLATFORM_WIN32 - if (h) - graphics3D->GetDriver2D()->SetMouseCursor (csmcNone); - else - if (useOS) + if(useOS) + { + if (h) + graphics3D->GetDriver2D()->SetMouseCursor (csmcNone); + else { - csRGBcolor color(transparentR, transparentG, transparentB); - graphics3D->GetDriver2D()->SetMouseCursor (image, &color); + if(basicCursor) + graphics3D->GetDriver2D()->SetMouseCursor(csmcArrow); + else + { + csRGBcolor color(transparentR, transparentG, transparentB); + graphics3D->GetDriver2D()->SetMouseCursor (image, &color); + } } -#endif + } } Modified: trunk/src/common/paws/pawsmouse.h =================================================================== --- trunk/src/common/paws/pawsmouse.h 2009-11-23 18:57:32 UTC (rev 4777) +++ trunk/src/common/paws/pawsmouse.h 2009-11-23 21:29:05 UTC (rev 4778) @@ -91,6 +91,7 @@ bool hidden, crosshair; bool useOS; + bool basicCursor; int transparentR; int transparentG; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |