Fix MSVC build errors and Blender preview crash #1

Open
colby.fox wants to merge 2 commits from colby.fox/msvc-build into main AGit
First-time contributor

Two fixes found while setting up a Windows dev machine.

1. MSVC build errors (994a2fc)
The editor target does not compile with MSVC (VS 2026, toolset 14.51). Clang on Linux doesn't flag these, but MSVC treats them as errors:

  • 7x C4458: locals/params named Owner, Mesh and Instigator hide AActor/ACharacter members in TFWeapon, TFGrunt and TFMech. They're renamed to OwnerActor, PartMesh/RifleMesh and DamageInstigator.
  • 1x C2397 in TFWaterSubsystem: FObstacle now uses the existing float Horizontal instead of narrowing the double Velocity.Size2D() in a brace initializer.

These are renames only, with no behaviour change. TitanFoxEditor Win64 Development now builds (Result: Succeeded).

2. Blender preview crash (9e176d0)
make_props.render_preview printed prefs.devices, but prefs is local to enable_gpu. So every --preview run crashed with a NameError after rendering, on any platform. It now uses enable_gpu's return value and logs e.g. preview rendered on OPTIX: ['NVIDIA GeForce RTX 5070'].

Tested on Windows 11 / RTX 5070: the editor build, PIE, the standalone -TFDemo (the Nyx mech crouches at x~8200 and stands again after the catwalk), make_pilot_rifle.py --preview on OptiX, and the headless import_effects.py.

?? Generated with Claude Code

Two fixes found while setting up a Windows dev machine. **1. MSVC build errors** (`994a2fc`) The editor target does not compile with MSVC (VS 2026, toolset 14.51). Clang on Linux doesn't flag these, but MSVC treats them as errors: - 7x C4458: locals/params named `Owner`, `Mesh` and `Instigator` hide `AActor`/`ACharacter` members in TFWeapon, TFGrunt and TFMech. They're renamed to `OwnerActor`, `PartMesh`/`RifleMesh` and `DamageInstigator`. - 1x C2397 in TFWaterSubsystem: `FObstacle` now uses the existing float `Horizontal` instead of narrowing the double `Velocity.Size2D()` in a brace initializer. These are renames only, with no behaviour change. TitanFoxEditor Win64 Development now builds (`Result: Succeeded`). **2. Blender preview crash** (`9e176d0`) `make_props.render_preview` printed `prefs.devices`, but `prefs` is local to `enable_gpu`. So every `--preview` run crashed with a NameError after rendering, on any platform. It now uses `enable_gpu`'s return value and logs e.g. `preview rendered on OPTIX: ['NVIDIA GeForce RTX 5070']`. **Tested on Windows 11 / RTX 5070:** the editor build, PIE, the standalone `-TFDemo` (the Nyx mech crouches at x~8200 and stands again after the catwalk), `make_pilot_rifle.py --preview` on OptiX, and the headless `import_effects.py`. ?? Generated with [Claude Code](https://claude.com/claude-code)
MSVC treats these as errors where Clang on Linux does not:
- Rename locals/params that hide AActor/ACharacter members
  (Owner, Mesh, Instigator) in TFWeapon, TFGrunt and TFMech.
- Use the float Horizontal speed in TFWaterSubsystem instead of
  narrowing the double from Velocity.Size2D() in a brace initializer.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
render_preview printed prefs.devices, but prefs is local to enable_gpu, so
every --preview run crashed after the render. Use enable_gpu's return value and
look up the Cycles prefs locally.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
colby.fox changed title from Fix MSVC build errors (C4458 shadowing, C2397 narrowing) to Fix MSVC build errors and Blender preview crash 2026-10-01 12:41:22 +00:00
This pull request can be merged automatically.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin +refs/pull/1/head:colby.fox/msvc-build
git switch colby.fox/msvc-build

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch main
git merge --no-ff colby.fox/msvc-build
git switch colby.fox/msvc-build
git rebase main
git switch main
git merge --ff-only colby.fox/msvc-build
git switch colby.fox/msvc-build
git rebase main
git switch main
git merge --no-ff colby.fox/msvc-build
git switch main
git merge --squash colby.fox/msvc-build
git switch main
git merge --ff-only colby.fox/msvc-build
git switch main
git merge colby.fox/msvc-build
git push origin main
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
aceraldi/TitanFox!1
No description provided.