Files
RP412/docs/BUILD-NOTES.md
T
CydandClaude Opus 4.8 f849415c02 Remove ATL dependency so VC++ Express can build
The Express editions of Visual C++ ship without ATL. The only ATL usage was
in MUNGA_L4/L4APP.cpp (atlbase.h/atlconv.h + USES_CONVERSION/W2A macros, all
in that one file) for wide-to-ANSI conversion of command-line arguments.

- Replace the ATL includes with a self-contained L4WideToAnsi helper (a
  WideCharToMultiByte wrapper) and local USES_CONVERSION/W2A macros that
  reproduce ATL's W2A semantics. All call sites consume the result immediately
  (stricmp / CString assignment / atoi / atol), so behaviour is unchanged.
- Set UseOfATL="0" in Munga_L4.vcproj, RP_L4.vcproj and their VS2008 variants.
- Document the Express build path and the confirmed June 2010 DirectX SDK in
  BUILD.md (new section 6) and docs/BUILD-NOTES.md.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-01 09:30:08 -05:00

6.9 KiB
Raw Blame History

Repository & Build Findings

Notes from the initial git import and build assessment of the Red Planet v4.10 Win32 source. See BUILD.md for the practical build instructions; this file records what was found and what was changed, and why.


1. What this repository is

  • Win32 source for the game Red Planet v4.10 (string confirmed in RP_L4/rpl4.log: Red Planet v4.10).
  • Engine: MUNGA (MUNGA/) — a cross-platform C++ game/sim engine.
  • Platform layer: MUNGA_L4 (MUNGA_L4/) — Win32 + DirectX 9 backend (Direct3D 9, DirectInput 8, OpenAL audio, SOS audio middleware headers).
  • Game code: RP (RP/) and RP_L4 (RP_L4/).
  • Support projects: DivLoader (asset/DIV loader), Setup1 (installer).
  • ~551 tracked files, ~9 MB.

Toolchain detected on the import machine

At import time the build machine had no usable C++ toolchain:

  • No Visual Studio, no cl.exe, no VCBuild.exe, no vswhere.
  • Only .NET Framework MSBuild.exe (v2v4) — which cannot build .vcproj.
  • MinGW gcc/g++ (unusable for this MSVC/DirectX codebase).
  • The required DirectX SDK (March 2009) was not installed.

A build attempt confirmed the blocker:

error MSB3428: Could not load the Visual C++ component "VCBuild.exe".

Building therefore requires installing VS 2005/2008 + the DirectX SDK (the user is sourcing these separately).


2. Changes made during preparation

