Commit Graph

123 Commits

Author SHA1 Message Date
Louis Gombert
ee0f72322e Create changelog for Descent Open Source 1.5 2024-08-15 11:49:26 +02:00
Louis Gombert
164f102368 Split README between README, BUILD and USAGE files.
Prepare those files to be shipped with the pre-built assets.
2024-08-15 01:02:10 +02:00
Azamat H. Hackimov
03a3b923a0 Add release flow to GitHub Actions
Initial support to automate release flow. Now after git tag of specific commit GitHub Actions will create a draft entry of release (named by tag) with source code package on it.
2024-08-12 17:07:44 +03:00
Louis Gombert
10de36c0e4
Merge pull request #469 from tophyr/vcpkg-all-thethings
Use vcpkg on all presets
2024-08-04 14:10:09 +02:00
Chris Sarbora
e5dcce3c9f
Use vcpkg for all platform presets 2024-08-03 23:38:01 -05:00
Louis Gombert
ae5840f314
Merge pull request #502 from winterheart/modules-split
Splitting submodules of project
2024-07-30 23:17:47 +02:00
Thomas Roß
8c88a8fc21 [Build] Removed unused IS_WINDOWS and duplicate _CRT_SECURE_NO_WARNINGS compiler defines. 2024-07-29 00:29:12 +02:00
Thomas Roß
3b3cd434e3 [Build] Add /LTCG (Link Time Code Generation) to linker flags in Relese builds.
We already add /GL (Whole Program Optimization) to the compiler flags in Release builds. By not using /LTCG for the linker, the build output will be spammed with following message:
MSIL .netmodule or module compiled with /GL found; restarting link with /LTCG; add /LTCG to the link command line to improve linker performance
2024-07-29 00:29:12 +02:00
Thomas Roß
ead9f61558 [Build] Replaced string based handling of linker flags with add_link_options(). 2024-07-29 00:29:12 +02:00
Azamat H. Hackimov
dd32f4e3ed Split libacm files to third_party/libacm and AudioEncode
Logically adecode/aencode belongs to AudioEncode.
2024-07-28 21:51:35 +03:00
Azamat H. Hackimov
e9ac3b3ceb Merge d3movie module into Descent3
Simplify project layout, minor cleanup.
2024-07-28 16:50:41 +03:00
Azamat H. Hackimov
73d4853505 Merge d3music module into Descent3
Simplify project layout, minor cleanup.
2024-07-28 16:50:41 +03:00
Azamat H. Hackimov
e93a8bfc0e Remove czip module as unused 2024-07-28 16:50:41 +03:00
Louis Gombert
7cd7902584
Merge pull request #494 from Jayman2000/encoding-improvements
Ensure UTF-8 is used in more places
2024-07-20 18:04:54 +00:00
Jason Yundt
adf58eca81 Explicitly declare execution character set
Consider this program:

  #include <cstdio>

  int main(void) {
    const char *example_string = "ディセント3";
    for (size_t i = 0; example_string[i] != '\0'; ++i) {
      printf("%02hhx ", example_string[i]);
    }
    puts("");

    return 0;
  }

What will that program output? The answer is: it depends. If that
program is compiled with a UTF-8 execution character set, then it will
print this:

  e3 83 87 e3 82 a3 e3 82 bb e3 83 b3 e3 83 88 33

If that program is compiled with a Shift JIS execution character set,
then it will print this:

  83 66 83 42 83 5a 83 93 83 67 33

This is especially a problem when using MSVC. MSVC doesn’t necessarily
default to using UTF-8 as a program’s execution character set [1].

---

Before this change, Descent 3 would use whatever the default execution
character set was. This commit ensures that the execution character set
is UTF-8 as long as Descent 3 gets compiled with MSVC, GCC or Clang. If
Descent 3 is compiled with a different compiler, then a different
execution character set might get used, but as far as I know, we only
support MSVC, GCC and Clang.

I’m not sure whether or not this change has any noticeable effects. If
using different execution character sets do have noticeable effects,
then this change will hopefully ensure that those effects are the same
for everyone.

