feat(macos): Full native macOS port via Apple Metal and 64-bit architecture refactor#1
Merged
Conversation
…by using SHGetKnownFolderPath() (TheSuperHackers#2479) The runtime requires Windows Vista or higher
…Contain::processDamageToContained (TheSuperHackers#2427)
…Contain::killAllContained (TheSuperHackers#2439)
- Fixed a few crashes - Fixed a double triggering of stats callback
…-ibra/fix/map-subdirectory"
… disable light pulses when active
- More merge fixes
…gfix/adaptive-fps bugfix(gamelod): Restore adaptive FPS effects scaling after merge and disable dynamic light pulses when active
- Fix various crashes seen on sentry in QFE2
Self-contained header providing D3D8 type definitions, enumerations, structs, and abstract COM interface classes for macOS compilation. No dependency on objbase.h or windows.h. Guarded with #ifdef __APPLE__ — no impact on other platforms.
Provides HWND, HRESULT, DWORD, RECT, POINT, MessageBox stubs and other Win32 type definitions needed by shared engine code on macOS. Included from compat.h. Uses #ifdef __APPLE__ guard. All types use #ifndef guards for safe coexistence with d3d8_compat.h.
…acros On macOS, include d3d8_compat.h instead of d3d8.h. DX8CALL macros forward to mock device; DX8CALL_D3D is no-op. Class DX8Wrapper unchanged — all D3D types provided by d3d8_compat.h. Existing Windows code flow fully preserved.
On macOS this file compiles empty — Metal implementation will be provided via dx8wrapper_metal.mm in Platform/MacOS/.
Platform/MacOS/Include/d3d8.h → d3d8_compat.h Platform/MacOS/Include/d3d8types.h → d3d8_compat.h Platform/MacOS/Include/d3d8caps.h → d3d8_compat.h Platform/MacOS/Include/d3dx8math.h → D3DXMATRIX/VECTOR stubs + D3DXVec3Transform Platform/MacOS/Include/d3dx8core.h → empty stub CMake will add Platform/MacOS/Include/ to include path (step 08).
Windows code wrapped in #ifndef __APPLE__. macOS stub sets full capability support matching Metal GPU: - 8 texture stages, 4096 max texture size - All texture/render/depth formats supported - TnL, DXTC, bump mapping, aniso filtering enabled
Win32 RegOpenKeyEx/RegQueryValueEx/RegSetValueEx functions wrapped in #ifndef __APPLE__. macOS stubs return false for reads (use defaults) and true for writes (no-op). High-level wrappers compile unchanged.
…API missing libs; filesystem path resolving
…cific textures while cleaning up diagnostic logs
- Removed premature m_keyStatus updates in MacOSKeyboard to prevent Keyboard::updateKeys() from misidentifying the first key down as an OS repeat. - Reordered event loop in MacOSGameEngine::update() to fill the ring buffer before GameEngine::update() processes it. - Bound TheMessageTime to [event timestamp] to accurately align engine timings with macOS uptime. - Captured [event characters] during NSEventTypeKeyDown and injected them as WM_CHAR into IMEManager. - Refactored IMEManagerStub to properly track the active GameWindow (attach/detach) and route WM_CHAR messages as GWM_IME_CHAR, restoring functionality to in-game text fields.
…er FVF in DrawPrimitive and DrawIndexedPrimitive
- Mapped 'AudioManager' listener vectors ('m_listenerPosition' and 'm_listenerOrientation') to 'alListenerfv' to provide OpenAL with the correct Z-Up coordinate projection.
- Added 'setDeviceListenerPosition()' call into 'MacOSAudioManager::update()' to dynamically track the tactical camera tick loop, fixing the frozen 'right-ear' menu audio bug.
- Implemented core downmixing ('clientFormat.mChannelsPerFrame = 1') for 'loadAudioFileIntoBuffer' to convert native stereo spatial effects into localized mono streams, permitting OpenAL to process HRTF attenuation.
- Segmented 'AudioBufferCacheEntry' by format ('_mono' vs '_stereo') to prevent conflicts between ambient soundtracks and positional events.
…cy, and add audio debugging utilities
…k calls and fixing preprocessor macro syntax in JSON parsing.
- Added 'Ported by OKJI (Okladnoj)' widget to the bottom-left of the launcher window. - Included OKJI avatar/logo. - Added direct links to the macOS Generals Telegram community and the author's portfolio website. - Updated assemble_distribution.sh to package the new author_logo.png asset into the app bundle resources.
|
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.
Overview
This pull request introduces the complete, natively playable macOS port of Command & Conquer: Generals Zero Hour. It represents a massive culmination of engine refactoring, transitioning the legacy 32-bit DirectX 8 architecture into a modern 64-bit Apple Metal-compatible state, while maintaining strict adherence to our Zero-Modification Policy to ensure network parity with Windows clients.
Key Technical Milestones
🎨 1. Apple Metal Renderer (DX8 Bridge)
.tga) and DDS (.dds) headers (fixing the "magenta screen" missing texture issue).MTLStoreActionStoreAndMultisampleResolvepasses to prevent destination alpha loss.clip_distance), and Cubemap support.💾 2. NativeFileSystem & Resource Resolving
MacOSLocalFileSystemfacade, natively handling the conversion of Windows-style backslashes to macOS forward slashes.UserData/Maps/.🧠 3. 64-bit Game Logic Stability
DEATH_NORMAL/LEVEL_REGULAR) broke damage assignment, resulting in invincible units.Drawable::drawUITextensuringDrawableinstances safely handle lifecycles without outliving their parentObjectsduring destruction cycles.Checklist
// TheSuperHackersattribution tags inside mutated engine files