Commit Graph

765 Commits

Author SHA1 Message Date
Louis Gombert
dd219e95d2
Merge pull request #458 from pzychotic/fix-win-debug-crash
Fix crash in DumpTextToClipboard()
2024-06-23 20:48:31 +00:00
Azamat H. Hackimov
6423504919
Merge pull request #456 from winterheart/mem-use-rtl-win-fix
Fix mem_size_sub() for WIN32 in MEM_USE_RTL mode
2024-06-23 23:10:19 +03:00
Azamat H. Hackimov
743f782815
Merge pull request #453 from Lgt2x/remove-intellivibe
Remove intellivibe interface
2024-06-23 18:06:25 +03:00
Thomas Roß
bd7294162c [Win,Debug] Fixed crash introduced in c41c3a7 by #436.
SetClipboardData() expects its second parameter to be allocated with the GMEM_MOVEABLE flag and will call GlobalSize() on it internally, so we can't replace it with a plain malloc.
Also the assignment of h_text to ptr was missing, and GlobalUnlock() was still called on h_text even after the change to malloc.
2024-06-23 15:28:56 +02:00
Azamat H. Hackimov
3fe2a760eb Fix mem_size_sub() for WIN32 in MEM_USE_RTL mode
Use `_msize()` instead of `HeapSize()` in RTL memory allocation model. Fixes crash on mission start in Windows.
2024-06-23 02:02:40 +03: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
Louis Gombert
b269df9b43
Merge pull request #451 from winterheart/custom-command-fix
Re-enable git hash generation on changes
2024-06-22 12:03:02 +00:00
Azamat H. Hackimov
55c2332091
Merge pull request #452 from Lgt2x/remove-cdrom
Remove the CD-ROM asset loading logic and -cdrom option
2024-06-22 14:07:17 +03:00
Louis Gombert
fa2061dc76 Remove intellivibe interface
Intellivibe is an interface for VRF's Tactile Feedback System hardware, now discontinued.
2024-06-22 03:20:26 +02:00
Louis Gombert
4fd2d3768b Remove the CD-ROM asset loading logic and -cdrom option
CD-ROM code needs specific hardware to be tested and maintained, and does not fit with the modernization this project envisions.
I doubt the Mac hardware we now target have built-in CDrom readers anymore.

To play using data from a CD-ROM, it needs to be mounted, and the mount address to be provided to the -setdir argument
2024-06-21 20:36:43 +02: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
Louis Gombert
fa3f379e41
Merge pull request #445 from pzychotic/fix-mem-mgmt
Fixed inconsistent use of memory management functions
2024-06-19 17:47:31 +00:00
Louis Gombert
99e8655ffe
Merge pull request #413 from Jayman2000/revamp-build-instructions
Revamp build instructions
2024-06-19 07:02:26 +00: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
ef507ee497
Merge pull request #424 from MaddTheSane/pxofixes
PXO online: More const char* fixes
2024-06-18 19:02:30 +00:00
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