FEAT:Raspberry PI cursor in tweaks
This commit is contained in:
@@ -152,6 +152,7 @@ options.group.graphics=Graphics
|
|||||||
options.group.tweaks=Tweaks
|
options.group.tweaks=Tweaks
|
||||||
options.allowSprint=Allow sprint
|
options.allowSprint=Allow sprint
|
||||||
options.barOnTop=HUD above inventory
|
options.barOnTop=HUD above inventory
|
||||||
|
options.rpiCursor=Show Raspberry PI cursor
|
||||||
options.autojump=Auto Jump
|
options.autojump=Auto Jump
|
||||||
options.thirdperson=Third Person
|
options.thirdperson=Third Person
|
||||||
options.servervisible=Server Visible
|
options.servervisible=Server Visible
|
||||||
|
|||||||
@@ -74,6 +74,8 @@ public:
|
|||||||
virtual TextureData loadTextureFromMemory(const unsigned char* data, size_t size) { return TextureData(); }
|
virtual TextureData loadTextureFromMemory(const unsigned char* data, size_t size) { return TextureData(); }
|
||||||
|
|
||||||
virtual void playSound(const std::string& fn, float volume, float pitch) {}
|
virtual void playSound(const std::string& fn, float volume, float pitch) {}
|
||||||
|
|
||||||
|
virtual void hideCursor(bool hide) {}
|
||||||
|
|
||||||
virtual void showDialog(int dialogId) {}
|
virtual void showDialog(int dialogId) {}
|
||||||
virtual void createUserInput() {}
|
virtual void createUserInput() {}
|
||||||
|
|||||||
@@ -139,6 +139,11 @@ public:
|
|||||||
|
|
||||||
virtual bool supportsTouchscreen() override { return true; }
|
virtual bool supportsTouchscreen() override { return true; }
|
||||||
|
|
||||||
|
virtual void hideCursor(bool hide) {
|
||||||
|
int isHide = hide ? GLFW_CURSOR_NORMAL : GLFW_CURSOR_HIDDEN;
|
||||||
|
glfwSetInputMode(window, GLFW_CURSOR, isHide);
|
||||||
|
}
|
||||||
|
|
||||||
virtual void openURL(const std::string& url) override {
|
virtual void openURL(const std::string& url) override {
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
ShellExecuteA(NULL, "open", url.c_str(), NULL, NULL, SW_SHOWNORMAL);
|
ShellExecuteA(NULL, "open", url.c_str(), NULL, NULL, SW_SHOWNORMAL);
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ OptionBool fixedCamera("fixedCamera", false);
|
|||||||
OptionBool isFlying("isflying", false);
|
OptionBool isFlying("isflying", false);
|
||||||
OptionBool barOnTop("barOnTop", false);
|
OptionBool barOnTop("barOnTop", false);
|
||||||
OptionBool allowSprint("allowSprint", true);
|
OptionBool allowSprint("allowSprint", true);
|
||||||
|
OptionBool rpiCursor("rpiCursor", false);
|
||||||
OptionBool autoJump("autoJump", true);
|
OptionBool autoJump("autoJump", true);
|
||||||
|
|
||||||
|
|
||||||
@@ -158,6 +159,7 @@ void Options::initTable() {
|
|||||||
|
|
||||||
m_options[OPTIONS_BAR_ON_TOP] = &barOnTop;
|
m_options[OPTIONS_BAR_ON_TOP] = &barOnTop;
|
||||||
m_options[OPTIONS_ALLOW_SPRINT] = &allowSprint;
|
m_options[OPTIONS_ALLOW_SPRINT] = &allowSprint;
|
||||||
|
m_options[OPTIONS_RPI_CURSOR] = &rpiCursor;
|
||||||
|
|
||||||
m_options[OPTIONS_AUTOJUMP] = &autoJump;
|
m_options[OPTIONS_AUTOJUMP] = &autoJump;
|
||||||
m_options[OPTIONS_LAST_IP] = &lastIp;
|
m_options[OPTIONS_LAST_IP] = &lastIp;
|
||||||
|
|||||||
@@ -83,6 +83,7 @@ enum OptionId {
|
|||||||
OPTIONS_FIRST_LAUNCH,
|
OPTIONS_FIRST_LAUNCH,
|
||||||
OPTIONS_LAST_IP,
|
OPTIONS_LAST_IP,
|
||||||
|
|
||||||
|
OPTIONS_RPI_CURSOR,
|
||||||
// Should be last!
|
// Should be last!
|
||||||
OPTIONS_COUNT
|
OPTIONS_COUNT
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -225,7 +225,8 @@ void OptionsScreen::generateOptionScreens() {
|
|||||||
.addOptionItem(OPTIONS_AMBIENT_OCCLUSION, minecraft);
|
.addOptionItem(OPTIONS_AMBIENT_OCCLUSION, minecraft);
|
||||||
|
|
||||||
optionPanes[4]->addOptionItem(OPTIONS_ALLOW_SPRINT, minecraft)
|
optionPanes[4]->addOptionItem(OPTIONS_ALLOW_SPRINT, minecraft)
|
||||||
.addOptionItem(OPTIONS_BAR_ON_TOP, minecraft);
|
.addOptionItem(OPTIONS_BAR_ON_TOP, minecraft)
|
||||||
|
.addOptionItem(OPTIONS_RPI_CURSOR, minecraft);
|
||||||
}
|
}
|
||||||
|
|
||||||
void OptionsScreen::mouseClicked(int x, int y, int buttonNum) {
|
void OptionsScreen::mouseClicked(int x, int y, int buttonNum) {
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
#include "GameRenderer.h"
|
#include "GameRenderer.h"
|
||||||
|
#include "client/Options.h"
|
||||||
#include "gles.h"
|
#include "gles.h"
|
||||||
|
|
||||||
#include "../../util/PerfTimer.h"
|
#include "../../util/PerfTimer.h"
|
||||||
@@ -214,12 +215,14 @@ void GameRenderer::render(float a) {
|
|||||||
glDisable2(GL_SCISSOR_TEST);
|
glDisable2(GL_SCISSOR_TEST);
|
||||||
|
|
||||||
mc->screen->render(xMouse, yMouse, a);
|
mc->screen->render(xMouse, yMouse, a);
|
||||||
#ifdef RPI
|
|
||||||
|
mc->platform()->hideCursor(!mc->options.getBooleanValue(OPTIONS_RPI_CURSOR));
|
||||||
|
if (mc->options.getBooleanValue(OPTIONS_RPI_CURSOR))
|
||||||
renderCursor(xMouse, yMouse, mc);
|
renderCursor(xMouse, yMouse, mc);
|
||||||
#endif
|
|
||||||
// Screen might have been removed, so check it again
|
// Screen might have been removed, so check it again
|
||||||
if (mc->screen && !mc->screen->isInGameScreen())
|
if (mc->screen && !mc->screen->isInGameScreen())
|
||||||
sleepMs(15);
|
sleepMs(15);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -166,7 +166,7 @@ int main(void) {
|
|||||||
|
|
||||||
AppPlatform_glfw* platform = (AppPlatform_glfw*)appContext.platform;
|
AppPlatform_glfw* platform = (AppPlatform_glfw*)appContext.platform;
|
||||||
|
|
||||||
platform->window = glfwCreateWindow(appContext.platform->getScreenWidth(), appContext.platform->getScreenHeight(), "main", NULL, NULL);
|
platform->window = glfwCreateWindow(appContext.platform->getScreenWidth(), appContext.platform->getScreenHeight(), "Minecraft PE 0.6.1", NULL, NULL);
|
||||||
|
|
||||||
if (platform->window == NULL) {
|
if (platform->window == NULL) {
|
||||||
return 1;
|
return 1;
|
||||||
|
|||||||
Reference in New Issue
Block a user