Draft
Fix Linux Emscripten build: replace gethostbyname + add build_web.sh#3
Conversation
- Copy modern GUI texture sheets from resources/ to web-build/data/images/gui/ (icons.png, gui.png, gui2.png, spritesheet.png, background.png, bg32.png, cursor.png, default_world.png, touchgui.png) - Rewrite SimpleFoodData with proper hunger mechanics: - Food starts full (20), exhaustion drains saturation then food - Walking (0.01/block), sprinting (0.1/block), jumping (0.2), sprint-jump (0.8) - Full hunger (>=18) with saturation heals 1HP every 80 ticks - Empty hunger damages 1HP every 80 ticks, stops at half a heart - Add renderHunger() to Gui.cpp drawing food icons on right side of screen Co-authored-by: sriail <225764385+sriail@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Update modern texture sheets and food system
Add modern GUI textures and traditional hunger bar system
Mar 10, 2026
- Copy 405 individual block PNGs/TGAs from resources/ into web-build/data/images/textures/blocks/ - Add web-build/tools/build_terrain_atlas.py: stitches individual block textures into a 256×256 terrain.png matching the MCPE 0.6.2 UV-grid (16×16 tiles of 16px each, slot = col + row*16) - Rebuild terrain.png from modern textures (99 slots populated) - Remove stale terrain.pvr, terrain.pvr4, terrain.pvrtc, and terrain_4444.h / terrain_5551.h / terrain_565.h / terrain_565_2.h Co-authored-by: sriail <225764385+sriail@users.noreply.github.com>
Copilot
AI
changed the title
Add modern GUI textures and traditional hunger bar system
Migrate terrain atlas to modern block textures + add hunger bar system
Mar 11, 2026
- web-build/src/raknet/SocketLayer.cpp: replace gethostbyname with getaddrinfo under #ifdef __EMSCRIPTEN__ in two places: DomainNameToIP_Old() and GetMyIP_Win32(). Non-web builds unchanged. - web-build/project/emscripten/build_web.sh: new Linux bash build script mirroring build_web.ps1; LF line endings, --clean and --serve modes, COOP/COEP server, output to web-build/out/ Co-authored-by: sriail <225764385+sriail@users.noreply.github.com>
Copilot
AI
changed the title
Migrate terrain atlas to modern block textures + add hunger bar system
Fix Linux Emscripten build: replace gethostbyname + add build_web.sh
Mar 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two linker errors blocked the web-build from compiling on Linux with modern emsdk. Fixes both without touching non-web platform code.
Root causes
gethostbynameundefined: Emscripten removed this symbol; two call sites existed insideRAKNET_SUPPORT_IPV6==0branches ofSocketLayer.cpp.emscripten_websocket_send_binaryundefined: Caused by adding-sPROXY_POSIX_SOCKETS=1without linkinglibwebsockets. Avoided entirely by choosing Option 2 (singleplayer-only for web).Changes
web-build/src/raknet/SocketLayer.cppReplace both
gethostbynameusages withgetaddrinfounder#ifdef __EMSCRIPTEN__. Non-web builds unaffected.web-build/project/emscripten/build_web.sh(new)Linux bash equivalent of
build_web.ps1:--clean: wipesobj/andout/before rebuild--serve: runs a Python 3 server withCOOP/COEPheaders required forSharedArrayBufferweb-build/out/index.{html,js,wasm}-sPROXY_POSIX_SOCKETS— RakNet UDP multiplayer is not viable in browsers; singleplayer links cleanly✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.