[1]: <https://learn.microsoft.com/en-us/answers/questions/1805730/what-is-msvc-s-default-execution-character-set>
2024-07-17 10:13:34 -04:00
Jason Yundt
dd757e9034 Explicitly declare that source files are UTF-8
Before this change, there was a chance that a text editor or compiler
would use the wrong character encoding. For text editors, this commit
adds “charset = utf-8” to .editorconfig. That will cause editors that
support EditorConfig files [1] to automatically use UTF-8 when reading
and writing files. For compilers, this commit adds compiler options that
guarantee that compilers will decode source code files using UTF-8. The
compiler options are known to work on MSVC, GCC and Clang. If we ever
want to support additional compilers, then we might have to edit the if
statement that this commit adds.

This commit does not eliminate the chance that a wrong character
encoding will be used. Someone could always use a text editor that
doesn’t support EditorConfig files or a compiler that doesn’t support
the compiler options that we use. This commit does, however, make an
encoding mismatch much less likely.

[1]: <https://editorconfig.org/#pre-installed>
2024-07-17 10:12:09 -04:00
Chris Sarbora
ab7c68fdaa
Make LINUX os-specific, define POSIX instead 2024-07-12 18:33:08 -05:00
Louis Gombert
9263055e73
Merge pull request #482 from pzychotic/cmake-folders
Better project structure for IDEs
2024-07-04 18:36:03 +00:00
Louis Gombert
9ec18a240b Enable all compilation warning on unix platforms 2024-07-04 21:30:38 +02:00
Thomas Roß
12ec7c50c7 [CMake] Enabled the CMake property USE_FOLDERS to provide a more structured project list in IDEs with the help of set(CMAKE_FOLDER "...") calls. 2024-07-03 19:55:04 +02:00
Louis Gombert
850e3f094d SDL2 Editor compilation fixes 2024-06-29 18:21:37 +02:00
Louis Gombert
91c18fefc5 Windows SDL2 compilation 2024-06-29 18:21:37 +02:00
Chris Sarbora
d20ec81834
Create compile_commands.json 2024-06-24 22:17:30 -05:00
Louis Gombert
c515189300
Merge pull request #448 from winterheart/mem-module
Make mem module isolated from project
2024-06-22 12:48:18 +00:00
Azamat H. Hackimov
2934c410b5 Re-enable git hash generation on changes
Inverse dependency between add_custom_target and add_custom_command (target should depends on command).
2024-06-20 23:51:18 +03:00
Azamat H. Hackimov
db8aa64d2f Make mem module isolated from project
Properly define MEM_USE_RTL definition only for mem library. Link other dependant modules with mem.
2024-06-20 00:43:51 +03:00
Thomas Roß
04122e3a7a [Build] Moved the preprocessor definition MEM_USE_RTL from Descent3 target to a global setting used for all targets.
MEM_USE_RTL is used in lib/mem.h to switch between different implementations of memory managment functions. Since mem.h gets included by a lot of libs, all these libs need to be compiled with the same define.
2024-06-19 00:06:08 +02:00
Louis Gombert
aa0b5ce4f1
Merge pull request #436 from winterheart/memory-functions
Changes to memory management functions
2024-06-16 18:14:42 +00:00
Thomas Roß
0b682772bf [Build] Fixed custom target dependency for d3_version.h checking the wrong path to that file.
cmake/CheckGit.cmake uses configure_file() to create d3_version.h in ${TARGET_DIR}/lib aka ${PROJECT_BINARY_DIR}/lib. But add_custom_command() and add_custom_target() calls in the root CMakeLists.txt use ${PROJECT_BINARY_DIR}/Descent3 as path to that file, expecting it in a different place. While the build still works, since the compiler looks in the right include paths for it, the dependencies between these rules/targets are technically broken. At least msbuild will generate warnings about missing build outputs.

