FWGS / xash3d

DEPRECATED in favor of https://github.com/FWGS/xash3d-fwgs. Only bugfixes are accepted.
https://xash.su
GNU General Public License v3.0
549 stars 107 forks source link

Added consistent debugging preprocessor define and fixed DEBUG_BREAK #383

Closed noodlecollie closed 6 years ago

noodlecollie commented 6 years ago

For reference: https://github.com/FWGS/xash3d/issues/371

This pull request is in 2 parts:

  1. Ensuring a consistent preprocessor #define is present to indicate debug compilation. I've modified the engine's CMakeLists.txt to add a _DEBUG flag if the build configuration is not release; I considered making it XASH_DEBUG in complement to XASH_RELEASE, but there were a handful of instances in the code where _DEBUG was already used a la MSVC, so I thought that would be more consistent.
  2. Fixing DEBUG_BREAK not functioning on non-Windows platforms. There was no implementation at all for Mac, so I added that; the Linux implementation didn't work because it depended on a GDB_BREAK define, which I couldn't find anywhere else in the code or on the internet at large. I replaced the conditional with a check for Linux or variants of BSD.

Of course, all changes are up for discussion to determine what the best course of action is.

a1batross commented 6 years ago

Oh. Thanks for fix! :)

XASH_RELEASE just changes Q_buildcommit output. I think it was a mistake and will be removed in new engine.

You can use CMAKE_BUILD_TYPE. CMake have four built-in build types: "Debug", "Release", "RelMinSize", "RelWithDebInfo".

Something like this:

if( ${CMAKE_BUILD_TYPE} STREQUAL "Debug" )
add_definitions(-D_DEBUG)
endif()
noodlecollie commented 6 years ago

Updated.

Out of interest, what's the main difference between this repo and the new engine?

nekonomicon commented 6 years ago
a1batross commented 6 years ago

Unkle Mike was made too much changes since 3366.

Xash3D 1.0 release is meant to be a new staring point for compability. This was resulted a numerous of breaking changes: protocol & demos, API extensions, saves. Drop of useless code, like BSP31 format, engine built-in mirrors, IPX support. Even HLSDK 2.4 interfaces were dropped(don't worry, we keep them in fork). Experimental features like net packet split and player customization were added. BSP30 format updated. Unfortunately, he did not made it in time, so we got only 0.99.

Intersting fact: version number is actually a percent from GoldSrc compability. 97%, 99%, 100%.

From fork's perspective it's a good chance to start over with better knowledge of game engine and change priorities in engine development. :)

This engine is now referred as "old engine" and may not receive a big changes.