diff --git a/Minecraft.Client/Common/UI/UIScene_HUD.cpp b/Minecraft.Client/Common/UI/UIScene_HUD.cpp index e01757abe..5f401c39d 100644 --- a/Minecraft.Client/Common/UI/UIScene_HUD.cpp +++ b/Minecraft.Client/Common/UI/UIScene_HUD.cpp @@ -753,7 +753,7 @@ void UIScene_HUD::handleTimerComplete(int id) float opacity = pGui->getOpacity(m_iPad, i); if( opacity > 0 ) { -#ifdef _WINDOWS64 +#if 0 // def _WINDOWS64 // Use Iggy chat until Gui::render has visual parity // Chat drawn by Gui::render with color codes. Hides Iggy chat to avoid double chats. m_controlLabelBackground[i].setOpacity(0); m_labelChatText[i].setOpacity(0); diff --git a/Minecraft.Client/Font.cpp b/Minecraft.Client/Font.cpp index 51b50ca19..ce2275f69 100644 --- a/Minecraft.Client/Font.cpp +++ b/Minecraft.Client/Font.cpp @@ -146,6 +146,44 @@ void Font::renderStyleLine(float x0, float y0, float x1, float y1) t->end(); } +void Font::addCharacterQuad(wchar_t c) +{ + float xOff = c % m_cols * m_charWidth; + float yOff = c / m_cols * m_charWidth; + float width = charWidths[c] - .01f; + float height = m_charHeight - .01f; + float fontWidth = m_cols * m_charWidth; + float fontHeight = m_rows * m_charHeight; + const float shear = m_italic ? (height * 0.25f) : 0.0f; + float x0 = xPos, x1 = xPos + width + shear; + float y0 = yPos, y1 = yPos + height; + + Tesselator *t = Tesselator::getInstance(); + t->tex(xOff / fontWidth, (yOff + 7.99f) / fontHeight); + t->vertex(x0, y1, 0.0f); + t->tex((xOff + width) / fontWidth, (yOff + 7.99f) / fontHeight); + t->vertex(x1, y1, 0.0f); + t->tex((xOff + width) / fontWidth, yOff / fontHeight); + t->vertex(x1, y0, 0.0f); + t->tex(xOff / fontWidth, yOff / fontHeight); + t->vertex(x0, y0, 0.0f); + + if (m_bold) + { + float dx = 1.0f; + t->tex(xOff / fontWidth, (yOff + 7.99f) / fontHeight); + t->vertex(x0 + dx, y1, 0.0f); + t->tex((xOff + width) / fontWidth, (yOff + 7.99f) / fontHeight); + t->vertex(x1 + dx, y1, 0.0f); + t->tex((xOff + width) / fontWidth, yOff / fontHeight); + t->vertex(x1 + dx, y0, 0.0f); + t->tex(xOff / fontWidth, yOff / fontHeight); + t->vertex(x0 + dx, y0, 0.0f); + } + + xPos += static_cast(charWidths[c]); +} + void Font::renderCharacter(wchar_t c) { float xOff = c % m_cols * m_charWidth; @@ -255,11 +293,13 @@ void Font::draw(const wstring &str, bool dropShadow) { // Bind the texture textures->bindTexture(m_textureLocation); - bool noise = false; m_bold = m_italic = m_underline = m_strikethrough = false; wstring cleanStr = sanitize(str); + Tesselator *t = Tesselator::getInstance(); + t->begin(); + for (int i = 0; i < static_cast(cleanStr.length()); ++i) { // Map character @@ -270,8 +310,10 @@ void Font::draw(const wstring &str, bool dropShadow) wchar_t ca = cleanStr[i+1]; if (!isSectionFormatCode(ca)) { + t->end(); renderCharacter(167); renderCharacter(ca); + t->begin(); i += 1; continue; } @@ -294,14 +336,10 @@ void Font::draw(const wstring &str, bool dropShadow) { noise = false; if (colorN < 0 || colorN > 15) colorN = 15; - if (dropShadow) colorN += 16; - int color = colors[colorN]; glColor3f((color >> 16) / 255.0F, ((color >> 8) & 255) / 255.0F, (color & 255) / 255.0F); } - - i += 1; continue; } @@ -317,8 +355,10 @@ void Font::draw(const wstring &str, bool dropShadow) c = newc; } - renderCharacter(c); + addCharacterQuad(c); } + + t->end(); } void Font::draw(const wstring& str, int x, int y, int color, bool dropShadow) diff --git a/Minecraft.Client/Font.h b/Minecraft.Client/Font.h index 3d25880de..a5d117ca0 100644 --- a/Minecraft.Client/Font.h +++ b/Minecraft.Client/Font.h @@ -47,6 +47,7 @@ public: private: void renderCharacter(wchar_t c); // 4J added + void addCharacterQuad(wchar_t c); void renderStyleLine(float x0, float y0, float x1, float y1); // solid line for underline/strikethrough public: diff --git a/Minecraft.Client/Gui.cpp b/Minecraft.Client/Gui.cpp index 365ddeac7..0a890d931 100644 --- a/Minecraft.Client/Gui.cpp +++ b/Minecraft.Client/Gui.cpp @@ -971,7 +971,7 @@ void Gui::render(float a, bool mouseFree, int xMouse, int yMouse) glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glDisable(GL_ALPHA_TEST); -#if defined(_WINDOWS64) +#if 0 // defined(_WINDOWS64) // Temporarily disable this chat in favor of iggy chat until we have better visual parity glPushMatrix(); glTranslatef(0.0f, static_cast(screenHeight - iSafezoneYHalf - iTooltipsYOffset - 16 - 3 + 22) - 24.0f, 0.0f); diff --git a/Minecraft.Client/Minecraft.cpp b/Minecraft.Client/Minecraft.cpp index ba82e9197..76c3b779d 100644 --- a/Minecraft.Client/Minecraft.cpp +++ b/Minecraft.Client/Minecraft.cpp @@ -1522,7 +1522,7 @@ void Minecraft::run_middle() } #endif -#ifndef _FINAL_BUILD +#if _DEBUG // ndef _FINAL_BUILD // Disable conflicting debug functionality in release builds if( app.DebugSettingsOn() && app.GetUseDPadForDebug() ) { localplayers[i]->ullDpad_last = 0; @@ -3651,7 +3651,7 @@ void Minecraft::tick(bool bFirst, bool bUpdateTextures) if (player->missTime > 0) player->missTime--; -#ifdef _DEBUG_MENUS_ENABLED +#ifdef _DEBUG//_MENUS_ENABLED // disable DPad cheats on release builds if(app.DebugSettingsOn()) { #ifndef __PSVITA__ diff --git a/Minecraft.Client/Windows64/Windows64_Minecraft.cpp b/Minecraft.Client/Windows64/Windows64_Minecraft.cpp index e56e9ff0d..dd466bf2f 100644 --- a/Minecraft.Client/Windows64/Windows64_Minecraft.cpp +++ b/Minecraft.Client/Windows64/Windows64_Minecraft.cpp @@ -587,7 +587,7 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) else if (vk == VK_MENU) vk = (lParam & (1 << 24)) ? VK_RMENU : VK_LMENU; g_KBMInput.OnKeyDown(vk); - break; + return DefWindowProc(hWnd, message, wParam, lParam); } case WM_KEYUP: case WM_SYSKEYUP: diff --git a/README.md b/README.md index 0fdd6839c..c25b7edd5 100644 --- a/README.md +++ b/README.md @@ -34,30 +34,42 @@ Basic LAN multiplayer is available on the Windows build - Other players on the same LAN can discover the session from the in-game Join Game menu - Game connections use TCP port `25565` by default - LAN discovery uses UDP port `25566` +- Add servers to your server list with `servers.txt` (temp solution) +- Rename yourself without losing data by keeping your `uid.dat` -This feature is based on [LCEMP](https://github.com/LCEMP/LCEMP) +Parts of this feature are based on code from [LCEMP](https://github.com/LCEMP/LCEMP) (thanks!) + +### servers.txt + +To add a server to your game, create the `servers.txt` file in the same directory as you have `Minecraft.Client.exe`. Inside, follow this format: +``` +serverip.example.com +25565 +The name of your server in UI! +``` + +For example, here's a valid servers.txt +``` +1.1.1.1 +25565 +Cloudflare's Very Own LCE Server +127.0.0.1 +25565 +Localhost Test Crap +``` ### Launch Arguments | Argument | Description | |--------------------|-----------------------------------------------------------------------------------------------------| | `-name ` | Sets your in-game username. | -| `-server` | Launches a headless server instead of the client. | -| `-ip
` | Client mode: manually connect to an IP. Server mode: override the bind IP from `server.properties`. | -| `-port ` | Client mode: override the join port. Server mode: override the listen port from `server.properties`.| +| `-fullscreen` | Launches the game in Fullscreen mode | Example: ``` -Minecraft.Client.exe -name Steve -ip 192.168.0.25 -port 25565 +Minecraft.Client.exe -name Steve -fullscreen ``` -Headless server example: -``` -Minecraft.Client.exe -server -ip 0.0.0.0 -port 25565 -``` - -The headless server also reads and writes `server.properties` in the working directory. If `-ip` / `-port` are omitted in `-server` mode, it falls back to `server-ip` / `server-port` from that file. Dedicated-server host options such as `trust-players`, `pvp`, `fire-spreads`, `tnt`, `difficulty`, `gamemode`, `spawn-animals`, and `spawn-npcs` are persisted there as well. - ## Controls (Keyboard & Mouse) - **Movement**: `W` `A` `S` `D`