diff --git a/src/client/Minecraft.cpp b/src/client/Minecraft.cpp index 3c6b368..ccd9ba5 100755 --- a/src/client/Minecraft.cpp +++ b/src/client/Minecraft.cpp @@ -855,11 +855,18 @@ void Minecraft::tickInput() { gameMode->stopDestroyBlock(); } + if (!Mouse::isButtonDown(MouseAction::ACTION_RIGHT)) { + gameMode->releaseUsingItem(player); + } + if (useTouchscreen()) { // Touch: gesture recognizer classifies the action type (turn/destroy/build) BuildActionIntention bai; + if (inputHolder && inputHolder->getBuildInput()->tickBuild(player, &bai)) { handleBuildAction(&bai); + } else { + gameMode->stopDestroyBlock(); } } else { // Desktop: left mouse = destroy/attack diff --git a/src/client/Minecraft.h b/src/client/Minecraft.h index cd9dcce..1a90b12 100755 --- a/src/client/Minecraft.h +++ b/src/client/Minecraft.h @@ -109,6 +109,8 @@ public: bool isLevelGenerated(); + void handleMouseDown(int button, bool down); + void audioEngineOn(); void audioEngineOff(); diff --git a/src/client/gui/screens/OptionsScreen.cpp b/src/client/gui/screens/OptionsScreen.cpp index a7875dd..11b87c1 100755 --- a/src/client/gui/screens/OptionsScreen.cpp +++ b/src/client/gui/screens/OptionsScreen.cpp @@ -19,7 +19,6 @@ OptionsScreen::OptionsScreen() } OptionsScreen::~OptionsScreen() { - if (btnClose != NULL) { delete btnClose; btnClose = NULL; @@ -53,7 +52,6 @@ OptionsScreen::~OptionsScreen() { } void OptionsScreen::init() { - bHeader = new Touch::THeader(0, "Options"); btnClose = new ImageButton(1, ""); @@ -89,7 +87,6 @@ void OptionsScreen::init() { } void OptionsScreen::setupPositions() { - int buttonHeight = btnClose->height; btnClose->x = width - btnClose->width; @@ -134,7 +131,6 @@ void OptionsScreen::setupPositions() { void OptionsScreen::render(int xm, int ym, float a) { - renderBackground(); int xmm = xm * width / minecraft->width; @@ -150,7 +146,6 @@ void OptionsScreen::removed() { } void OptionsScreen::buttonClicked(Button* button) { - if (button == btnClose) { minecraft->options.save(); if (minecraft->screen != NULL) { @@ -169,7 +164,6 @@ void OptionsScreen::buttonClicked(Button* button) { } void OptionsScreen::selectCategory(int index) { - int currentIndex = 0; for (std::vector::iterator it = categoryButtons.begin(); it != categoryButtons.end(); ++it) { @@ -235,7 +229,6 @@ void OptionsScreen::generateOptionScreens() { } void OptionsScreen::mouseClicked(int x, int y, int buttonNum) { - if (currentOptionsGroup != NULL) currentOptionsGroup->mouseClicked(minecraft, x, y, buttonNum); @@ -243,7 +236,6 @@ void OptionsScreen::mouseClicked(int x, int y, int buttonNum) { } void OptionsScreen::mouseReleased(int x, int y, int buttonNum) { - if (currentOptionsGroup != NULL) currentOptionsGroup->mouseReleased(minecraft, x, y, buttonNum); diff --git a/src/client/player/input/touchscreen/TouchscreenInput.cpp b/src/client/player/input/touchscreen/TouchscreenInput.cpp index 41474f3..37cb6d8 100755 --- a/src/client/player/input/touchscreen/TouchscreenInput.cpp +++ b/src/client/player/input/touchscreen/TouchscreenInput.cpp @@ -164,7 +164,7 @@ void TouchscreenInput_TestFps::onConfigChanged(const Config& c) { float maxPixels = _minecraft->pixelCalc.millimetersToPixels(10); // float btnSize = Mth::Min(18 * Gui::GuiScale, maxPixels); - float btnSize = pc.millimetersToPixels(50); + float btnSize = pc.millimetersToPixels(18 * Gui::GuiScale); _model.addArea(AREA_PAUSE, aPause = new RectangleArea(w - 4 - btnSize, 4, w - 4, 4 + btnSize)); _model.addArea(AREA_CHAT, aChat = new RectangleArea(w - 8 - btnSize * 2, 4, w - 8 - btnSize, 4 + btnSize)); @@ -320,6 +320,7 @@ void TouchscreenInput_TestFps::tick( Player* player ) if (Multitouch::isReleased(p)) { _minecraft->soundEngine->playUI("random.click", 1, 1); _minecraft->screenChooser.setScreen(SCREEN_CONSOLE); + _minecraft->platform()->showKeyboard(); } } diff --git a/src/client/renderer/entity/PlayerRenderer.cpp b/src/client/renderer/entity/PlayerRenderer.cpp index 6a773f0..96ee2eb 100755 --- a/src/client/renderer/entity/PlayerRenderer.cpp +++ b/src/client/renderer/entity/PlayerRenderer.cpp @@ -17,8 +17,8 @@ PlayerRenderer::PlayerRenderer( HumanoidModel* humanoidModel, float shadow ) : super(humanoidModel, shadow), playerModel64(humanoidModel), playerModel32(new HumanoidModel(0, 0, 64, 32)), - armorParts1(new HumanoidModel(1.0f, 0, 64, 64)), - armorParts2(new HumanoidModel(0.5f, 0, 64, 64)) + armorParts1(new HumanoidModel(1.0f, 0, 64, 32)), + armorParts2(new HumanoidModel(0.5f, 0, 64, 32)) { // default to legacy skin path until we know the exact texture size model = playerModel32; @@ -77,10 +77,10 @@ void PlayerRenderer::render(Entity* mob_, float x, float y, float z, float rot, model = desired; humanoidModel = desired; } - // LOGI("[PlayerRenderer] %s: skin=%s, modelTex=%dx%d, desired=%s\n", - // ((Player*)mob)->name.c_str(), mob->getTexture().c_str(), - // humanoidModel->texWidth, humanoidModel->texHeight, - // (desired == playerModel64 ? "64" : "32")); + LOGI("[PlayerRenderer] %s: skin=%s, modelTex=%dx%d, desired=%s\n", + ((Player*)mob)->name.c_str(), mob->getTexture().c_str(), + humanoidModel->texWidth, humanoidModel->texHeight, + (desired == playerModel64 ? "64" : "32")); HumanoidMobRenderer::render(mob_, x, y, z, rot, a); }