Blzut3's Weblog

Weblog ECWolf ECWolf Wiki
News

The road to modern C++ 2016-02-29 02:08:12

A few weeks ago ZDoom 2.8 was released. The release was prompted by both the desire to merge Randi's scripting work, the wall portals submission, as well as general interest in making linked portals work. In other words the code base is going through major changes going forward so it made sense to cut a release. With it we have finally decided that it was time to move onto using C++11/14.

Both ZDoom and ECWolf have been using Visual Studio 2005 as the primary compiler for Windows. There were a few reasons for this but much of it was because newer versions of Visual Studio dropped support for newer operating systems. So far, throughout the life of the ZDoom project, the only platforms that we have dropped was Windows 95 and DOS (DOS support went away fairly early on). Even though VS2005 doesn't officially support targeting 95, ZDoom had a hack for awhile to make it work, but support broke for unrelated reasons that went unnoticed for a long time. Some people have been pretty critical of the fact that Windows 9x was still a supported platform, but, besides offering a better user experience, one of the advantage of rolling our own platform abstraction layer with native back ends is that there was never really any pressing reason to drop support for the old platforms. The DirectDraw code works just as well now as it did back then with little maintenance needed, so for the most part the only difference supporting 9x makes is that a few more Windows API calls need to be made optional by resolving the symbols at run time. A task which thanks to C++ templates can be made fairly unobtrusive and with C++11 can be made nearly transparent. (Vista also expanded the Win32 API significantly enough that we have a few cases where this needs to be done for XP as well.)

Times do eventually change though for even the most stubborn people. FMOD Ex unintentionally dropped compatibility for pre-XP systems (asked about it in an email and Firelight wasn't really aware that they dropped the platforms when they switched to using the VS2010 compilers) and it has been deprecated in favor of FMOD Studio. Even though ZDoom does have the ability to be compiled with OpenAL now, FMOD remains the only first class sound back end so our days of being able to use the preferred middleware and continue to run on the older operating systems is drawing to a close. To put it another way, it is only know that supporting old operating system is actually becoming a problem for us.

The question that I'm trying to answer here is "what does this mean for ECWolf?" Obviously I want to continue to share code with ZDoom so this does mean that ECWolf will need to make the jump as well. Windows 98 machines are more common in the Wolf3D community due to compatibility with DOS mods, but it is clear that keeping 9x as a first class citizen is going to be a problem going forward. Thus ECWolf 1.4.x will be the last series to do so and starting with 1.5 a C++11/14 compiler will be required.

Of course this doesn't spell the end of either ECWolf nor ZDoom on these older platforms. It is possible to compile C++14 programs for them using MinGW (vanilla MinGW as mingw-w64 requires XP or later as well), and so I will at least be providing a version of ECWolf for legacy systems until further notice. This actually is something I was debating doing regardless for awhile now as 32-bit users could benefit from SDL2 regardless, but this makes the decision easier. There are multiple factors on if ZDoom will as well that I can't predict right now, but it will possible for some time to roll 9x compatible binaries with a properly configured compiler. One thing is for sure though, due to some quirks with MinGW these binaries will not be able to provide nearly the same experience as the VS ones (delay loaded libraries and exception interoperability being notable missing features).

For the two people still using PowerPC Macs, I don't believe there's anything to worry about. GCC 5.3 seems to work just fine on them so I believe I can still provide binaries. There are some quirks with using a new compiler such as structures getting extra padding on the ends which breaks some file IO code that utilizes commonly exploited undefined behavior as well as a bug with C++ exceptions in Objective-C++ code (it's in the GCC bug tracker, but don't have a link on hand). These are fairly trivial issues to work around though. For ZDoom, however, providing binaries will depend on how long FMOD Ex is supported in ZDoom. Once that is dropped then PowerPC ZDoom binaries will only be available through unofficial channels thanks to OpenAL. (On a related note to pre-XP being dropped in FMOD Ex, I think G3 processor support got dropped accidentally in the 4.24 series as the fact that Apple's gcc-4.2 forces targeting the G4 or later is not well documented. Of course compiling your own GCC allows you to target the G3.)

 

© 2004-2024 Braden "Blzut3" Obrzut