Commit Graph

385 Commits

Author SHA1 Message Date
Azamat H. Hackimov
79c7749242 Adding version to HogMaker 2024-04-28 22:05:26 +03:00
Azamat H. Hackimov
1926a77f19 Introducing git revision in source code
Git revision is generating on build time (not on configure time). In case of uncommited changes this revision will be marked as "dirty". If cmake cannot retrieve revision from git history (i.e. from packaged source code), cmake will attempt to read "git-hash.txt" from `PROJECT_SOURCE_DIR` (it will be generated on build time; after implementing packaging workflow it can be reworked).
Reworked main screen and console output to display proper version.
Version project now is 1.5.0 as previous PATCH value (500) was intended to be D3_RELEASE_BUILD_NO, autogenerated on compile time. As we switched to GIT_HASH, D3_RELEASE_BUILD_NO now useless.
2024-04-28 22:05:26 +03:00
Jeod
cfe06aeaaf
Merge pull request #223 from jcoby/fix-mouse-grab
Grab mouse after SDL_SetVideoMode
2024-04-28 13:37:48 -04:00
Jacob Coby
988653e01e Grab mouse after SDL_SetVideoMode
Fixes mouse cursor not being grabbed on macOS. Also sets the
`ddio_mouseGrabbed` flag correctly so it can be detected later on.

Fixes #201
2024-04-28 10:14:26 -04:00
Jeod
f001d82b80
Merge pull request #222 from DescentDevelopers/JeodC-patch-1
Update README.md
2024-04-28 09:41:30 -04:00
Jeod
b26193f603
Update README.md 2024-04-28 09:41:15 -04:00
Jeod
7cd46b7b52
Merge pull request #221 from DanielGibson/update-libacm
Update libacm
2024-04-28 09:12:36 -04:00
Daniel Gibson
dc96e4e3b6 Remove comment about decoding ACMs as stereo in libacm/adecode.cpp
with the recent changes in libacm, it's not true or relevant anymore
2024-04-28 15:01:02 +02:00
Daniel Gibson
90f00b9e4c Update libacm to latest upstream code
which includes a fix for the problem with playback of mono ACM files
2024-04-28 14:59:32 +02:00
Jeod
dbe2cdea64
Merge pull request #220 from winterheart/main-cmake
Update CMakeLists.txt
2024-04-28 07:34:18 -04:00
Azamat H. Hackimov
bdcb6cdbf4 Fix typo in CMakeLists.txt
Change CMAKE_SYTEM_NAME with CMAKE_SYSTEM_NAME, replace add_definitions with add_compile_definitions.
2024-04-28 14:28:15 +03:00
Jeod
0ce6b341e5
Merge pull request #188 from tophyr/kill-unused-srcs
Kill unused srcs
2024-04-28 07:23:48 -04:00
scivision
1f9c8cbf54 cmake: use regex to simplify
ref compiler ids:
https://cmake.org/cmake/help/latest/variable/CMAKE_LANG_COMPILER_ID.html
2024-04-28 14:07:47 +03:00
scivision
4d109a1382 cmake: use CMAKE_SYSTEM_NAME where prudent 2024-04-28 14:04:51 +03:00
scivision
31855c850b cmake: use find_* name-value for readability 2024-04-28 14:04:51 +03:00
scivision
1188b65c43 cmake: modernize, using safer/clearer options
CMAKE_BUILD_TYPE must be set CACHE before project() to take effect

general best practice rather than modifying CMake internal variables
is to use add_compile_options with genex
2024-04-28 14:04:48 +03:00
Jeod
fe55108012
Merge pull request #211 from JeodC/main
Make it look prettier in reader mode
2024-04-27 19:40:05 -04:00
JeodC
edb988d404 Make it look prettier in reader mode
ffs
2024-04-27 19:39:36 -04:00
Jeod
5d016e5eab
Merge pull request #210 from JeodC/main
Make PR template look prettier in editor mode
2024-04-27 19:37:57 -04:00
JeodC
14a1af5e68 Make it look prettier in editor mode 2024-04-27 19:37:17 -04:00
Jeod
f02729484c
Merge pull request #209 from JeodC/main
Move PR template to the .github folder
2024-04-27 19:35:32 -04:00
JeodC
0cbfbc192c Merge branch 'main' of https://github.com/JeodC/Descent3 2024-04-27 19:34:55 -04:00
JeodC
77c93aab7e Move PR template to the .github folder 2024-04-27 19:34:49 -04:00
Jeod
444e62738f
Merge pull request #183 from JeodC/main
Add a pull request template
2024-04-27 19:28:25 -04:00
Jeod
53f3015ad2
Merge branch 'main' into main 2024-04-27 19:28:16 -04:00
JeodC
f46e7bb6f2 Update pull_request_template.md 2024-04-27 19:28:02 -04:00
JeodC
ea1a60e260 Add vcpkg steps to windows build instructions. 2024-04-27 19:24:10 -04:00
Jeod
ad52db84b5
Merge pull request #203 from pzychotic/fix-window-drag
Fix window drag
2024-04-27 17:51:37 -04:00
Thomas Roß
e5626c88d6 [Windows,Mouse] Call ddio_MouseMode() before ddio_MouseInit() so the correct flags get set for RegisterRawInputDevices(). 2024-04-27 18:55:26 +02:00
Thomas Roß
318a8f6462 [Windows,Mouse] Removed call to DDIOShowCursor() from ddio_MouseMode() so we can set the mode before ddio_MouseInit() gets called and also prevent overrideing the mode always with MOUSE_STANDARD_MODE. 2024-04-27 18:54:07 +02:00
Thomas Roß
e28e4588e5 [Windows,Mouse] Reactivate code to evaluate mouse mode. 2024-04-27 18:43:53 +02:00
Chris Sarbora
1bc5648a9a
Remove MacOS (Classic) code and all references (3/3)
At this point, all remaining references to `MACINTOSH` are either part
of multi-value conditionals that `unifdef` was unable to determine the
final value for, or a `#define`, or a comment. I manually go through the
files with a Ctrl+Shift+F search (ignoring legacy/, to preserve useful
historic knowledge) and clean up each usage.

