EA just open sourced Command & Conquer, Red Alert, Renegade and Generals https://www.gamingonlinux.com/2025/02/ea-just-open-sourced-command-conquer-red-alert-renegade-and-generals/
EA just open sourced Command & Conquer, Red Alert, Renegade and Generals https://www.gamingonlinux.com/2025/02/ea-just-open-sourced-command-conquer-red-alert-renegade-and-generals/
From the Command & Conquer Generals source code.
"Lets discuss how Windows is a flaming pile of poo"
Oh how that gave me a chuckle 😂
Command and Conquer: Generals - Zero Hour. Contribute to electronicarts/CnC_Generals_Zero_Hour development by creating an account on GitHub.
Hmm.
It looks like Microsoft wanted DEV_BROADCAST_HDR to be a discriminated union, but with the different variants having different sizes, presumably so that they could introduce new variants later without breaking existing code.
This is the correct way to accomplish that.
#Rust does something similar for trait object downcasting: check if the desired type is the same as the actual type, and if so, cast the pointer.
Check: https://doc.rust-lang.org/1.85.0/src/core/any.rs.html#225
Cast: https://doc.rust-lang.org/1.85.0/src/core/any.rs.html#294