summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVasily <danilka.pro@gmail.com>2015-12-10 00:54:50 +0300
committerAndrei Karas <akaras@inbox.ru>2015-12-10 01:33:59 +0300
commit70700509ee969b58c6110310f5a962dcff854d6e (patch)
treebec778155783fcf7e2a38ec11c81202a6a2c1849
parent7d3ef8d375defc9fb7efb4e48b72a6f4f9b98c16 (diff)
downloadmanaverse-70700509ee969b58c6110310f5a962dcff854d6e.tar.gz
manaverse-70700509ee969b58c6110310f5a962dcff854d6e.tar.bz2
manaverse-70700509ee969b58c6110310f5a962dcff854d6e.tar.xz
manaverse-70700509ee969b58c6110310f5a962dcff854d6e.zip
Implemented NaCl cursor hiding, custom cursor is supported now
-rw-r--r--src/defaults.cpp4
-rw-r--r--src/gui/gui.cpp19
2 files changed, 19 insertions, 4 deletions
diff --git a/src/defaults.cpp b/src/defaults.cpp
index 45cec23a8..a301d2323 100644
--- a/src/defaults.cpp
+++ b/src/defaults.cpp
@@ -139,11 +139,7 @@ DefaultsData* getConfigDefaults()
AddDEF("fpslimit", 60);
AddDEF("theme", "");
AddDEF("showChatColorsList", true);
-#ifdef __native_client__
- AddDEF("customcursor", false);
-#else
AddDEF("customcursor", true);
-#endif
AddDEF("showDidYouKnow", true);
AddDEF("longmouseclick", false);
#endif
diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp
index ea527e3ef..f7878a55f 100644
--- a/src/gui/gui.cpp
+++ b/src/gui/gui.cpp
@@ -98,6 +98,13 @@
#include "net/ipc.h"
+#ifdef __native_client__
+#include <ppapi/c/ppb_mouse_cursor.h>
+#include <ppapi/cpp/instance.h>
+#include <ppapi/cpp/mouse_cursor.h>
+#include <ppapi_simple/ps.h>
+#endif
+
#include "debug.h"
Gui *gui = nullptr;
@@ -533,6 +540,18 @@ void Gui::setUseCustomCursor(const bool customCursor)
{
mCustomCursor = customCursor;
+#ifdef __native_client__
+ PP_MouseCursor_Type cursor;
+ if (mCustomCursor)
+ cursor = PP_MOUSECURSOR_TYPE_NONE; // hide cursor
+ else
+ cursor = PP_MOUSECURSOR_TYPE_POINTER; // show default cursor
+
+ pp::MouseCursor::SetCursor(
+ pp::InstanceHandle(PSGetInstanceId()),
+ cursor);
+#endif
+
if (mCustomCursor)
{
// Hide the SDL mouse cursor