Commit Graph

136 Commits

Author SHA1 Message Date
Louis Gombert
95fc3d2ce4 find_package for HogMaker in parent scope to get target exported properly 2024-10-29 21:14:35 +01:00
Azamat H. Hackimov
72e8347fe1 Move Descent3 built targets into "${CMAKE_BINARY_DIR}/build" directory
This solves problem of inability determine generated output directory of libraries targets. Now `add_custom_command()`, used on HOG generation, correctly locates all needed paths and not depends on generated variables.
2024-10-27 22:04:00 +03:00
Azamat H. Hackimov
39b205b957 Optimize building of HOG files and netgames libraries
Don't force building HOG files if dependency files are up-to-date.
Simplify building libraries by copying them into Descent3 directory.
2024-10-21 16:56:40 +03:00
Thomas Roß
eaa44aff12 [Build] Re-enable building the editor
CMAKE_SYSTEM_NAME isn't defined before the 'project' call, so moved the option below it.
2024-10-12 18:48:00 +02:00
Azamat H. Hackimov
eb0f6a2865 Remove dd_video module
Functions from module are stubbed and unused.
2024-09-23 00:37:25 +03:00
Azamat H. Hackimov
dc0cd880e4 Add logger module
Implementing separated logger module.
2024-09-18 22:50:08 +03:00
Azamat H. Hackimov
c6ab519652 Add plog library as logging facility
Added additional cmake option `USE_SYSTEM_PLOG`.
2024-09-10 03:00:23 +03:00
Louis Gombert
10ce4e48b7
Merge pull request #542 from rfht/main
build on OpenBSD via Linux pathways
2024-08-20 18:30:23 +02:00
Azamat H. Hackimov
1026a6e80b
Merge pull request #527 from tophyr/pr/modernize-renderer
Modernize Renderer
2024-08-20 19:00:43 +03:00
thfrwn
35bcbe8bf0 build on OpenBSD via Linux pathways 2024-08-20 10:03:24 -04:00
Chris Sarbora
8bd1b678f0
Gate OpenGL error-checking on a compilation setting rather than Debug/Release 2024-08-18 03:26:07 -05:00
Chris Sarbora
16df2d764a
Set up transformations in vertex shader 2024-08-18 03:26:03 -05:00
Azamat H. Hackimov
9cb836f9b8 Prepare to next major version 1.6.0 2024-08-18 00:06:22 +03:00
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