Skip to content

Draft: Port W3D Viewer from MFC to Qt 6 - #158

Draft
caseychaos1212 wants to merge 2 commits into
w3dhub:mainfrom
caseychaos1212:pr-w3dview-qt
Draft

Draft: Port W3D Viewer from MFC to Qt 6#158
caseychaos1212 wants to merge 2 commits into
w3dhub:mainfrom
caseychaos1212:pr-w3dview-qt

Conversation

@caseychaos1212

Copy link
Copy Markdown
Collaborator

Summary

This draft introduces W3DViewQt, a Qt 6 Widgets port of the legacy MFC W3D Viewer.

The goal is feature parity with the supported MFC application while moving all editable layouts into Qt Designer forms. The port currently includes 28 checked-in .ui files, including the main window and all custom dialogs.

This is intentionally a draft. Additional native parity testing and several export edge cases remain before it should be merged.

Implemented

  • Qt Designer-owned main window, dialogs, menus, toolbars, actions, and tab order
  • W3D loading, asset tree population, selection, rendering, and material preview
  • Camera, object, lighting, fog, background, resolution, and fullscreen controls
  • Animation attachment, playback, pause, stop, stepping, blending, and speed controls
  • HLOD inspection and manual switching
  • Screenshot and AVI capture
  • Aggregate, emitter, sphere, ring, HLOD, and sound editing/export workflows
  • Atomic fixed-name exports with overwrite protection and write-failure detection
  • Drag-and-drop, MRU files, settings, shortcuts, and single-instance file forwarding
  • OpenAL Soft and FFmpeg audio for x64 builds
  • Automatic Qt runtime and platform-plugin deployment with windeployqt

Qt and audio requirements

  • Qt 6.6 or newer
  • OpenAL Soft and FFmpeg enabled for the x64 Qt preset
  • Miles disabled for the x64 Qt viewer
  • Windows still requires the legacy DirectX June 2010 runtime for d3dx9_43.dll

Supporting engine changes

  • Result-bearing screenshot and movie-capture APIs
  • More robust frame-grab and Direct3D device-reset handling
  • x64-safe aligned object-pool allocation
  • Sticky chunk-writer error tracking and checked micro-chunk writes
  • Serializer failure propagation for supported W3D export types
  • OpenAL repeated Play/Stop teardown protection
  • Runtime guards for missing dazzle types and standalone skinned meshes

Validation

Tested with Visual Studio 2022 x64 in Release configuration.

  • 15/15 registered tests pass
  • All 28 Designer forms pass uic validation
  • OpenAL generated-audio tests pass with the null output driver
  • Supplied real W3D, texture, animation, HLOD, emitter, primitive, aggregate, and sound assets load successfully
  • Real A10 sound preview and large-WAV streaming paths pass
  • Physical OpenAL playback was manually verified
  • Deployed executable starts with the app-local Qt platform plugin
  • Binary imports Qt 6, OpenAL, and FFmpeg with no Miles dependency

Remaining work

  • Native aggregate creation/editing and lineup mutation
  • Native sound creation/editing, animation-triggered playback, and spatial attenuation
  • Full visible-settings save/change/load round trip
  • Reverse, automatic, and screen-area HLOD validation
  • Lossless emitter line-property export
  • Lossless HLOD aggregate/proxy-array export
  • Quick-settings shortcuts 1–9 require suitable disposable fixture files

Review notes

Because this remains a draft, review is currently most useful around architecture, Qt ownership, shared-engine API changes, and any missing MFC workflows. Additional fixes and validation commits will be added to this branch before marking the PR ready for review. Much of this code was written by Codex 5.4-5.6 I've been testing assets from renegade as I've gone. I'm not familiar with every feature for the original w3d viewer so I haven't been able to test every workflow.

@OmniBlade

Copy link
Copy Markdown
Collaborator

There is a lot going on in this PR (which I realise is still WIP), I would prefer the engine improvements to be PR'd separately as well as adding unit testing, one for each improvement (mempool, audio engine, chunk format handling) as they can be reviewed and merged separately and have the addition of the new QT port of W3DView follow that.

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.

2 participants