diff --git a/Minecraft.Client/ClientConstants.cpp b/Minecraft.Client/ClientConstants.cpp index d1d80aa9..cc415011 100644 --- a/Minecraft.Client/ClientConstants.cpp +++ b/Minecraft.Client/ClientConstants.cpp @@ -1,5 +1,13 @@ #include "stdafx.h" #include "ClientConstants.h" +#include "Common/BuildVer.h" const wstring ClientConstants::VERSION_STRING = wstring(L"Minecraft LCE ") + VER_FILEVERSION_STR_W;//+ SharedConstants::VERSION_STRING; const wstring ClientConstants::BRANCH_STRING = VER_BRANCHVERSION_STR_W; + +// Default value for the toggle. If BuildVer defines VER_SHOW_VERSION_WATERMARK, use that. +#ifdef VER_SHOW_VERSION_WATERMARK +const bool ClientConstants::SHOW_VERSION_WATERMARK = (VER_SHOW_VERSION_WATERMARK != 0); +#else +const bool ClientConstants::SHOW_VERSION_WATERMARK = true; +#endif diff --git a/Minecraft.Client/ClientConstants.h b/Minecraft.Client/ClientConstants.h index 1476e51b..726430f1 100644 --- a/Minecraft.Client/ClientConstants.h +++ b/Minecraft.Client/ClientConstants.h @@ -15,5 +15,8 @@ public: static const wstring VERSION_STRING; static const wstring BRANCH_STRING; + // Toggle to show/hide the version/branch watermark in the debug overlay + static const bool SHOW_VERSION_WATERMARK; + static const bool DEADMAU5_CAMERA_CHEATS = false; }; \ No newline at end of file diff --git a/Minecraft.Client/Gui.cpp b/Minecraft.Client/Gui.cpp index 43b41998..d538dd4b 100644 --- a/Minecraft.Client/Gui.cpp +++ b/Minecraft.Client/Gui.cpp @@ -872,13 +872,16 @@ void Gui::render(float a, bool mouseFree, int xMouse, int yMouse) vector lines; - lines.push_back(ClientConstants::VERSION_STRING); - lines.push_back(ClientConstants::BRANCH_STRING); + // Only add version/branch lines if the watermark toggle is enabled + if (ClientConstants::SHOW_VERSION_WATERMARK) { + lines.push_back(ClientConstants::VERSION_STRING); + lines.push_back(ClientConstants::BRANCH_STRING); + } if (minecraft->options->renderDebug && minecraft->player != nullptr && minecraft->level != nullptr) { lines.push_back(minecraft->fpsString); lines.push_back(L"E: " + std::to_wstring(minecraft->level->getAllEntities().size())); // Could maybe use entity::shouldRender to work out how many are rendered but thats like expensive - // TODO Add server information with packet counts - once multiplayer is more stable + // TODO Add server information with packet counts - once multiplayer is more stable int renderDistance = app.GetGameSettings(iPad, eGameSetting_RenderDistance); // Calculate the chunk sections using 16 * (2n + 1)^2 lines.push_back(L"C: " + std::to_wstring(16 * (2 * renderDistance + 1) * (2 * renderDistance + 1)) + L" D: " + std::to_wstring(renderDistance)); @@ -987,7 +990,7 @@ void Gui::render(float a, bool mouseFree, int xMouse, int yMouse) lines.push_back(minecraft->gatherStats2()); // Empty currently - CPlatformNetworkManagerStub::GatherStats() lines.push_back(minecraft->gatherStats3()); // RTT } - + #ifdef _DEBUG // Only show terrain features in debug builds not release // TERRAIN FEATURES if (minecraft->level->dimension->id == 0) @@ -1028,7 +1031,7 @@ void Gui::render(float a, bool mouseFree, int xMouse, int yMouse) } } - lines.push_back(L""); // Add a spacer line + lines.push_back(L""; // Add a spacer line for (int i = eTerrainFeature_Stronghold; i <= static_cast(eTerrainFeature_Ravine); i++) { lines.push_back(wfeature[i]); @@ -1050,10 +1053,10 @@ void Gui::render(float a, bool mouseFree, int xMouse, int yMouse) MemSect(0); #endif - lastTickA = a; - // 4J Stu - This is now displayed in a xui scene +lastTickA = a; +// 4J Stu - This is now displayed in a xui scene #if 0 - // Jukebox CD message +// Jukebox CD message if (overlayMessageTime > 0) { float t = overlayMessageTime - a; @@ -1619,7 +1622,7 @@ void Gui::renderGraph(int dataLength, int dataPos, int64_t *dataA, float dataASc t->vertex((float)(xScale*i + 0.5f), (float)( height - aVal + 0.5f), static_cast(0)); t->vertex((float)(xScale*i + 0.5f), (float)( height + 0.5f), static_cast(0)); - } + } if( dataB != NULL ) { diff --git a/Minecraft.Client/stdafx.h b/Minecraft.Client/stdafx.h index 04a18b13..d0404009 100644 --- a/Minecraft.Client/stdafx.h +++ b/Minecraft.Client/stdafx.h @@ -221,6 +221,15 @@ typedef XUID GameSessionUID; #include "Common\Minecraft_Macros.h" #include "Common\BuildVer.h" +// Ensure fallback defines if BuildVer.h wasn't picked up by include paths +#ifndef VER_FILEVERSION_STR_W +#define VER_PRODUCTBUILD 560 +#define VER_PRODUCTVERSION_STR_W L"DEV (unknown version)" +#define VER_FILEVERSION_STR_W VER_PRODUCTVERSION_STR_W +#define VER_BRANCHVERSION_STR_W L"UNKNOWN BRANCH" +#define VER_NETWORK VER_PRODUCTBUILD +#endif + #ifdef _XBOX #include "Xbox\Xbox_App.h" #include "Xbox\Sentient\MinecraftTelemetry.h"