Also removed the wrong ALL parameter from add_custom_command(), it's only a valid parameter for add_custom_target().
2024-06-16 15:32:23 +02:00
Azamat H. Hackimov
c8fa74550a Use RTL memory functions by default
Use Real-time library memory functions by default which improves overall performance. Minor cleanups.
Introduce new CMake option to enable/disable RTL memory functions (enabled by default).
2024-06-15 22:07:45 +03:00
Louis Gombert
05d70f6322
Merge pull request #435 from winterheart/third-party
Create THIRD_PARTY.md for external code handling
2024-06-15 15:44:37 +00:00
Azamat H. Hackimov
eb3466abc0 Create THIRD_PARTY.md for external code handling
Added all external code and license notices. Install THIRD_PARTY.md on installation step.
2024-06-12 23:40:27 +03:00
Louis Gombert
1821da99e7 Fix editor structures definitions 2024-06-07 21:41:40 +02:00
Louis Gombert
87f19acc2f Internal editor: minimal compilation fixes 2024-06-07 21:41:40 +02:00
Louis Gombert
0fa8705291 Move internal level editor into main tree 2024-06-07 21:41:40 +02:00
Louis Gombert
66923d5bc7
Merge pull request #407 from winterheart/remove-ncurses
Remove ncurses usage dependency
2024-06-02 20:11:39 +00:00
GravisZro
bfe52bc983 Add one macro, remove five others
- Add macro PRIMARY_HOG to define the hardcoded hog filename to load.
- Replace instances of "LINUX" with "__LINUX__"
- Remove these macros entirely because they are (now) unused
  - LINUX
  - _REENRANT
  - __32BIT__
- Removed from CMakeFile.txt because they are in linux_fix.h
  - _MAX_PATH=260
  - _MAX_FNAME=256
2024-05-31 12:05:12 -04:00
Azamat H. Hackimov
95caa7b6c3 Remove ncurses enabled console
This type of console is enabled only with `-svgalib` and `-dedicated` options. Since there no svgalib direct support (which is pretty old and too specific to Linux tech), it's better completely remove this code for simplicity and reducing external dependencies.
Removed `-svgalib` option as unused now.
2024-05-31 13:12:28 +03:00
Jason Yundt
26a4d125a0 Remove unnecessary find_package(OpenGL)
Before this change, CMakeLists.txt would run find_package(OpenGL), but
it would never use any of the targets or variables that calling
find_package(OpenGL) produces [1]. As a result, the call to
find_package(OpenGL) didn’t really do anything.

[1]: <https://cmake.org/cmake/help/latest/module/FindOpenGL.html>
2024-05-27 17:19:37 -04:00
Azamat H. Hackimov
a0929aefe2 Rename ddio_common to ddio 2024-05-24 22:18:14 +03:00
Azamat H. Hackimov
6bc3c71a83 Reordering ddio_common module
Merge ddio_lnx and ddio_win into ddio_common module.
2024-05-24 22:17:44 +03:00
Azamat H. Hackimov
974c703906 Reordering dd_sndlib and dd_lnxsound into sndlib
Consolidate all sound related code into one module.
2024-05-22 22:03:43 +03:00
Louis Gombert
cdec632f28
Merge pull request #318 from winterheart/install-targets
Introducing installation steps
2024-05-22 18:55:36 +00:00
Louis Gombert
f5d5ea947b
Merge pull request #367 from winterheart/lnxcontroller
Reordering linux modules, cleanup code
2024-05-22 18:37:18 +00:00
Azamat H. Hackimov
08b906fcc3 Introducing installation steps
Added installation steps for all built targets. Added FORCE_PORTABLE_INSTALL cmake option that controls portable installation (only supported for now).
2024-05-22 21:35:52 +03:00
Thomas Roß
73254af011 [Build] Fixed capitalization of DirectX paths. 2024-05-22 11:59:07 +02:00
Thomas Roß
56288c819e Merge branch 'main' into win-x64 2024-05-21 00:54:53 +02:00
Jason Yundt
e973dc1734 Automatically create netgames/ directory
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.
2024-05-20 09:02:01 -04:00
Azamat H. Hackimov
b20964e97f Reorder dd_vid* modules into dd_video 2024-05-19 12:34:58 +03:00
Azamat H. Hackimov
3fa32ff386 Reorder headers related to linux module 2024-05-19 12:21:43 +03:00