As part of that search, I discovered `lib/mac/` which I deleted wholly.

Test Plan:
On Mac, build both Debug and Release
```
cmake --build --preset mac --config Debug
cmake --build --preset mac --config Release
```
2024-04-27 07:44:40 -07:00
Chris Sarbora
d2c8b2861f
Remove MacOS (Classic) code and all references (2/3)
Discovered this while manually removing `MACINTOSH` references. Feels
like this shouldn't actually be a fallthrough.
2024-04-27 07:38:14 -07:00
Chris Sarbora
e6ba1906c9
Remove MacOS (Classic) code and all references (1/3)
The MACINTOSH define refers to MacOS Classic (not OS X) which we do not
plan to support. Rather than carry the cruft forever, let's delete it.

NOTE: legacy/ is unused but we're keeping it around, so MACINTOSH uses
there are left alone.

Process used for this commit:
```
git rm -r mac
find . \( -iname "*.c" -or -iname "*.cpp" -or -iname "*.h" \) \
  -exec unifdef -UMACINTOSH -o {} {} \;
git restore legacy
git add .
```

Test Plan:
On Mac, build both Debug and Release
```
cmake --build --preset mac --config Debug
cmake --build --preset mac --config Release
```
2024-04-27 07:38:14 -07:00
Chris Sarbora
9ec7714ebc
Delete unused sources
None of these sources are referenced, either directly or indirectly,
    in any CMakeLists.txt file.

    NOTE: All of legacy/ is unused, but we're keeping it around.

    Process for this commit: (in bash)
    **NOTE: THIS MUST BE DONE ON A CASE-SENSITIVE FILESYSTEM**. There are a
    few instances of differing-in-case-only (hogmaker vs HogMaker, etc) that
    will catch you out otherwise.
    ```
      # *** 1: Find all directly-referenced c/cpp files in CMakeLists.txt
      find . -name CMakeLists.txt -exec cat {} \+ |
      # Then, convert spaces and tabs to newlines for easy tokenizing
        tr -s ' \t' '\n' |
      # Filter to just tokens descripting c/cpp filenames (case insensitive)
        grep -iE '\.c(pp)?' |
      # Massage each filename to remove CMake-specific chars
        sed 's/[")]//g' |
      # Remove a URL that happens to match the pattern so far
        grep -v https: |
      # Remove files that start with # (and are thus comments, not refs)
        grep -Ev '^#' |
      # *** 2: In the output so far there is a curious entry ${SCRIPT}.cpp
      # Turns out, the makefiles generate some further filenames from script
      # names. So, delete the ${SCRIPT}.cpp filename...
        grep -v '${SCRIPT}.cpp' |
      # .. and add in the cpps.
        (
      # We use a bash subshell to let us "concatenate" to the pipe. This
      # writes stdin back to stdout, and then starts a *new command* to
      # generate more to stdout.
          cat -;
      # All the generated script cpp references live in scripts/
          cat scripts/CMakeLists.txt |
      # Squash the makefile onto one line for regex ease
            tr '\n' ' ' |
      # Extract the script names
            sed -E 's/.*set\(SCRIPTS([^)]+)\).*/\1/' |
      # Convert spaces and tabs to newlines for easy tokenizing
            tr -s ' \t' '\n' |
      # Remove blank lines
            grep -v '^$' |
      # Add cpp extension to each token
            while read TOKEN; do
              echo ${TOKEN}.cpp;
            done
        ) |
      # *** 3: Being referenced by CMakeFiles.txt isn't the only way a src
      # file can be used - it could also be potentially #include'ed. Let's
      # find those, with another subshell concatenation:
        (
          cat -;
      # Look in ALL source files. We could actually probably limit the
      # search here to just src files listed so far in stdin + *.h, but
      # that'd require a bunch of redirections and this bash pipeline is
      # already ridiculous enough. (Case!)
          find . -iname "*.c" -or -iname "*.cpp" -or -iname "*.h" |
      # Pull out the #include directives from them
            xargs grep --no-filename '#include' |
      # Look for any include of a .c or .cpp file (Case!)
            grep -iE '\.c(pp)?' |
      # Squash multiple spaces and tabs into one single space
            tr -s ' \t' ' ' |
      # Split on spaces, take the second field
            cut -d ' ' -f 2 |
      # Delete off quotes and angle brackets to get the included filename
            tr -d '"<>'
        ) |
      # *** 4: Protect all files under legacy/, per @Lgt2x's request
        (
          cat -;
          find legacy -iname "*.cpp" -or -iname "*.c"
        ) |
      # *** 5: Reduce all entries to their basename
        while read FILENAME; do
          basename $FILENAME;
        done |
      # *** 6: FINALLY, sort and dedupe the output into a file.
        sort | uniq > used_srcs

      # Now that we know all the used source files, we need to find all of
      # the source files in the repo, and delete them if they do not appear
      # in the used_srcs list.
      for SRC in $(find . -iname "*.cpp" -or -iname "*.c"); do
      # find outputs the relative path, we want to operate on just filename
        basename $SRC |
      # grep to see if the basename occurs in the used_srcs list.
      # -q means be quiet, do not print the match (so this doesn't spam)
      # -x means match the entire line (so macfile.cpp doesn't sneak thru
      #    via cfile.cpp)
      # -F means treat the lines patterns as fixed (not regexp)
      # -f means load patterns from the given file
          grep -qxFf used_srcs ||
      # If the grep command *fails*, then the file is not in the list.
      # Bash performs logic short-circuiting, so we can use logical-OR
        git rm $SRC;
      done
    ```

    Test Plan:
    On all three of `[win, mac, linux]`:
    ```
    cmake --preset <platform>
    cmake --build --preset <platform> --config Debug
    cmake --build --preset <platform> --config Release
    ```
