Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
70 commits
Select commit Hold shift + click to select a range
8cf9456
bugfix(globaldata): Fix the handling of documents folder redirection …
Mauller Mar 29, 2026
a6fdd0a
fix(smudge): Align smudges Y offset range with X offset range (#2498)
xezon Mar 29, 2026
bab63d4
bugfix(contain): Restore retail compatibility after crash fix in Open…
Caball009 Mar 29, 2026
6e96a09
bugfix(contain): Restore retail compatibility after crash fix in Open…
Caball009 Mar 29, 2026
4e93e0d
- Compile fix
x64-dev Mar 29, 2026
54751e1
Merge https://github.com/TheSuperHackers/GeneralsGameCode
x64-dev Mar 29, 2026
1b16f1b
Revert "Merge pull request #387 from MrS-ibra/fix/map-subdirectory"
x64-dev Mar 29, 2026
152b0c1
- Put radar alert changes behind PRESERVE_RETAIL_BEHAVIOR flag for now
x64-dev Mar 29, 2026
921fbbc
- Version increment
x64-dev Mar 29, 2026
7e22a6d
- Added a comment about future migration to SChannel backed libcurl
x64-dev Mar 29, 2026
8e29982
- Extra safety in gamespy UIs
x64-dev Mar 30, 2026
e08d0ca
- Temporary, nasty fix for SupW_AuroraFuelBombWeapon
x64-dev Mar 31, 2026
df03a12
- Latest crash fixes from QFE1
x64-dev Mar 31, 2026
d61a796
bugfix(gamelod): Restore adaptive FPS effects scaling after merge and…
MrS-ibra Mar 31, 2026
880377f
Fix bad merge in gamedefines.h
x64-dev Mar 31, 2026
0dd8f83
- Stability fixes
x64-dev Mar 31, 2026
8f951c5
version increment
x64-dev Mar 31, 2026
56afa53
Merge pull request #440 from MrS-ibra/bugfix/adaptive-fps
x64-dev Mar 31, 2026
fb4384e
Fix 'backspace bug' where key input would be processed repeatedly
x64-dev Apr 1, 2026
b71d37a
- Avoid duplicate/already processed keys too
x64-dev Apr 1, 2026
605bb30
- Decrease cooldown on chat messages
x64-dev Apr 3, 2026
6d3f224
- Version increment
x64-dev Apr 3, 2026
6266009
- Log which HTTP protocol we are using to communicate with GO services
x64-dev Apr 5, 2026
19d9e3f
feat: Add d3d8_compat.h — D3D8 types and COM interfaces for macOS
Okladnoj Mar 29, 2026
f406032
feat: Add win32types_compat.h — Win32 types for macOS
Okladnoj Mar 29, 2026
2dbf10e
feat: Add macOS guards in dx8wrapper.h — include switch and DX8CALL m…
Okladnoj Mar 29, 2026
25a6530
feat: Wrap dx8wrapper.cpp in #ifndef __APPLE__ guard
Okladnoj Mar 29, 2026
783f16c
feat: Add D3D8/D3DX header proxies for macOS include redirect
Okladnoj Mar 29, 2026
0265462
feat: Add macOS DX8Caps stub with Metal-safe defaults
Okladnoj Mar 29, 2026
b40dc2f
feat: Add macOS registry stubs — graceful fallback for config reads
Okladnoj Mar 29, 2026
406a290
feat: Add macOS CMake configuration — Phase 1 complete
Okladnoj Mar 29, 2026
8c1dc1c
feat: Import Metal bridge from GeneralsGameCode
Okladnoj Mar 29, 2026
2781642
feat: Add macOS entry point mirroring WinMain.cpp flow
Okladnoj Mar 30, 2026
0edb14e
feat: Add MacOSGameEngine — factory mirroring Win32GameEngine
Okladnoj Mar 30, 2026
34582fe
feat: Add dx8wrapper_metal.mm — all static fields + method stubs
Okladnoj Mar 30, 2026
82ae5d3
feat: Create MacOSKeyboard and MacOSMouse
Okladnoj Mar 30, 2026
34ce52e
feat: Implement AudioManager stub for macOS
Okladnoj Mar 30, 2026
50f76f4
feat: Implement macOS platform abstraction layer and integrate Metal …
Okladnoj Mar 30, 2026
be85cd9
fix: Fix 64-bit struct padding issues for texture loading on macOS
Okladnoj Apr 3, 2026
2add31e
fix: Metal vertex buffer synchonization and pixel-perfect font rendering
Okladnoj Apr 4, 2026
5abc54a
feat: Track display manager interface
Okladnoj Apr 4, 2026
8d603de
feat: Implement macOS memory detection and processor speed initializa…
Okladnoj Apr 4, 2026
9b64ecc
feat: Save state before merge
Okladnoj Apr 5, 2026
b5ee786
fix: Restore zombie units logic fix under __APPLE__; resolve network …
Okladnoj Apr 6, 2026
183b15d
fix: Fix Metal normal transformation determinant and dynamic lighting…
Okladnoj Apr 7, 2026
15e06c9
fix: Resolve Metal lighting issues and force linear filtering for spe…
Okladnoj Apr 7, 2026
2caaea1
chore: Fix keyboard input lag and text entry
Okladnoj Apr 7, 2026
59028e3
refactor: Remove debug logging from light environment addition logic
Okladnoj Apr 7, 2026
c3122b3
feat: Implement Metal cubemaps & clip plane infrastructure
Okladnoj Apr 7, 2026
f041a80
docs: Add MacOS Metal specification for Cubemaps and Clip Planes
Okladnoj Apr 7, 2026
d65b811
docs: Add index README to dx8_metal_specs
Okladnoj Apr 7, 2026
fd0c027
fix: Fix missing decals and particles by safely resolving vertex buff…
Okladnoj Apr 7, 2026
3200cd3
fix: Fix 3D Positional Audio and OpenAL Spatialization
Okladnoj Apr 8, 2026
d594fc8
refactor: Improve Metal shader projective clipping and BC1 transparen…
Okladnoj Apr 8, 2026
1bf044b
feat: Audio Subsystem Implementation
Okladnoj Apr 11, 2026
384d463
fix: Filesystem Architecture (NativeFileSystem) and .big priority fixes
Okladnoj Apr 11, 2026
e2a9909
feat: Native Swift Launcher & Deploy UI Pipeline
Okladnoj Apr 11, 2026
ead58d1
fix: Multiplayer Lockstep Networking, GameSpy stubs & CRC Fixes
Okladnoj Apr 11, 2026
2cf98ba
feat: CMake Configuration, GameEngine Stubs & Build Environment
Okladnoj Apr 11, 2026
36143ff
fix: Restore macOS-specific CACert fallback and HTTPManager wrappers
Okladnoj Apr 11, 2026
1eeb8a2
docs: Add compliance documentation for 64-bit macOS cast fixes
Okladnoj Apr 11, 2026
218fbf7
chore: Setup macOS build scripts and VSCode workspace
Okladnoj Apr 11, 2026
76a1f2f
chore: Remove obsolete patch files and temporary scripts
Okladnoj Apr 11, 2026
f0a4d6b
fix(network): Fix map path synchronization for lobby hasMap resolution
Okladnoj Apr 12, 2026
5fff606
fix(filesystem): Fix map transfer file write path resolution on macOS
Okladnoj Apr 13, 2026
f46f56c
fix(macos): Fix file system path bounds cleanup, audio and Metal MSL …
Okladnoj Apr 14, 2026
15f6ff2
docs(macos): Translate port documentation to English for community re…
Okladnoj Apr 14, 2026
92f5f73
Merge remote-tracking branch 'god-team/main' into okji/feat/macos-port
Okladnoj Apr 14, 2026
c599046
fix: Add macOS compatibility by implementing platform-specific networ…
Okladnoj Apr 15, 2026
0b06aee
feat(macUI): Embed organic author attribution widget in macOS launcher
Okladnoj Apr 15, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
11 changes: 10 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,13 @@ build.ninja

## Python
__pycache__/
*.pyc

CRCLogs/

# Large Game Assets
Data/*.big

# Heavy Logs & Media
Platform/MacOS/Build/Logs/
*.gif

30 changes: 30 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "macOS: Run build_run_mac.sh (Console)",
"type": "node-terminal",
"request": "launch",
"command": "sh build_run_mac.sh",
"cwd": "${workspaceFolder}"
},
{
"name": "macOS: Visual Debug C&C Generals",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/build/macos/GeneralsMD/GeneralsOnlineZH.app/Contents/MacOS/GeneralsOnlineZH",
"args": [
"-win"
],
"cwd": "${workspaceFolder}",
"environment": [
{ "name": "GENERALS_INSTALL_PATH", "value": "/Users/okji/dev/games/Command and Conquer - Generals/" },
{ "name": "GENERALS_FPS_LIMIT", "value": "60" },
{ "name": "GENERALS_MAC_DEBUG", "value": "1" }
],
"MIMode": "lldb",
"preLaunchTask": "macOS: CMake Compile Only",
"externalConsole": false
}
]
}
15 changes: 15 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{

"editor.formatOnSave": false,
"terminal.integrated.fontSize": 12,
"terminal.integrated.fontFamily": "monospace",
"terminal.integrated.lineHeight": 1.2,
"terminal.integrated.cursorBlinking": true,
"terminal.integrated.cursorStyle": "line",
"terminal.integrated.fontWeight": "normal",
"terminal.integrated.fontWeightBold": "bold",
"terminal.integrated.defaultProfile.osx": "zsh",
"editor.rulers": [
120
]
}
56 changes: 56 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "macOS: Release Build + Launcher",
"type": "shell",
"command": "sh build_mac.sh --launcher",
"group": "build",
"presentation": {
"reveal": "always",
"panel": "new"
},
"problemMatcher": []
},
{
"label": "macOS: Clean Release Build + Launcher",
"type": "shell",
"command": "sh build_mac.sh --clean --launcher",
"group": "build",
"presentation": {
"reveal": "always",
"panel": "new"
},
"problemMatcher": []
},
{
"label": "macOS: Debug Build + Run",
"type": "shell",
"command": "sh build_run_mac.sh",
"group": "build",
"presentation": {
"reveal": "always",
"panel": "new"
},
"problemMatcher": []
},
{
"label": "macOS: Clean Debug Build + Run",
"type": "shell",
"command": "sh build_run_mac.sh --clean",
"group": "build",
"presentation": {
"reveal": "always",
"panel": "new"
},
"problemMatcher": []
},
{
"label": "macOS: CMake Compile Only",
"type": "shell",
"command": "cmake --build build/macos",
"group": "build",
"problemMatcher": []
}
]
}
11 changes: 11 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ endif()
# Top level project, doesn't really affect anything.
project(genzh LANGUAGES C CXX)

if(APPLE)
enable_language(OBJCXX)
add_compile_options(-ffp-contract=off)
endif()

# This file handles extra settings wanted/needed for different compilers.
include(cmake/compilers.cmake)

Expand Down Expand Up @@ -65,6 +70,8 @@ endif()
include(cmake/config.cmake)
include(cmake/gamespy.cmake)
include(cmake/lzhl.cmake)
include(cmake/curl.cmake)
include(cmake/gns.cmake)

if (IS_VS6_BUILD)
# The original max sdk does not compile against a modern compiler.
Expand All @@ -81,6 +88,10 @@ endif()

add_subdirectory(resources)

if(APPLE)
add_subdirectory(Platform/MacOS)
endif()

add_subdirectory(Core)

# Add main build targets
Expand Down
35 changes: 35 additions & 0 deletions CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,22 @@
"cacheVariables": {
"RTS_BUILD_OPTION_PROFILE": "ON"
}
},
{
"name": "macos",
"displayName": "macOS Release",
"generator": "Ninja",
"hidden": false,
"binaryDir": "${sourceDir}/build/${presetName}",
"cacheVariables": {
"CMAKE_EXPORT_COMPILE_COMMANDS": "ON",
"CMAKE_BUILD_TYPE": "Release"
},
"condition": {
"type": "equals",
"lhs": "${hostSystemName}",
"rhs": "Darwin"
}
}
],
"buildPresets": [
Expand Down Expand Up @@ -306,6 +322,12 @@
"configurePreset": "mingw-w64-i686-profile",
"displayName": "Build MinGW-w64 32-bit (i686) Profile",
"description": "Build MinGW-w64 32-bit (i686) Profile"
},
{
"name": "macos",
"configurePreset": "macos",
"displayName": "Build macOS Release",
"description": "Build macOS Release"
}
],
"workflowPresets": [
Expand Down Expand Up @@ -503,6 +525,19 @@
"name": "mingw-w64-i686-profile"
}
]
},
{
"name": "macos",
"steps": [
{
"type": "configure",
"name": "macos"
},
{
"type": "build",
"name": "macos"
}
]
}
]
}
12 changes: 9 additions & 3 deletions Core/GameEngine/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -553,7 +553,7 @@ set(GAMEENGINE_SRC
Include/GameNetwork/RankPointValue.h
Include/GameNetwork/Transport.h
Include/GameNetwork/udp.h
Include/GameNetwork/User.h
# Include/GameNetwork/User.h
Include/GameNetwork/WOLBrowser/FEBDispatch.h
Include/GameNetwork/WOLBrowser/WebBrowser.h
# Include/Precompiled/PreRTS.h
Expand Down Expand Up @@ -679,6 +679,7 @@ set(GAMEENGINE_SRC
# Source/Common/System/Upgrade.cpp
Source/Common/System/Xfer.cpp
Source/Common/System/XferCRC.cpp
Source/Common/System/NativeFileSystem.cpp
Source/Common/System/XferLoad.cpp
Source/Common/System/XferSave.cpp
# Source/Common/TerrainTypes.cpp
Expand Down Expand Up @@ -1143,7 +1144,7 @@ set(GAMEENGINE_SRC
Source/GameNetwork/Transport.cpp
Source/GameNetwork/udp.cpp
Source/GameNetwork/User.cpp
Source/GameNetwork/WOLBrowser/WebBrowser.cpp
# Source/GameNetwork/WOLBrowser/WebBrowser.cpp
# Source/Precompiled/PreRTS.cpp
)

Expand Down Expand Up @@ -1191,11 +1192,16 @@ target_link_libraries(corei_gameengine_public INTERFACE
core_compression
core_browserdispatch
#core_wwvegas
d3d8lib
gamespy::gamespy
stlport
)

if(NOT APPLE)
target_link_libraries(corei_gameengine_public INTERFACE
d3d8lib
)
endif()

# ReactOS ATL for MinGW-w64 only (MSVC uses native ATL)
if(MINGW)
target_link_libraries(corei_gameengine_public INTERFACE reactos_atl)
Expand Down
46 changes: 46 additions & 0 deletions Core/GameEngine/Include/Common/Debug.h
Original file line number Diff line number Diff line change
Expand Up @@ -257,3 +257,49 @@ class SimpleProfiler
#endif

// MACROS //////////////////////////////////////////////////////////////////



#ifdef __APPLE__
#include <stdio.h>
#include <stdlib.h>

#define MAC_LOG_TAG(tag, m) do { \
printf("[" tag "] "); \
printf m; \
printf("\n"); \
fflush(stdout); \
} while(0)

#define DEBUG_CRASH_MAC(m) do { \
if (getenv("GENERALS_MAC_DEBUG") && atoi(getenv("GENERALS_MAC_DEBUG")) != 0) { \
MAC_LOG_TAG("DEBUG_CRASH_MAC", m); \
} \
} while(0)
#else
#define MAC_LOG_TAG(tag, m) ((void)0)
#define DEBUG_CRASH_MAC(m) ((void)0)
#endif

#define DEBUG_BUILDMAPCACHE_FLAG
#define DEBUG_INFO_MAC_FLAG
#define DEBUG_FILESYSTEM_MAC_FLAG

#ifdef DEBUG_BUILDMAPCACHE_FLAG
#define DEBUG_BUILDMAPCACHE(m) MAC_LOG_TAG("DEBUG_BUILDMAPCACHE", m)
#else
#define DEBUG_BUILDMAPCACHE(m) ((void)0)
#endif

#ifdef DEBUG_INFO_MAC_FLAG
#define DEBUG_INFO_MAC(m) MAC_LOG_TAG("DEBUG_INFO_MAC", m)
#else
#define DEBUG_INFO_MAC(m) ((void)0)
#endif

#ifdef DEBUG_FILESYSTEM_MAC_FLAG
#define DEBUG_FILESYSTEM_MAC(m) MAC_LOG_TAG("DEBUG_FILESYSTEM_MAC", m)
#else
#define DEBUG_FILESYSTEM_MAC(m) ((void)0)
#endif

4 changes: 4 additions & 0 deletions Core/GameEngine/Include/Common/FileSystem.h
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,10 @@ typedef UnsignedByte FileInstance;
#endif


#ifdef __APPLE__
#define FileInfo RTSFileInfo
#endif

struct FileInfo {

Int64 size() const { return (Int64)sizeHigh << 32 | sizeLow; }
Expand Down
15 changes: 15 additions & 0 deletions Core/GameEngine/Include/Common/GameCommon.h
Original file line number Diff line number Diff line change
Expand Up @@ -290,17 +290,32 @@ const VeterancyLevelFlags VETERANCY_LEVEL_FLAGS_NONE = 0x00000000;

inline Bool getVeterancyLevelFlag(VeterancyLevelFlags flags, VeterancyLevel dt)
{
#ifdef __APPLE__
UnsignedInt bit = (dt == 0) ? 31u : (UnsignedInt)(dt - 1);
return (flags & (1UL << bit)) != 0;
#else
return (flags & (1UL << (dt - 1))) != 0;
#endif
}

inline VeterancyLevelFlags setVeterancyLevelFlag(VeterancyLevelFlags flags, VeterancyLevel dt)
{
#ifdef __APPLE__
UnsignedInt bit = (dt == 0) ? 31u : (UnsignedInt)(dt - 1);
return (flags | (1UL << bit));
#else
return (flags | (1UL << (dt - 1)));
#endif
}

inline VeterancyLevelFlags clearVeterancyLevelFlag(VeterancyLevelFlags flags, VeterancyLevel dt)
{
#ifdef __APPLE__
UnsignedInt bit = (dt == 0) ? 31u : (UnsignedInt)(dt - 1);
return (flags & ~(1UL << bit));
#else
return (flags & ~(1UL << (dt - 1)));
#endif
}

// ----------------------------------------------------------------------------------------------
Expand Down
17 changes: 0 additions & 17 deletions Core/GameEngine/Include/Common/GameDefines.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,18 +41,6 @@
#endif
#endif

// This is here to easily toggle between the retail compatible with fixed pathfinding fallback and pure fixed pathfinding mode
#if RETAIL_COMPATIBLE_CRC

#if defined(GENERALS_ONLINE)
#define RETAIL_COMPATIBLE_PATHFINDING (0)
#else
#define RETAIL_COMPATIBLE_PATHFINDING (1)
#endif
#else
#define RETAIL_COMPATIBLE_PATHFINDING (0)
#endif

// This is here to easily toggle between the retail compatible pathfinding memory allocation and the new static allocated data mode
#ifndef RETAIL_COMPATIBLE_PATHFINDING_ALLOCATION
#if defined(GENERALS_ONLINE)
Expand All @@ -73,11 +61,6 @@
#define RETAIL_COMPATIBLE_CIRCLE_FILL_ALGORITHM (1) // Use the original circle fill algorithm, which is more efficient but less accurate
#endif

// Disable non retail fixes in the networking, such as putting more data per UDP packet
#ifndef RETAIL_COMPATIBLE_NETWORKING
#define RETAIL_COMPATIBLE_NETWORKING (1)
#endif

// This is essentially synonymous for RETAIL_COMPATIBLE_CRC. There is a lot wrong with AIGroup, such as use-after-free, double-free, leaks,
// but we cannot touch it much without breaking retail compatibility. Do not shy away from using massive hacks when fixing issues with AIGroup,
// but put them behind this macro.
Expand Down
Loading
Loading