Commit Graph

949 Commits

Author SHA1 Message Date
Louis Gombert
1e44581171
Merge pull request #443 from winterheart/ddio-filesystem
Migrating some of ddio functions to use std::filesystem::path
2024-06-18 18:54:59 +00:00
Jason Yundt
38e5332b90 Revamp build instructions
Before this change was made, I had tried building Descent 3 on Windows
for the first time. The instructions for building Descent 3 on Windows
were unclear, inaccurate and they messed up my installation of Windows.
(See #332 for details).

I started working on this commit in order to prevent that situation from
happening again. I ended up revamping the entire build instructions
section.

The biggest change that I made was making it so that users only need to
look at the instructions for their own platforms. Before this change,
you had to look at the “Building” heading and read the sentence that was
directly beneath it. If you don’t do what that sentence says, then the
instructions won’t work. Unfortunately, the way that the instructions
were laid out drew the reader’s eye away from that sentence.
Specifically, the instructions would draw the reader’s attention towards
the subheading for their specific platform. This commit makes it so that
each platform-specific subsection contains everything that users of that
platform need to know.

Another change that I made has to do with Git. Previously, the
instructions said “Build steps below assume you have already cloned the
repository and entered it locally.” They never told users how to make
sure that Git is installed or how to create a clone of the repository.
They also didn’t tell Windows users that the clone of Descent3 should
not be entered until after VCPKG_ROOT has been set. In other words, if a
Windows user had followed the instructions exactly as they were written,
then they would have ended up with a clone of vcpkg inside of their
clone of Descent3 (not using submodules!). This commit adds explicit
instructions for installing Git and cloning Descent3. It also makes sure
that Descent3 is only cloned after all dependencies have been installed.

I also made a Visual Studio-related changes in this commit. Previously,
the instructions for Windows said “Requires Visual Studio 2022 and C++
Tools (cmake and vcpkg)”, but the instructions never told users how to
make sure that they had those things. This commit adds explicit
instructions for how to make sure that you have Visual Studio and the
required components installed.

Another change that this commit makes has to do with vcpkg. Before this
commit, the Windows build instructions had you manually set up vcpkg.
This was redundant because the instructions also had you install Visual
Studio 2022 with the “Desktop development with C++” workload. That
workload comes with vcpkg [1], so setting up vcpkg manually was
unnecessary. This commit removes the parts about installing vcpkg.
(Thanks to @Lgt2x for this idea [2].)

The commit also adds sentences to the ends of the platform-specific
build instructions that tell users where the built files get put. This
is technically redundant since the Usage instructions already tell users
where to find the built files. Even though those sentences are
redundant, I still included them because they make the instructions
easier to use.

This commit also makes a minor capitalization-related change.
Previously, the build instructions said “Building - MacOS”. The official
capitalization has been “macOS” since 2016 [3][4].

Another minor change that this commit makes has to do with the Ubuntu
and Fedora build instructions. This commit adds the sentence “Run these
commands:” to each of those sections. I only added that sentence in
order to make the Ubuntu and Fedora sections more consistent with the
Windows and macOS sections. The Windows and macOS sections use that
sentence as part of a numbered list.

[1]: <https://learn.microsoft.com/en-us/visualstudio/install/workload-component-id-vs-community?view=vs-2022#desktop-development-with-c>
[2]: <https://github.com/DescentDevelopers/Descent3/pull/413#discussion_r1624974614>
[3]: <https://www.businessinsider.com/wwdc-2016-os-x-becomes-macos-2016-6>
[4]: <https://www.apple.com/macos>
2024-06-18 06:57:36 -04:00
Azamat H. Hackimov
908f490396 Remove unused ddio_RenameFile() 2024-06-17 22:30:42 +03:00
Azamat H. Hackimov
b53e4a51a0 Refactoring ddio_*LockFile() functions
Cleanup, use C++ iostreams.
2024-06-17 22:30:42 +03:00
Azamat H. Hackimov
7db03a4ebf Make lockfile functions cross-platform
Unify all ddio_*LockFile() functions using std::filesystem.
2024-06-17 21:32:01 +03:00
Louis Gombert
a059b14677
Merge pull request #441 from pzychotic/dmfc-no-dllexport
Remove preprocessor definition DMFC_DLL and related code
2024-06-17 17:19:54 +00:00
Azamat H. Hackimov
f5e936e939 Move IOOpts.h into main tree
Added bin_read function for reading capabilities. Force checking types to arithmetic (int and float)
2024-06-17 01:55:02 +03:00
C.W. Betts
90c34c8006 Better fix for pcount. 2024-06-16 16:09:23 -06: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
Azamat H. Hackimov
87472f47fe
Merge pull request #440 from pzychotic/fix-build-deps
Fixed custom target dependency for d3_version.h
2024-06-16 19:31:37 +03:00
Thomas Roß
113e7eaaaa [DMFC] Removed preprocessor definition DMFC_DLL and related code, because we build DMFC as static lib and don't need any of that dllexport/import stuff anymore. 2024-06-16 16:56:20 +02: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
Louis Gombert
ad42279af2
Merge pull request #430 from pzychotic/vcpkg-static
Use static versions of dependencies linked through vcpkg
2024-06-15 20:36:47 +00:00
Azamat H. Hackimov
c41c3a7cb1 Replace Global* memory functions
Replace Global* memory functions with mem_* equivalents from mem.h, remove compatibility functions on Linux / macOS platforms.
2024-06-15 22:07:45 +03: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
Azamat H. Hackimov
20e80b6c6d
Merge pull request #438 from Lgt2x/format-editor
Clang-format editor and legacy code
2024-06-15 21:20:41 +03:00
Louis Gombert
5372e01323 Run clang-format on legacy code 2024-06-15 20:13:59 +02:00
Louis Gombert
86cce1e445 Run clang-format on editor code 2024-06-15 20:12:48 +02:00
Thomas Roß
400d758383 [Build] Use static versions of dependencies linked through vcpkg. 2024-06-15 18:35:41 +02: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
Louis Gombert
6255917b84
Merge pull request #434 from MaddTheSane/DedicatedServerPrintf_fp
Fix DedicatedServerPrintf_fp definition
2024-06-15 14:20:39 +00:00
Louis Gombert
71068c8ea2
Merge pull request #437 from icculus/ryan-fullscreen-desktop
opengl: use SDL_WINDOW_FULLSCREEN_DESKTOP and an FBO.
2024-06-15 14:17:10 +00:00
Ryan C. Gordon
393a39b709
opengl: use SDL_WINDOW_FULLSCREEN_DESKTOP and an FBO.
This now renders to an OpenGL Framebuffer Object at the game's resolution,
and blits it to the window at whatever resolution it is currently using,
scaling and letterboxing if necessary.

Which is to say: display resolutions are now imaginary, and we never change
the physical display mode now. A smaller resolution is simply drawing less
pixels and scaling them up with the GPU for display. This solves a few
problems: no more resizing background windows or desktop icons shuffling
around, no more being stuck in a weird resolution when debugging or if the
game crashes, no more waiting on monitors to click over to a new mode, and
no more weird rendering when the display didn't exactly support the requested
mode.

This also means the game doesn't have to drop down to 640x480 for the config
menu screen when it was otherwise using some other resolution.

Some caveats:

- This _requires_ OpenGL Framebuffer Object support; there is currently no
fallback if it's missing and the game will refuse to start. But any desktop
hardware of the last ~20 years should support it. For weird embedded things
or whatnot, it will be possible to add a fallback.

- This currently requires SDL. The OpenGL pieces should work on Windows, but
someone would need to adjust the existing win32 code to create a fullscreen
window and not change the physical display mode. It should still compile on
windows and work as before (untested by me, though).

- This is only OpenGL; it does not touch the Direct3D renderer, which should
continue to work as before (again, untested by me).
2024-06-14 03:56:49 -04:00
Edu Garcia
a2d3a9cc75
Merge pull request #422 from Lgt2x/windows-ninja
Windows CMake preset: use ninja generator
2024-06-14 07:32:44 +01:00
Edu Garcia
9e93fc3bad
Merge pull request #397 from Lgt2x/d3-editor
Build internal level editor (WIP, doesn't actually run)
2024-06-14 07:28:03 +01:00
C.W. Betts
2122d719e1 Remove some unused variables. 2024-06-13 14:38:17 -06:00
C.W. Betts
33b2030364 Fix compile failure. 2024-06-13 14:38:17 -06:00
C.W. Betts
f79e6cfe50 More const char* conversion. 2024-06-13 14:38:17 -06:00
Louis Gombert
4ace76c366
Merge pull request #431 from notimaginative/fix_network_issue
Fix server crash during client connection
2024-06-12 20:55:45 +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
b4afcc2ec8
Merge pull request #432 from notimaginative/fix_chat_lobby_connect
fix PXO chat lobby connection failure on Linux/Mac
2024-06-12 10:13:34 +00:00
C.W. Betts
81d6473e19 Fix DedicatedServerPrintf_fp to actually match the definition of PrintDedicatedMessage. 2024-06-12 03:41:11 -06:00
Taylor Richards
ed0ff23cee
remove unnecessary return value test 2024-06-11 14:58:45 -04:00
Taylor Richards
03b729e318
fix PXO chat lobby connection failure on Linux/Mac 2024-06-10 21:55:35 -04:00
Taylor Richards
332f9c553e
fix server crash during client connection
The serverconn variable identifies the reliable socket used by the server.
However this variable is not yet initialized at the very start of the first
client connection which causes the server to crash. This fixes a bad safety
check for this issue and a further instance of the bug.
2024-06-10 21:51:51 -04:00
Louis Gombert
c00b8ea3c3 Editor review fixes 2024-06-10 23:35:11 +02:00
Louis Gombert
3f54c1a2cd
Merge pull request #428 from tophyr/eliminate-warnings
Eliminate warnings
2024-06-09 18:31:32 +00:00
Louis Gombert
3036f44017 x64 compilation fixes 2024-06-09 20:12:47 +02:00
Louis Gombert
bcca92722d Release build fixes 2024-06-07 23:50:38 +02:00
Chris Sarbora
ef33834a2a
Add comments explaining warning suppression 2024-06-07 16:24:07 -05:00
Louis Gombert
1821da99e7 Fix editor structures definitions 2024-06-07 21:41:40 +02:00
Louis Gombert
b8949f292d more windows editor fixes 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
a90b4ef728
Merge pull request #427 from tophyr/asan-fixes
Fix indexing error when looking up Win32_AppObjects
2024-06-07 17:57:54 +00:00
Louis Gombert
82c04f8fb9 Windows CMake preset: use ninja generator 2024-06-07 19:20:07 +02:00
Chris Sarbora
45fe157563
Eliminate warnings in winapp.cpp
Uninitialized data
Bad parameters
Deprecated methods
2024-06-07 01:18:04 -05:00
Chris Sarbora
eb0ba9fe4a
Fix indexing error when looking up Win32_AppObjects 2024-06-07 00:39:39 -05:00
Louis Gombert
fd61549080
Merge pull request #420 from MaddTheSane/pxofixes
PXO fixes
2024-06-05 20:15:14 +00:00
C.W. Betts
09b91fb6df Fix 64-to-32 integer truncating.
This is a bit more of a problem with byte-swapping than just reading/writing.
2024-06-04 15:08:36 -06:00