2024-04-27 07:33:01 -07:00
Thomas Otto
4728a70034 Unify Windows/Unix command line
Any --foo -foo and +foo is now accepted on any OS. Also enables
single char arguments like -f everywhere. Previously -foo had
to be passed as --foo on Linux, and macOS behaved like Windows.
2024-04-27 14:00:22 +02:00
Jeod
15d8ed0e39
Merge branch 'DescentDevelopers:main' into main 2024-04-27 07:52:19 -04:00
Chris Sarbora
9adfb7ef32
Move old renderer files into legacy/
These files are likely to be useful for future reference.
2024-04-26 15:39:44 -07:00
Jeod
d1a67599a8
Merge pull request #192 from jcoby/fix-mac-controls
Fix controls on aarch64
2024-04-26 17:50:38 -04:00
Jacob Coby
147078b3a6 Fix controls on aarch64
Cast the rotation values to a short before assigning to the tangles
struct to avoid the FCVTZU instruction which strips the negative sign
from kicking in.

Fixes #161
2024-04-26 17:07:24 -04:00
Jeod
19896370d9
Merge pull request #191 from InsanityBringer/fix_libacm
Remove two channel minimum of libacm
2024-04-26 16:18:02 -04:00
InsanityBringer
a164fb6d47 Remove two channel minimum of libacm 2024-04-26 14:07:48 -05:00
Jeod
74ce2fe381
Merge pull request #190 from DescentDevelopers/revert-184-readme-32
Revert "README: 32-bit Linux and other distributions mentioned"
2024-04-26 10:58:04 -04:00
Jeod
f8a2fa2cd4
Revert "README: 32-bit Linux and other distributions mentioned" 2024-04-26 10:57:35 -04:00
Jeod
444e44f9fd
Merge pull request #184 from th1000s/readme-32
README: 32-bit Linux and other distributions mentioned
2024-04-26 10:56:33 -04:00
Jeod
bfed0d8d96
Merge pull request #172 from Nakhr11n/endian
Remove misc/endian.cpp and lib/psendian.h
2024-04-26 10:54:41 -04:00
Jeod
21e23f7972
Merge pull request #189 from icculus/rm-opengl_ryan
Remove renderer/opengl_ryan.cpp
2024-04-26 10:35:13 -04:00
Ryan C. Gordon
93fdd1ac97
Remove renderer/opengl_ryan.cpp
This was debug/testing code from Loki Software, and is unused.
2024-04-26 09:49:55 -04:00
Azamat H. Hackimov
5c63dec1a5 Customize name of build job
Creates eye-candy look in GitHub CI UI
2024-04-26 10:21:53 +03:00
Azamat H. Hackimov
cab27f3018 Rearrange Build and Unittest steps
Simplify workflow with additional matrix.build_type items.
2024-04-26 10:21:50 +03:00