mirror of
https://github.com/celisej567/mcpe.git
synced 2026-01-04 14:09:47 +03:00
Misc: various patches
This commit is contained in:
23
.gitignore
vendored
23
.gitignore
vendored
@@ -132,22 +132,41 @@ xcuserdata/
|
||||
|
||||
# Ignore original Minecraft PE assets.
|
||||
/game/assets/font/default.png
|
||||
/game/assets/font/default8.png
|
||||
/game/assets/gui/background.png
|
||||
/game/assets/gui/bg32.png
|
||||
/game/assets/gui/controls/dpad.png
|
||||
/game/assets/gui/controls/dpad_jump.png
|
||||
/game/assets/gui/controls/dpadbutton.png
|
||||
/game/assets/gui/selectworld/add.png
|
||||
/game/assets/gui/feedback_fill.png
|
||||
/game/assets/gui/feedback_outer.png
|
||||
/game/assets/gui/background.png
|
||||
/game/assets/gui/default_world.png
|
||||
/game/assets/gui/gui.png
|
||||
/game/assets/gui/gui_blocks.png
|
||||
/game/assets/gui/icons.png
|
||||
/game/assets/gui/itemframe.png
|
||||
/game/assets/gui/items.png
|
||||
/game/assets/gui/touchgui.png
|
||||
/game/assets/gui/title.png
|
||||
/game/assets/item/camera.png
|
||||
/game/assets/misc/foliagecolor.png
|
||||
/game/assets/misc/grasscolor.png
|
||||
/game/assets/mob/char.png
|
||||
/game/assets/particles.png
|
||||
/game/assets/terrain.png
|
||||
|
||||
# Ignore mobs
|
||||
/game/assets/mob/char.png
|
||||
/game/assets/mob/chicken.png
|
||||
/game/assets/mob/cow.png
|
||||
/game/assets/mob/creeper.png
|
||||
/game/assets/mob/pig.png
|
||||
/game/assets/mob/sheep_fur.png
|
||||
/game/assets/mob/sheep.png
|
||||
/game/assets/mob/skeleton.png
|
||||
/game/assets/mob/spider.png
|
||||
/game/assets/mob/zombie.png
|
||||
|
||||
# Ignore the panorama textures. Adding them yourself will make the title screen use them.
|
||||
/game/assets/gui/background/panorama_0.png
|
||||
/game/assets/gui/background/panorama_1.png
|
||||
|
||||
@@ -35,19 +35,19 @@ add_library( # Sets the name of the library.
|
||||
target_include_directories(reminecraftpe PUBLIC ${MC_ROOT} ${MC_ROOT}/source ${MC_ROOT}/thirdparty/raknet)
|
||||
|
||||
# Check for the presence of some optional asset based features.
|
||||
if(NOT EXISTS "${MC_ROOT}/game/assets/gui/background/panorama_0.png")
|
||||
if(EXISTS "${MC_ROOT}/game/assets/gui/background/panorama_0.png")
|
||||
target_compile_definitions(reminecraftpe PUBLIC FEATURE_MENU_BACKGROUND)
|
||||
endif()
|
||||
|
||||
if(NOT EXISTS "${MC_ROOT}/game/assets/environment/clouds.png")
|
||||
if(EXISTS "${MC_ROOT}/game/assets/environment/clouds.png")
|
||||
target_compile_definitions(reminecraftpe PUBLIC FEATURE_CLOUDS)
|
||||
endif()
|
||||
|
||||
if(NOT EXISTS "${MC_ROOT}/game/assets/misc/grasscolor.png")
|
||||
if(EXISTS "${MC_ROOT}/game/assets/misc/grasscolor.png")
|
||||
target_compile_definitions(reminecraftpe PUBLIC FEATURE_GRASS_COLOR)
|
||||
endif()
|
||||
|
||||
if(NOT EXISTS "${MC_ROOT}/game/assets/misc/foliagecolor.png")
|
||||
if(EXISTS "${MC_ROOT}/game/assets/misc/foliagecolor.png")
|
||||
target_compile_definitions(reminecraftpe PUBLIC FEATURE_FOLIAGE_COLOR)
|
||||
endif()
|
||||
|
||||
|
||||
@@ -17,6 +17,19 @@ AppPlatform_sdl::AppPlatform_sdl(std::string storageDir, SDL_Window *window)
|
||||
setIcon(AppPlatform_sdl::loadTexture("icon.png"));
|
||||
}
|
||||
|
||||
|
||||
std::string AppPlatform_sdl::getPatchData()
|
||||
{
|
||||
std::ifstream ifs("assets/patches/patch_data.txt");
|
||||
if (!ifs.is_open())
|
||||
return "";
|
||||
|
||||
std::stringstream ss;
|
||||
ss << ifs.rdbuf();
|
||||
|
||||
return ss.str();
|
||||
}
|
||||
|
||||
// Take Screenshot
|
||||
static int save_png(const char *filename, unsigned char *pixels, int line_size, int width, int height)
|
||||
{
|
||||
|
||||
@@ -18,6 +18,9 @@ public:
|
||||
|
||||
bool hasFileSystemAccess() override;
|
||||
|
||||
// Also add this to allow dynamic texture patching.
|
||||
std::string getPatchData() override;
|
||||
|
||||
protected:
|
||||
void ensureDirectoryExists(const char* path) override;
|
||||
};
|
||||
|
||||
@@ -394,7 +394,9 @@ int main(int argc, char *argv[])
|
||||
|
||||
if (!storagePath.empty())
|
||||
createFolderIfNotExists(storagePath.c_str());
|
||||
|
||||
|
||||
CheckOptionalTextureAvailability();
|
||||
|
||||
// Start MCPE
|
||||
g_pApp = new NinecraftApp;
|
||||
g_pApp->m_externalStorageDir = storagePath;
|
||||
@@ -402,8 +404,6 @@ int main(int argc, char *argv[])
|
||||
g_pApp->m_pPlatform = g_pAppPlatform;
|
||||
g_pApp->init();
|
||||
|
||||
CheckOptionalTextureAvailability();
|
||||
|
||||
// Set Size
|
||||
resize();
|
||||
|
||||
|
||||
@@ -89,10 +89,6 @@ bool IScreen::isInGameScreen()
|
||||
return true;
|
||||
}
|
||||
|
||||
void IScreen::confirmResult(bool b, int i)
|
||||
{
|
||||
}
|
||||
|
||||
void IScreen::charInput(char ch)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -33,7 +33,6 @@ public:
|
||||
virtual bool isPauseScreen();
|
||||
virtual bool isErrorScreen();
|
||||
virtual bool isInGameScreen();
|
||||
virtual void confirmResult(bool, int);
|
||||
virtual void charInput(char);
|
||||
|
||||
int m_width;
|
||||
|
||||
@@ -237,7 +237,7 @@ void Minecraft::setGuiScaleMultiplier(float f)
|
||||
|
||||
void Minecraft::handleMouseDown(int type, bool b)
|
||||
{
|
||||
if (!m_pGameMode->field_8 && (type != 1 || this->field_DA4 <= 0))
|
||||
if (type != BUTTON_LEFT || this->field_DA4 <= 0)
|
||||
{
|
||||
if (b && type == 1 && m_hitResult.m_hitType == HitResult::AABB && !m_hitResult.m_bUnk24)
|
||||
{
|
||||
@@ -698,56 +698,49 @@ void Minecraft::tick()
|
||||
m_pGui->onTick();
|
||||
|
||||
// if the level has been prepared, delete the prep thread
|
||||
if (!m_bPreparingLevel)
|
||||
if (m_bPreparingLevel) return;
|
||||
|
||||
if (m_pPrepThread)
|
||||
{
|
||||
if (m_pPrepThread)
|
||||
delete m_pPrepThread;
|
||||
m_pPrepThread = nullptr;
|
||||
_levelGenerated();
|
||||
}
|
||||
|
||||
SandTile::instaFall = false;
|
||||
|
||||
if (m_pLevel && !field_288)
|
||||
{
|
||||
m_pGameMode->tick();
|
||||
m_pGameRenderer->tick();
|
||||
m_pLevelRenderer->tick();
|
||||
m_pLevel->tickEntities();
|
||||
m_pLevel->tick();
|
||||
|
||||
if (m_pLocalPlayer)
|
||||
{
|
||||
delete m_pPrepThread;
|
||||
m_pPrepThread = nullptr;
|
||||
_levelGenerated();
|
||||
m_pLevel->animateTick(
|
||||
Mth::floor(m_pLocalPlayer->m_pos.x),
|
||||
Mth::floor(m_pLocalPlayer->m_pos.y),
|
||||
Mth::floor(m_pLocalPlayer->m_pos.z));
|
||||
}
|
||||
|
||||
SandTile::instaFall = false;
|
||||
|
||||
if (m_pLevel && !field_288)
|
||||
{
|
||||
m_pGameMode->tick();
|
||||
m_pGameRenderer->tick();
|
||||
m_pLevelRenderer->tick();
|
||||
m_pLevel->tickEntities();
|
||||
m_pLevel->tick();
|
||||
|
||||
if (m_pLocalPlayer)
|
||||
{
|
||||
m_pLevel->animateTick(
|
||||
Mth::floor(m_pLocalPlayer->m_pos.x),
|
||||
Mth::floor(m_pLocalPlayer->m_pos.y),
|
||||
Mth::floor(m_pLocalPlayer->m_pos.z));
|
||||
}
|
||||
}
|
||||
|
||||
m_pTextures->loadAndBindTexture(C_TERRAIN_NAME);
|
||||
|
||||
if (!field_288)
|
||||
{
|
||||
m_pTextures->tick();
|
||||
m_pParticleEngine->tick();
|
||||
m_pTextures->tick();
|
||||
m_pParticleEngine->tick();
|
||||
|
||||
#ifndef ORIGINAL_CODE
|
||||
if (m_pMobPersp)
|
||||
{
|
||||
m_pSoundEngine->m_pSoundSystem->setListenerPos(m_pMobPersp->m_pos.x, m_pMobPersp->m_pos.y, m_pMobPersp->m_pos.z);
|
||||
m_pSoundEngine->m_pSoundSystem->setListenerAngle(m_pMobPersp->m_yaw, m_pMobPersp->m_pitch);
|
||||
}
|
||||
#endif
|
||||
|
||||
if (m_pMobPersp)
|
||||
{
|
||||
m_pSoundEngine->m_pSoundSystem->setListenerPos(m_pMobPersp->m_pos.x, m_pMobPersp->m_pos.y, m_pMobPersp->m_pos.z);
|
||||
m_pSoundEngine->m_pSoundSystem->setListenerAngle(m_pMobPersp->m_yaw, m_pMobPersp->m_pitch);
|
||||
}
|
||||
|
||||
if (m_pScreen)
|
||||
m_pScreen->onTick();
|
||||
|
||||
Multitouch::reset();
|
||||
#endif
|
||||
}
|
||||
|
||||
if (m_pScreen)
|
||||
m_pScreen->onTick();
|
||||
|
||||
Multitouch::reset();
|
||||
}
|
||||
|
||||
void Minecraft::update()
|
||||
|
||||
@@ -131,6 +131,8 @@ void Gui::onRender(float f, bool bHaveScreen, int mouseX, int mouseY)
|
||||
if (!m->m_pLevel || !m->m_pLocalPlayer)
|
||||
return;
|
||||
|
||||
LocalPlayer* pLP = m->m_pLocalPlayer;
|
||||
|
||||
field_4 = -90.0f;
|
||||
|
||||
#ifndef ENH_TRANSPARENT_HOTBAR
|
||||
@@ -141,7 +143,7 @@ void Gui::onRender(float f, bool bHaveScreen, int mouseX, int mouseY)
|
||||
|
||||
m->m_pTextures->loadAndBindTexture("gui/gui.png");
|
||||
|
||||
Inventory* pInventory = m->m_pLocalPlayer->m_pInventory;
|
||||
Inventory* pInventory = pLP->m_pInventory;
|
||||
|
||||
field_4 = -90.0f;
|
||||
|
||||
@@ -193,21 +195,21 @@ void Gui::onRender(float f, bool bHaveScreen, int mouseX, int mouseY)
|
||||
// that;
|
||||
// else
|
||||
// this;
|
||||
if (breakProgress > 0.0f || m_pMinecraft->m_pInputHolder->m_feedbackAlpha < 0.0f)
|
||||
if (breakProgress > 0.0f || m->m_pInputHolder->m_feedbackAlpha < 0.0f)
|
||||
{
|
||||
if (breakProgress > 0.0f)
|
||||
{
|
||||
float xPos = m_pMinecraft->m_pInputHolder->m_feedbackX;
|
||||
float yPos = m_pMinecraft->m_pInputHolder->m_feedbackY;
|
||||
float xPos = m->m_pInputHolder->m_feedbackX;
|
||||
float yPos = m->m_pInputHolder->m_feedbackY;
|
||||
|
||||
m_pMinecraft->m_pTextures->loadAndBindTexture("gui/feedback_outer.png");
|
||||
m->m_pTextures->loadAndBindTexture("gui/feedback_outer.png");
|
||||
glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
|
||||
glEnable(GL_BLEND);
|
||||
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||
blit(scale * xPos - 44.0f, scale * yPos - 44.0f, 0, 0, 88, 88, 256, 256);
|
||||
|
||||
glBlendFunc(GL_ONE_MINUS_DST_COLOR, GL_ONE_MINUS_SRC_COLOR);
|
||||
m_pMinecraft->m_pTextures->loadAndBindTexture("gui/feedback_fill.png");
|
||||
m->m_pTextures->loadAndBindTexture("gui/feedback_fill.png");
|
||||
|
||||
// note: scale starts from 4.0f
|
||||
float halfWidth = (40.0f * breakProgress + 48.0f) / 2.0f;
|
||||
@@ -220,11 +222,11 @@ void Gui::onRender(float f, bool bHaveScreen, int mouseX, int mouseY)
|
||||
}
|
||||
else
|
||||
{
|
||||
float xPos = m_pMinecraft->m_pInputHolder->m_feedbackX;
|
||||
float yPos = m_pMinecraft->m_pInputHolder->m_feedbackY;
|
||||
float xPos = m->m_pInputHolder->m_feedbackX;
|
||||
float yPos = m->m_pInputHolder->m_feedbackY;
|
||||
|
||||
m_pMinecraft->m_pTextures->loadAndBindTexture("gui/feedback_outer.png");
|
||||
glColor4f(1.0f, 1.0f, 1.0f, Mth::Min(1.0f, m_pMinecraft->m_pInputHolder->m_feedbackAlpha));
|
||||
m->m_pTextures->loadAndBindTexture("gui/feedback_outer.png");
|
||||
glColor4f(1.0f, 1.0f, 1.0f, Mth::Min(1.0f, m->m_pInputHolder->m_feedbackAlpha));
|
||||
glEnable(GL_BLEND);
|
||||
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||
blit(scale * xPos - 44.0f, scale * yPos - 44.0f, 0, 0, 88, 88, 256, 256);
|
||||
@@ -237,12 +239,10 @@ void Gui::onRender(float f, bool bHaveScreen, int mouseX, int mouseY)
|
||||
glDisable(GL_BLEND);
|
||||
#endif
|
||||
|
||||
if (m_pMinecraft->m_pGameMode->canHurtPlayer())
|
||||
if (m->m_pGameMode->canHurtPlayer())
|
||||
{
|
||||
LocalPlayer* pLP = m_pMinecraft->m_pLocalPlayer;
|
||||
|
||||
// why??
|
||||
m_random.init_genrand(312871 * m_pMinecraft->m_timer.m_ticks);
|
||||
m_random.init_genrand(312871 * m->m_timer.m_ticks);
|
||||
|
||||
int emptyHeartX = 16;
|
||||
bool b1 = false;
|
||||
@@ -290,9 +290,9 @@ void Gui::onRender(float f, bool bHaveScreen, int mouseX, int mouseY)
|
||||
heartX += 8;
|
||||
}
|
||||
|
||||
if (m->m_pLocalPlayer->isUnderLiquid(Material::water))
|
||||
if (pLP->isUnderLiquid(Material::water))
|
||||
{
|
||||
int breathRaw = m->m_pLocalPlayer->field_BC;
|
||||
int breathRaw = pLP->field_BC;
|
||||
int breathFull = int(ceilf((float(breathRaw - 2) * 10.0f) / 300.0f));
|
||||
int breathMeter = int(ceilf((float(breathRaw) * 10.0f) / 300.0f)) - breathFull;
|
||||
|
||||
@@ -318,8 +318,6 @@ void Gui::onRender(float f, bool bHaveScreen, int mouseX, int mouseY)
|
||||
}
|
||||
}
|
||||
|
||||
m->m_pTextures->loadAndBindTexture("gui/gui_blocks.png");
|
||||
|
||||
int diff = m->isTouchscreen();
|
||||
|
||||
int slotX = cenX - hotbarWidth / 2 + 3;
|
||||
|
||||
@@ -12,10 +12,10 @@
|
||||
#include "client/renderer/FoliageColor.hpp"
|
||||
#include "client/renderer/GrassColor.hpp"
|
||||
|
||||
#define C_OPTION_ITEM_HEIGHT (18)
|
||||
#define C_OPTION_ITEM_HEIGHT (19)
|
||||
|
||||
#define C_ON_OFF_SWITCH_WIDTH (28)
|
||||
#define C_ON_OFF_SWITCH_HEIGHT (16)
|
||||
#define C_ON_OFF_SWITCH_WIDTH (36)
|
||||
#define C_ON_OFF_SWITCH_HEIGHT (17)
|
||||
|
||||
#define C_DISTANCE_SWITCH_WIDTH (60)
|
||||
#define C_DISTANCE_SWITCH_HEIGHT (16)
|
||||
@@ -242,7 +242,7 @@ void OptionList::renderItem(int index, int x, int y, int height, Tesselator& t)
|
||||
void OptionList::renderBackground(float f)
|
||||
{
|
||||
if (!m_pMinecraft->isLevelGenerated())
|
||||
m_pMinecraft->m_pScreen->renderBackground(); //renderMenuBackground(f);
|
||||
((Screen*)m_pMinecraft->m_pScreen)->renderMenuBackground(f);
|
||||
}
|
||||
|
||||
void OptionList::renderHoleBackground(float a, float b, int c, int d)
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
********************************************************************/
|
||||
|
||||
#include "TouchscreenInput_TestFps.hpp"
|
||||
#include "client/gui/screens/ChatScreen.hpp"
|
||||
#include "client/player/input/Multitouch.hpp"
|
||||
#include "client/app/Minecraft.hpp"
|
||||
#include "client/options/Options.hpp"
|
||||
@@ -127,6 +128,9 @@ void TouchscreenInput_TestFps::setScreenSize(int width, int height)
|
||||
m_pAreaRight = new PolygonArea(4, x2, y2);
|
||||
m_touchAreaModel.addArea(100 + INPUT_RIGHT, m_pAreaRight);
|
||||
|
||||
float scale = m_pMinecraft->m_pGui->scale;
|
||||
m_touchAreaModel.addArea(110, new RectangleArea(width - 17.0f / scale, 0, width, 17.0f / scale));
|
||||
|
||||
// NOTE: We are not leaking memory! Since by default IArea's constructor sets
|
||||
// field_4 to true, TouchAreaModel owns the pointers, so when it's destroyed,
|
||||
// so are these areas we allocated.
|
||||
@@ -202,6 +206,10 @@ void TouchscreenInput_TestFps::onTick(Player* pPlayer)
|
||||
case 100 + INPUT_RIGHT:
|
||||
m_horzInput -= 1.0f;
|
||||
break;
|
||||
case 110:
|
||||
if (!m_pMinecraft->m_pScreen && Multitouch::isPressed(finger))
|
||||
m_pMinecraft->setScreen(new ChatScreen());
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -276,6 +284,9 @@ void TouchscreenInput_TestFps::onRender(float f)
|
||||
|
||||
t.draw();
|
||||
|
||||
int screenWidth = scale * Minecraft::width;
|
||||
fill(screenWidth - 17, 1, screenWidth - 1, 17, 0xC0C0C0C0);
|
||||
|
||||
glDisable(GL_BLEND);
|
||||
glEnable(GL_CULL_FACE);
|
||||
}
|
||||
|
||||
@@ -10,7 +10,10 @@
|
||||
|
||||
// @NOTE: This is unused.
|
||||
|
||||
ChatScreen::ChatScreen(bool slash) : m_textChat(this, 1, 0, 0), m_btnSend(2, 0, 0, "Send")
|
||||
ChatScreen::ChatScreen(bool slash) :
|
||||
m_textChat(this, 1, 0, 0),
|
||||
m_btnSend(2, 0, 0, "Send"),
|
||||
m_btnBack(3, 0, 0, "Back")
|
||||
{
|
||||
if (slash)
|
||||
m_textChat.m_text = "/";
|
||||
@@ -20,24 +23,29 @@ void ChatScreen::buttonClicked(Button* pButton)
|
||||
{
|
||||
if (pButton->m_buttonId == m_btnSend.m_buttonId)
|
||||
sendMessageAndExit();
|
||||
if (pButton->m_buttonId == m_btnBack.m_buttonId)
|
||||
m_pMinecraft->setScreen(nullptr);
|
||||
}
|
||||
|
||||
void ChatScreen::onInit()
|
||||
{
|
||||
m_btnSend.m_height = 20;
|
||||
m_btnSend.m_width = 40;
|
||||
m_btnBack.m_height = m_btnSend.m_height = 20;
|
||||
m_btnBack.m_width = m_btnSend.m_width = 40;
|
||||
m_textChat.m_xPos = 0;
|
||||
m_textChat.m_yPos = m_height - 20;
|
||||
m_textChat.m_width = m_width - m_btnSend.m_width;
|
||||
m_textChat.m_height = 20;
|
||||
m_btnSend.m_yPos = m_height - 20;
|
||||
m_btnSend.m_xPos = m_textChat.m_xPos + m_textChat.m_width;
|
||||
m_btnBack.m_yPos = 10;
|
||||
m_btnBack.m_xPos = m_width - m_btnBack.m_width - 10;
|
||||
|
||||
// set focus directly on the chat text box
|
||||
m_textChat.onInit(m_pFont);
|
||||
m_textChat.setFocused(true);
|
||||
|
||||
m_buttons.push_back(&m_btnSend);
|
||||
m_buttons.push_back(&m_btnBack);
|
||||
m_textInputs.push_back(&m_textChat);
|
||||
}
|
||||
|
||||
@@ -54,6 +62,8 @@ void ChatScreen::onRender(int mouseX, int mouseY, float f)
|
||||
// override the default behavior of rendering chat messages
|
||||
m_pMinecraft->m_pGui->m_bRenderChatMessages = true;
|
||||
|
||||
m_btnBack.m_yPos = 10 + getYOffset();
|
||||
|
||||
Screen::onRender(mouseX, mouseY, f);
|
||||
}
|
||||
|
||||
|
||||
@@ -25,5 +25,6 @@ public:
|
||||
private:
|
||||
TextInputBox m_textChat;
|
||||
Button m_btnSend;
|
||||
Button m_btnBack;
|
||||
};
|
||||
|
||||
|
||||
@@ -69,7 +69,6 @@ void ConfirmScreen::onRender(int mouseX, int mouseY, float f)
|
||||
|
||||
void ConfirmScreen::postResult(bool b)
|
||||
{
|
||||
m_pScreen->confirmResult(b, field_40);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -187,7 +187,7 @@ void OptionsScreen::setWidthAllButtons(int width)
|
||||
m_biomeColorsButton.m_width = width;
|
||||
}
|
||||
|
||||
void OptionsScreen::init()
|
||||
void OptionsScreen::onInit()
|
||||
{
|
||||
m_pMinecraft->platform()->showDialog(AppPlatform::DLG_OPTIONS);
|
||||
m_pMinecraft->platform()->createUserInput();
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
|
||||
#include "../Screen.hpp"
|
||||
|
||||
//#define OLD_OPTIONS_SCREEN
|
||||
#ifndef OLD_OPTIONS_SCREEN
|
||||
|
||||
#include "../components/OptionList.hpp"
|
||||
@@ -36,7 +37,7 @@ class OptionsScreen : public Screen
|
||||
{
|
||||
public:
|
||||
OptionsScreen();
|
||||
void init() override;
|
||||
void onInit() override;
|
||||
void onRender(int, int, float) override;
|
||||
void removed() override;
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
#include "UnifiedTurnBuild.hpp"
|
||||
#include "Multitouch.hpp"
|
||||
|
||||
#include "client/player/input/IMoveInput.hpp"
|
||||
#include "common/Utils.hpp"
|
||||
#include "world/entity/Player.hpp"
|
||||
|
||||
@@ -70,7 +71,7 @@ TurnDelta UnifiedTurnBuild::getTurnDelta()
|
||||
int finger = activePtrs[i];
|
||||
int x = Multitouch::getX(finger);
|
||||
int y = Multitouch::getY(finger);
|
||||
if (m_touchAreaModel.getPointerId(x, y, finger) == 100)
|
||||
if (m_touchAreaModel.getPointerId(x, y, finger) == 100 + INPUT_FORWARD)
|
||||
{
|
||||
touched = true;
|
||||
m1 = float(x) * 0.5f;
|
||||
@@ -202,7 +203,7 @@ bool UnifiedTurnBuild::tickBuild(Player* pPlayer, BuildActionIntention* pIntenti
|
||||
{
|
||||
int finger = m_touchAreaModel.getPointerId(pEvent->_posX, pEvent->_posY, pEvent->_fingerId);
|
||||
|
||||
if (finger == 100)
|
||||
if (finger == 100 + INPUT_FORWARD)
|
||||
{
|
||||
if (field_BC > 20.0f || pEvent->_buttonState || wroteIntention)
|
||||
{
|
||||
|
||||
@@ -684,12 +684,13 @@ void GameRenderer::render(float f)
|
||||
}
|
||||
}
|
||||
|
||||
std::stringstream debugText;
|
||||
debugText << "ReMinecraftPE " << m_pMinecraft->getVersionString();
|
||||
debugText << "\n" << m_shownFPS << " fps, " << m_shownChunkUpdates << " chunk updates";
|
||||
|
||||
if (m_pMinecraft->getOptions()->m_bDebugText)
|
||||
{
|
||||
std::stringstream debugText;
|
||||
std::stringstream debugTextRight;
|
||||
debugText << "ReMinecraftPE " << m_pMinecraft->getVersionString();
|
||||
debugText << "\n" << m_shownFPS << " fps, " << m_shownChunkUpdates << " chunk updates";
|
||||
|
||||
if (m_pMinecraft->m_pLocalPlayer)
|
||||
{
|
||||
char posStr[96];
|
||||
@@ -703,17 +704,20 @@ void GameRenderer::render(float f)
|
||||
HitResult& hr = m_pMinecraft->m_hitResult;
|
||||
if (hr.m_hitType != HitResult::NONE) {
|
||||
sprintf(posStr, "%d, %d, %d", hr.m_tileX, hr.m_tileY, hr.m_tileZ);
|
||||
debugText << "\nLooking at: " << posStr;
|
||||
debugTextRight << "Looking at: " << posStr;
|
||||
Tile *pTile = nullptr;
|
||||
TileID tile = m_pMinecraft->m_pLevel->getTile(hr.m_tileX, hr.m_tileY, hr.m_tileZ);
|
||||
if (tile > 0) {
|
||||
pTile = Tile::tiles[tile];
|
||||
debugText << "\nTile: " << std::to_string(tile) <<" "<< pTile->m_descriptionID;
|
||||
debugTextRight << "\nTile: " << std::to_string(tile) <<" "<< pTile->m_descriptionID;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int screenWidth = m_pMinecraft->m_pGui->scale * Minecraft::width;
|
||||
int textWidth = m_pMinecraft->m_pFont->width(debugTextRight.str());
|
||||
m_pMinecraft->m_pFont->drawShadow(debugText.str(), 2, 2, 0xFFFFFF);
|
||||
m_pMinecraft->m_pFont->drawShadow(debugTextRight.str(), screenWidth - textWidth - 2, 2, 0xFFFFFF);
|
||||
}
|
||||
|
||||
int timeMs = getTimeMs();
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
#include "../../GameMods.hpp"
|
||||
|
||||
enum eLogLevel
|
||||
{
|
||||
@@ -26,14 +27,7 @@ public:
|
||||
virtual void printf(eLogLevel, const char* const fmt, ...);
|
||||
};
|
||||
|
||||
// TODO: For now
|
||||
#ifdef __ANDROID__
|
||||
#ifndef NDEBUG
|
||||
#define _DEBUG
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef _DEBUG
|
||||
#ifdef MC_DEBUG
|
||||
|
||||
#define LOG(level, ...) Logger::singleton()->printf(level, __VA_ARGS__)
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
#include "../../GameMods.hpp"
|
||||
|
||||
class StandardOut
|
||||
{
|
||||
@@ -13,7 +14,7 @@ public:
|
||||
void printf(const char* const fmt, ...);
|
||||
};
|
||||
|
||||
#ifdef _DEBUG
|
||||
#ifdef MC_DEBUG
|
||||
|
||||
#define LOG(...) StandardOut::singleton()->printf(__VA_ARGS__)
|
||||
|
||||
|
||||
@@ -661,7 +661,7 @@ void Entity::baseTick()
|
||||
for (int i = 0; float(i) < field_88 * 20.0f + 1.0f; i++)
|
||||
{
|
||||
m_pLevel->addParticle(
|
||||
"splash",
|
||||
"bubble",
|
||||
m_pos.x + field_88 * (sharedRandom.nextFloat() * 2.0f - 1.0f),
|
||||
f1 + 1.0f,
|
||||
m_pos.z + field_88 * (sharedRandom.nextFloat() * 2.0f - 1.0f),
|
||||
|
||||
@@ -346,7 +346,7 @@ void Player::setRespawnPos(Pos* pos)
|
||||
m_bHaveRespawnPos = true;
|
||||
m_respawnPos.x = pos->x;
|
||||
m_respawnPos.y = pos->y;
|
||||
// @BUG: no m_respawnPos.z = pos->z ??
|
||||
m_respawnPos.z = pos->z;
|
||||
}
|
||||
|
||||
void Player::startCrafting(int x, int y, int z)
|
||||
|
||||
Reference in New Issue
Block a user