mirror of
https://github.com/smartcmd/MinecraftConsoles.git
synced 2026-08-20 09:57:09 +00:00
Change F3 rendering and add git version information
This commit is contained in:
parent
7c2869c5b9
commit
63e5fe4c85
12
.github/workflows/nightly.yml
vendored
12
.github/workflows/nightly.yml
vendored
|
|
@ -22,6 +22,17 @@ jobs:
|
|||
- name: Setup msbuild
|
||||
uses: microsoft/setup-msbuild@v2
|
||||
|
||||
- name: Set BuildVer.h
|
||||
shell: bash
|
||||
run: |
|
||||
cat > Minecraft.Client/Common/BuildVer.h << EOF
|
||||
#pragma once
|
||||
#define VER_PRODUCTBUILD $GITHUB_RUN_NUMBER
|
||||
#define VER_PRODUCTVERSION_STR_W L"${GITHUB_SHA::7} ($GITHUB_REF)"
|
||||
#define VER_FILEVERSION_STR_W VER_PRODUCTVERSION_STR_W
|
||||
#define VER_NETWORK VER_PRODUCTBUILD
|
||||
EOF
|
||||
|
||||
- name: Build
|
||||
run: MSBuild.exe MinecraftConsoles.sln /p:Configuration=Release /p:Platform="Windows64"
|
||||
|
||||
|
|
@ -30,7 +41,6 @@ jobs:
|
|||
|
||||
- name: Update release
|
||||
uses: andelf/nightly-release@main
|
||||
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#include "stdafx.h"
|
||||
#include "ClientConstants.h"
|
||||
|
||||
const wstring ClientConstants::VERSION_STRING = wstring(L"Minecraft Xbox ") + VER_FILEVERSION_STR_W;//+ SharedConstants::VERSION_STRING;
|
||||
const wstring ClientConstants::VERSION_STRING = wstring(L"Minecraft LCE ") + VER_FILEVERSION_STR_W;//+ SharedConstants::VERSION_STRING;
|
||||
|
|
@ -1,57 +1,6 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
|
||||
#define VER_PRODUCTMAJORVERSION 0
|
||||
#define VER_PRODUCTMINORVERSION 0
|
||||
|
||||
// This goes up with each build
|
||||
// 4J-JEV: This value is extracted with a regex so it can be placed as the version in the AppX manifest on Durango.
|
||||
#define VER_PRODUCTBUILD 560
|
||||
// This goes up if there is any change to network traffic or code in a build
|
||||
#define VER_NETWORK 560
|
||||
#define VER_PRODUCTBUILD_QFE 0
|
||||
|
||||
#define VER_FILEVERSION_STRING "1.6"
|
||||
#define VER_PRODUCTVERSION_STRING VER_FILEVERSION_STRING
|
||||
#define VER_FILEVERSION_STRING_W L"1.6"
|
||||
#define VER_PRODUCTVERSION_STRING_W VER_FILEVERSION_STRING_W
|
||||
#define VER_FILEBETA_STR ""
|
||||
#undef VER_FILEVERSION
|
||||
#define VER_FILEVERSION VER_PRODUCTMAJORVERSION, VER_PRODUCTMINORVERSION, VER_PRODUCTBUILD, VER_PRODUCTBUILD_QFE
|
||||
#define VER_PRODUCTVERSION VER_PRODUCTMAJORVERSION, VER_PRODUCTMINORVERSION, VER_PRODUCTBUILD, VER_PRODUCTBUILD_QFE
|
||||
|
||||
#if (VER_PRODUCTBUILD < 10)
|
||||
#define VER_FILEBPAD "000"
|
||||
#define VER_FILEBPAD_W L"000"
|
||||
#elif (VER_PRODUCTBUILD < 100)
|
||||
#define VER_FILEBPAD "00"
|
||||
#define VER_FILEBPAD_W L"00"
|
||||
#elif (VER_PRODUCTBUILD < 1000)
|
||||
#define VER_FILEBPAD "0"
|
||||
#define VER_FILEBPAD_W L"0"
|
||||
#else
|
||||
#define VER_FILEBPAD
|
||||
#define VER_FILEBPAD_W
|
||||
#endif
|
||||
|
||||
#define VER_WIDE_PREFIX(x) L##x
|
||||
|
||||
#define VER_FILEVERSION_STR2(x,y) VER_FILEVERSION_STRING "." VER_FILEBPAD #x "." #y
|
||||
#define VER_FILEVERSION_STR2_W(x,y) VER_FILEVERSION_STRING_W L"." VER_FILEBPAD_W VER_WIDE_PREFIX(#x) L"." VER_WIDE_PREFIX(#y)
|
||||
#define VER_FILEVERSION_STR1(x,y) VER_FILEVERSION_STR2(x, y)
|
||||
#define VER_FILEVERSION_STR1_W(x,y) VER_FILEVERSION_STR2_W(x, y)
|
||||
|
||||
#undef VER_FILEVERSION_STR
|
||||
#define VER_FILEVERSION_STR VER_FILEVERSION_STR1(VER_PRODUCTBUILD, VER_PRODUCTBUILD_QFE)
|
||||
#define VER_PRODUCTVERSION_STR VER_FILEVERSION_STR1(VER_PRODUCTBUILD, VER_PRODUCTBUILD_QFE)
|
||||
|
||||
#define VER_FILEVERSION_STR_W VER_FILEVERSION_STR1_W(VER_PRODUCTBUILD, VER_PRODUCTBUILD_QFE)
|
||||
#define VER_PRODUCTVERSION_STR_W VER_FILEVERSION_STR1_W(VER_PRODUCTBUILD, VER_PRODUCTBUILD_QFE)
|
||||
|
||||
#if (VER_PRODUCTBUILD_QFE >= 256)
|
||||
#error "QFE number cannot exceed 255"
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#define VER_PRODUCTBUILD -1
|
||||
#define VER_PRODUCTVERSION_STR_W L"DEV (unknown)"
|
||||
#define VER_FILEVERSION_STR_W VER_PRODUCTVERSION_STR_W
|
||||
#define VER_NETWORK VER_PRODUCTBUILD
|
||||
|
|
|
|||
|
|
@ -859,17 +859,20 @@ void Gui::render(float a, bool mouseFree, int xMouse, int yMouse)
|
|||
glTranslatef((float)debugLeft, (float)debugTop, 0.f);
|
||||
glScalef(scale, scale, 1.f);
|
||||
glTranslatef((float)-debugLeft, (float)-debugTop, 0.f);
|
||||
if (Minecraft::warezTime > 0) glTranslatef(0, 32, 0);
|
||||
font->drawShadow(ClientConstants::VERSION_STRING + L" (" + minecraft->fpsString + L")", debugLeft, debugTop, 0xffffff);
|
||||
font->drawShadow(L"Seed: " + std::to_wstring(minecraft->level->getLevelData()->getSeed() ), debugLeft, debugTop + 12, 0xffffff);
|
||||
font->drawShadow(minecraft->gatherStats1(), debugLeft, debugTop + 22, 0xffffff);
|
||||
font->drawShadow(minecraft->gatherStats2(), debugLeft, debugTop + 32, 0xffffff);
|
||||
font->drawShadow(minecraft->gatherStats3(), debugLeft, debugTop + 42, 0xffffff);
|
||||
font->drawShadow(minecraft->gatherStats4(), debugLeft, debugTop + 52, 0xffffff);
|
||||
|
||||
// TERRAIN FEATURES
|
||||
int iYPos = debugTop + 62;
|
||||
std::vector<std::wstring> lines;
|
||||
|
||||
// Header lines (drawn with drawShadow, white)
|
||||
lines.push_back(ClientConstants::VERSION_STRING);
|
||||
lines.push_back(minecraft->fpsString);
|
||||
lines.push_back(L"Seed: " + std::to_wstring(minecraft->level->getLevelData()->getSeed()));
|
||||
lines.push_back(minecraft->gatherStats1());
|
||||
lines.push_back(minecraft->gatherStats2());
|
||||
lines.push_back(minecraft->gatherStats3());
|
||||
lines.push_back(minecraft->gatherStats4());
|
||||
|
||||
#ifdef _DEBUG // Only show terrain features in debug builds not release
|
||||
// TERRAIN FEATURES
|
||||
if(minecraft->level->dimension->id==0)
|
||||
{
|
||||
wstring wfeature[eTerrainFeature_Count];
|
||||
|
|
@ -900,35 +903,23 @@ void Gui::render(float a, bool mouseFree, int xMouse, int yMouse)
|
|||
}
|
||||
}
|
||||
|
||||
for( int i = eTerrainFeature_Stronghold; i < (int) eTerrainFeature_Count; i++ )
|
||||
lines.push_back(L""); // Add a spacer line
|
||||
for (int i = eTerrainFeature_Stronghold; i <= (int) eTerrainFeature_Ravine; i++)
|
||||
{
|
||||
iYPos+=10;
|
||||
font->drawShadow(wfeature[i], debugLeft, iYPos, 0xffffff);
|
||||
lines.push_back(wfeature[i]);
|
||||
}
|
||||
lines.push_back(L"");
|
||||
}
|
||||
#endif
|
||||
|
||||
//font->drawShadow(minecraft->gatherStats5(), iSafezoneXHalf+2, 32 + 10, 0xffffff);
|
||||
{
|
||||
/* 4J - removed
|
||||
long max = Runtime.getRuntime().maxMemory();
|
||||
long total = Runtime.getRuntime().totalMemory();
|
||||
long free = Runtime.getRuntime().freeMemory();
|
||||
long used = total - free;
|
||||
String msg = "Used memory: " + (used * 100 / max) + "% (" + (used / 1024 / 1024) + "MB) of " + (max / 1024 / 1024) + "MB";
|
||||
drawString(font, msg, screenWidth - font.width(msg) - 2, 2, 0xe0e0e0);
|
||||
msg = "Allocated memory: " + (total * 100 / max) + "% (" + (total / 1024 / 1024) + "MB)";
|
||||
drawString(font, msg, screenWidth - font.width(msg) - 2, 12, 0xe0e0e0);
|
||||
*/
|
||||
}
|
||||
// 4J Stu - Moved these so that they don't overlap
|
||||
double xBlockPos = floor(minecraft->player->x);
|
||||
double yBlockPos = floor(minecraft->player->y);
|
||||
double zBlockPos = floor(minecraft->player->z);
|
||||
drawString(font, L"x: " + std::to_wstring(minecraft->player->x) + L"/ Head: " + std::to_wstring(static_cast<int>(xBlockPos)) + L"/ Chunk: " + std::to_wstring(minecraft->player->xChunk), debugLeft, iYPos + 8 * 0, 0xe0e0e0);
|
||||
drawString(font, L"y: " + std::to_wstring(minecraft->player->y) + L"/ Head: " + std::to_wstring(static_cast<int>(yBlockPos)), debugLeft, iYPos + 8 * 1, 0xe0e0e0);
|
||||
drawString(font, L"z: " + std::to_wstring(minecraft->player->z) + L"/ Head: " + std::to_wstring(static_cast<int>(zBlockPos)) + L"/ Chunk: " + std::to_wstring(minecraft->player->zChunk), debugLeft, iYPos + 8 * 2, 0xe0e0e0);
|
||||
drawString(font, L"f: " + std::to_wstring(Mth::floor(minecraft->player->yRot * 4.0f / 360.0f + 0.5) & 0x3) + L"/ yRot: " + std::to_wstring(minecraft->player->yRot), debugLeft, iYPos + 8 * 3, 0xe0e0e0);
|
||||
iYPos += 8*4;
|
||||
lines.push_back(L"x: " + std::to_wstring(minecraft->player->x) + L"/ Head: " + std::to_wstring(static_cast<int>(xBlockPos)) + L"/ Chunk: " + std::to_wstring(minecraft->player->xChunk));
|
||||
lines.push_back(L"y: " + std::to_wstring(minecraft->player->y) + L"/ Head: " + std::to_wstring(static_cast<int>(yBlockPos)));
|
||||
lines.push_back(L"z: " + std::to_wstring(minecraft->player->z) + L"/ Head: " + std::to_wstring(static_cast<int>(zBlockPos)) + L"/ Chunk: " + std::to_wstring(minecraft->player->zChunk));
|
||||
lines.push_back(L"f: " + std::to_wstring(Mth::floor(minecraft->player->yRot * 4.0f / 360.0f + 0.5) & 0x3) + L"/ yRot: " + std::to_wstring(minecraft->player->yRot));
|
||||
|
||||
int px = Mth::floor(minecraft->player->x);
|
||||
int py = Mth::floor(minecraft->player->y);
|
||||
|
|
@ -937,11 +928,17 @@ void Gui::render(float a, bool mouseFree, int xMouse, int yMouse)
|
|||
{
|
||||
LevelChunk *chunkAt = minecraft->level->getChunkAt(px, pz);
|
||||
Biome *biome = chunkAt->getBiome(px & 15, pz & 15, minecraft->level->getBiomeSource());
|
||||
drawString(
|
||||
font,
|
||||
L"b: " + biome->m_name + L" (" + std::to_wstring(biome->id) + L")", debugLeft, iYPos, 0xe0e0e0);
|
||||
lines.push_back(L"b: " + biome->m_name + L" (" + std::to_wstring(biome->id) + L")");
|
||||
}
|
||||
|
||||
// Loop through the lines and draw them all on screen
|
||||
int yPos = debugTop;
|
||||
for (const auto &line : lines)
|
||||
{
|
||||
drawString(font, line, debugLeft, yPos, 0xffffff);
|
||||
yPos += 10;
|
||||
}
|
||||
|
||||
glPopMatrix();
|
||||
}
|
||||
MemSect(0);
|
||||
|
|
|
|||
Loading…
Reference in a new issue