In `psrand.h` it attempts to undefine RAND_MAX and then redefine it.
This may work on some compilers but G++/Clang. To resolve this error
RAND_MAX was renamed to D3_RAND_MAX but **only** in files that
included `psrand.h`. The code behavior should restored to that of the
official release.
For whatever reason they decided to switch a bunch of Windows types to their
underlying types which causes problems when replacing possibly problematic
32-bit long types. This restores the use of the Windows defined types.
Added installation steps for all built targets. Added FORCE_PORTABLE_INSTALL cmake option that controls portable installation (only supported for now).
Most files in this repo assume that tabs are 8 characters wide and use 2
spaces for indentation. Most people’s editors aren’t configured to do
that by default. This can lead to indentation mistakes [1].
The main motivation behind this change is to make indentation mistakes
less likely. Many editors [2] will automatically use whatever
indentation settings are in the EditorConfig file.
On an unrelated note, the EditorConfig that this commit adds includes a
tab_width property. This comment in cfile/cfile.h was the inspiration
for specifying the tab_width property:
// Opens a HOG file. Future calls to cfopen(), etc. will look in this HOG.
// Parameters: libname - the path & filename of the HOG file
// NOTE: libname must be valid for the entire execution of the program. Therefore, it should either
// be a fully-specified path name, or the current directory must not change.
// Returns: 0 if error, else library handle that can be used to close the library
int cf_OpenLibrary(const char *libname);
When tab_width is set to 8, the first “libname” lines up with the second
“libname”, and the m in “must” lines up with the b in “be”. When
tab_width is set to its default value (4 in this case [3]), the first
“libname” doesn’t line up with anything, and the second “libname” lines
up with the b in “be”. It just looks more correct when tab_width is set
to 8.
[1]: <https://github.com/DescentDevelopers/Descent3/pull/372#issuecomment-2122445826>
[2]: <https://editorconfig.org/#pre-installed>
[3]: <https://spec.editorconfig.org/#supported-pairs>
This commit revamps the usage instructions in order to accomplish two
goals:
1. Make the instructions easier to follow by turning them into a
numbered list.
2. Make sure that macOS and Linux users install all of the built
libraries for their platforms.
Before this change, users would have to jump through hoops in order to
make sure that they’re using the .d3m files from this repo (as opposed
to the .d3m files that came with their version of Descent 3).
Specifically, users would have to remove or backup Descent 3’s original
netgames/ directory, create a new one, hunt down TCP_IP.d3c and copy it
to the new netgames/ directory.
This change makes it easier for users to use the latest version of
working by creating a netgames/ directory for them. All they have to do
is replace the old one with the new one.
Fixes#369.