2.1 Git hygiene (initial import commit)

  • Removed stale Subversion metadata (Setup1/.svn/) that pointed at a dead server (https://dev.vgcorps.com/svn/WinTesla).
  • Added .gitignore — VS build artifacts, IDE state, *.log, OS cruft. This excludes the runtime log RP_L4/rpl4.log.
  • Added .gitattributes — normalizes line endings, forces CRLF on Win32 source, marks .lib/.res/.egg/.rtf as binary.

2.2 Solution cleanup (WinTesla.sln)

The original solution referenced 10 projects, but only 4 exist in the repo. The 6 dangling references were removed so the solution loads cleanly:

Removed project Path referenced Present?
BT410_L4 BT410_L4\BT410_L4.vcproj missing
TextureExp TextureExp\TextureExp.vcproj missing
MeshExp MeshExp\MeshExp.vcproj missing
SphereExp SphereExp\SphereExp.vcproj missing
DetailExp DetailExp\DetailExp.vcproj missing
MatReplaceExp MatReplaceExp\MatReplaceExp.vcproj missing

Remaining (present) projects: RP_L4, Munga_L4, RPL4TOOL, DivLoader. Their GlobalSection(ProjectConfigurationPlatforms) entries were pruned to match. SolutionConfigurationPlatforms (Debug/Release/Remote Debug | Win32) were left unchanged.

The 6 missing projects appear to be model/texture exporter tools and a sister game project (BT410 — a different pod title) that live in other repositories. If you obtain them, re-add them to the solution.

2.3 DirectX SDK path un-hardcoded

Munga_L4.vcproj and RP_L4.vcproj (the VS2005 / v8.00 files) hardcoded:

C:\Program Files (x86)\Microsoft DirectX SDK (March 2009)\Include
C:\Program Files (x86)\Microsoft DirectX SDK (March 2009)\Lib\x86

Both were replaced (6 occurrences each) with the installer-provided variable, matching what the existing ... VS2008.vcproj variants already used:

$(DXSDK_DIR)Include
$(DXSDK_DIR)Lib\x86

DXSDK_DIR is set by the DirectX SDK installer and ends in a trailing backslash, so $(DXSDK_DIR)Include resolves correctly.

Status update: the DirectX SDK (June 2010) is now installed at C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\, and DXSDK_DIR is set machine-wide to that path. All required headers (d3d9.h, d3dx9.h, dinput.h) and libs (d3d9.lib, d3dx9.lib, dxerr.lib, dxguid.lib) are present. The un-hardcoded projects resolve to it automatically.

2.4 ATL removed (enables VC++ Express)

The Express editions of Visual C++ ship without ATL. The codebase's only ATL usage was in MUNGA_L4/L4APP.cpp<atlbase.h> / <atlconv.h> and the USES_CONVERSION / W2A macros (28 references, all in that one file), used purely to convert wide command-line arguments to ANSI in the arg parser. No COM, no CComPtr, no ATL windows.

Changes:

  • Replaced the ATL includes with a self-contained L4WideToAnsi helper class (a WideCharToMultiByte wrapper) plus local USES_CONVERSION / W2A macros that reproduce ATL's W2A semantics — each use yields an independent buffer valid until the end of the enclosing full-expression. Every call site consumes the result immediately (compare via stricmp, assign to MUNGA's CString, or pass to atoi/atol), so the behaviour is identical.
  • Set UseOfATL="0" in Munga_L4.vcproj, RP_L4.vcproj, and the two VS2008 variants.

CString in this file is MUNGA's own class (MUNGA/CSTR.h), not ATL's, so dropping the ATL headers does not affect it.


3. Project reference data

Collected from the .vcproj files for quick reference.

Configuration types

  • ConfigurationType="1" → Application (exe): RP_L4, RPL4TOOL
  • ConfigurationType="4" → Static library: Munga_L4, DivLoader
  • Munga_L4: OpenAL32.lib D3D9.lib D3DX9.lib DXERR.lib
  • RP_L4: WS2_32.lib Munga_l4.lib dinput8.lib dxguid.lib openal32.lib libsndfile-1.lib d3dx9.lib d3d9.lib dbghelp.lib
  • RPL4TOOL: Munga_l4.lib libsndfile-1.lib WS2_32.lib dinput8.lib dxguid.lib

Preprocessor definitions (RP_L4)

  • Debug: WIN32;_DEBUG;_WINDOWS;_CRT_SECURE_NO_DEPRECATE
  • Release: WIN32;_WINDOWS;_CRT_SECURE_NO_DEPRECATE

Character set

  • Munga_L4, RP_L4, RPL4TOOL: CharacterSet="1" (Unicode)
  • DivLoader: CharacterSet="2" (MBCS)

4. Orphaned / non-build files (informational)

These files are present but are not referenced by any project, so they do not affect the build. Left in place for historical completeness:

  • MUNGA_L4/JOYSTICK.asm — MASM source, not in any .vcproj. No MASM toolchain is required to build. (L4JOYSTK.h exists but the .asm is unused.)
  • MUNGA_L4/sos/SOSMAWE.C and the sos/bc4, sos/wc header trees — SOS audio middleware for old Borland/Watcom compilers; headers only.
  • RP_L4/TEST.EGG, RP_L4/last.egg.egg data blobs. last.egg is likely runtime-generated ("last loaded"); kept in tracking pending confirmation.
  • docs/audionotes.rtf — design notes.

5. Open questions for the owner

  1. Are the 6 removed projects (BT410_L4, *Exp tools) needed here, or do they belong to separate repos?
  2. Is RP_L4/last.egg a real asset or generated output? If generated, add it to .gitignore and untrack it.
  3. Which VS version is the target going forward — keep VS2005/2008 .vcproj, or upgrade to .vcxproj for a modern VS + Windows SDK (dropping the legacy DirectX SDK in favor of the Windows SDK's Direct3D)?