Skip to content

bsp-compilation: build on Linux/GCC (missing includes, uint16_t, strdup) - #3

Open
SickoHours wants to merge 4 commits into
LJW-Dev:bsp-compilationfrom
SickoHours:bsp-compilation-linux
Open

SickoHours wants to merge 4 commits into
LJW-Dev:bsp-compilationfrom
SickoHours:bsp-compilation-linux

Conversation

@SickoHours

Copy link
Copy Markdown

What changed

Four small portability commits so bsp-compilation (head e4fb8b4) compiles on Linux with GCC 16 in the release_x86 configuration. No logic changes:

  • src/ObjCommon/Shader/D3D11ShaderAnalyser.h: #include <cstdint> (upstream main already has this).
  • src/ObjLoading/Game/T6/BSP/BSPUtil.cpp: remove a stray #pragma once from a .cpp (GCC errors under -Werror=pragma-once-outside-header).
  • BSP/Linker/{BSPLinker,ClipMapLinker,GfxWorldLinker}.cpp: #include <cstring> for memset/memcpy; BSP/Linker/{ComWorldLinker,GfxWorldLinker}.cpp: #include <cmath> for cosf/roundf.
  • BSP/Linker/GfxWorldLinker.cpp: unsigned __int16 (MSVC only) to uint16_t.
  • src/ObjLoading/Game/T6/TechniqueSet/LoaderTechniqueSetT6.cpp: _strdup to strdup.

Evidence

Built with premake5 gmake && make -C build config=release_x86 Linker Unlinker (g++ 16.2.1, 32-bit multilib, premake 5.0 beta8). The resulting Linker (v0.24.1-296-ge4fb8b47) linked a minimal Zombies map from a Blender 5.2 GLB export (one closed room, sun, worldspawn, mp_global_intermission, four spawnpoint, one zone, four spawner nodes) into a zm_box.ff carrying gfxworld, clipmap, comworld, gameworldmp, mapents and skinnedverts; both the branch Unlinker and stock OAT 0.33 list it with 0 errors, and the dumped entity string has the expected structs.

Not verified

The map has not been loaded in the game yet, so this PR claims a build fix only. Two observations from the same session that may be useful, not addressed here: two identical links of the same inputs produce fastfiles differing in ~2200 bytes of the compressed body (headers equal), which suggests uninitialized memory somewhere in the BSP linkers; and a .gltf with an external .bin buffer is refused ("File buffers are not supported"), so GLB is the working export.

🤖 Generated with Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant