Commit Graph

53 Commits

Author SHA1 Message Date
Jan Engelhardt
9b2675b1f7 Fix spello "~full" 2024-11-04 10:20:15 +01:00
Azamat H. Hackimov
c3b1225c6e Remove mprintf_at() usage
This function is stubbed and does nothing.
2024-09-24 23:00:53 +03:00
Azamat H. Hackimov
eb0f6a2865 Remove dd_video module
Functions from module are stubbed and unused.
2024-09-23 00:37:25 +03:00
Louis Gombert
6c533364f6 Remove outdated '-slowkey', '-alternatejoy' & '-directinput' options
Removes key_emulation and joy_emulation toggles from ddio_init_info structures, that were not used in the SDL implementation.
All input is now handled using SDL for all platforms, alternatejoy/directinput options were only relevant for Windows-specific DirectInput. 'slowkey' was an unimplemented feature.
2024-09-18 22:32:56 +02:00
Jan Engelhardt
de0af3b10d mem_malloc type triviality checks (6/8)
```
git grep -l mem_malloc | xargs perl -i -lpe 's{\((uint8_t) \*\)mem_malloc\((\S+)\)}{mem_rmalloc<$1>($2)}'
```
2024-09-16 22:12:13 +02:00
Jan Engelhardt
4d2fdb2316 mem_malloc type triviality checks (4/8)
```
git grep -l mem_malloc | xargs perl -i -lpe 's{\((\w+) \*\)mem_malloc\((\S+) \* sizeof\(\1\)\)}{mem_rmalloc<$1 *>($2)}'
```
2024-09-16 22:12:13 +02:00
Jan Engelhardt
6fbc86efec mem_malloc type triviality checks (1/8)
git grep -l mem_malloc | xargs perl -i -lpe 's{\((\w+) \*\)mem_malloc\(sizeof\(\1\)\)}{mem_rmalloc<$1>()}'
2024-09-16 21:57:41 +02:00
Jan Engelhardt
5f0bdf8184 Fix spello "it's" 2024-09-03 13:26:51 +02:00
Jan Engelhardt
38b835a03b Fix spello "its" 2024-09-03 13:26:51 +02:00
Azamat H. Hackimov
79db9aa3e2 Move platform-specific defines and macros to own file crossplat.h 2024-08-20 23:09:27 +03:00
Chris Sarbora
3da53e567f
Programmatically replace all __LINUX__ with POSIX
Steps:
```sh
srcs=$(mktemp)
find . -name "*.cpp" -or -name "*.c" -or -name "*.h" -or -name "*.hpp" -or -name "*.cc" -or -name "*.hh" > $srcs
xargs sed -i 's/ifndef __LINUX__/if !defined(POSIX)/' < $srcs
xargs sed -i 's/ifdef __LINUX__/if defined(POSIX)/' < $srcs
xargs sed -i 's/defined(__LINUX__)/defined(POSIX)/' < $srcs
```
2024-07-12 18:11:54 -05:00
Louis Gombert
5372e01323 Run clang-format on legacy code 2024-06-15 20:13:59 +02: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
Louis Gombert
0fa8705291 Move internal level editor into main tree 2024-06-07 21:41:40 +02:00
Louis Gombert
15dce81bd1
Merge pull request #396 from GravisZro/cleanup
More clean up
2024-06-04 07:25:15 +00:00
Louis Gombert
69d19efb3e
Merge pull request #419 from winterheart/pxo-online
Reactivating network mtclient (Parallax Online / PXO)
2024-06-04 07:05:04 +00:00
Azamat H. Hackimov
f1a77cfe99 Reactivate mtclient for PXO online support 2024-06-02 23:43:38 +03:00
GravisZro
4e599257a0 Replace _finite with std::isfinite
A simple drop in replacement that is multiplatform which means the
defintion in `linux_fix.h` is no longer required.
2024-06-02 14:50:51 -04:00
GravisZro
1c7e3053f2 Replace "PSPATHNAME_LEN" and "MAX_PATH" with "_MAX_PATH" 2024-06-01 22:19:41 -04:00
GravisZro
f7ae658fe2 Modernize struct/enum/unions type declarations 2024-05-30 03:35:17 -04:00
Louis Gombert
baab65b6b3
Merge pull request #388 from GravisZro/fix/mprintf
Make mprintf and mprintf_at a proper variadic macro
2024-05-27 06:40:36 +00:00
GravisZro
9cf9781369 Properly format/use variadic macros 2024-05-24 20:57:17 -04:00
GravisZro
4ac9b9c22f Replace ioctl with fcntl, fix ioctlsocket calls (64-bit fix)
`ioctl` and `ioctlsocket` take two different types of arguments but worked in the past due to
long being 32-bit. However, ioctl functionality is non-standard and should not be used in
code written after **1997** in order to make sockets non-blocking. This functionality was
standardized as part of fcntl.

* Using the new function `make_nonblocking` to make socket nonblocking
2024-05-24 18:24:40 -04:00
GravisZro
dc91b22635 Fix rebase breakage 2024-05-24 09:13:36 -04:00
GravisZro
22ab0c6d37 Fix include statements using '\' deliminator 2024-05-24 08:53:03 -04:00
GravisZro
d0be4f81bb Move _stat macro to linux_fix.h
This is a fix for linux, so move it to correct location.
2024-05-24 08:53:03 -04:00
GravisZro
582970d9ef Replace SWAP with std::swap 2024-05-24 08:50:59 -04:00
GravisZro
76e86fed8c Replace strcmpi with stricmp 2024-05-24 08:49:04 -04:00
GravisZro
5e5e0c99c3 Replace "short" with "int16_t" and fix missing headers 2024-05-23 23:49:31 -04:00
GravisZro
aebe1bbbb6 Replace "ushort" with "uint16_t" and fix missing includes 2024-05-23 23:16:40 -04:00
GravisZro
26b7776f43 Replace "ubyte" with "uint8_t" 2024-05-23 23:07:26 -04:00
GravisZro
9d3e361a35 Replace "sbyte" with "int8_t" 2024-05-23 23:05:05 -04:00
GravisZro
3dcd21b717 Replace "unsigned short" with "uint16_t" 2024-05-23 23:03:29 -04:00
GravisZro
a00639be24 Replace "signed char" with "int8_t" 2024-05-23 22:59:50 -04:00
GravisZro
1618040db5 Replace "unsigned char" with "uint8_t" 2024-05-23 22:58:46 -04:00
GravisZro
a3a3797067 Replace "uint" with "uint32_t" 2024-05-23 22:57:25 -04:00
GravisZro
2147cfa68b Replace "unsigned int" with "uint32_t" 2024-05-23 22:51:16 -04:00
Louis Gombert
a1a8056afc
Merge pull request #355 from GravisZro/fix/64bit
64-bit fixes
2024-05-23 07:21:36 +00:00
GravisZro
c18b6d0b39 Win64 fixes for legacy code 2024-05-22 18:30:56 -04:00
GravisZro
dec9de7456 64-bit fixes
Switch all the (u)long types to (u)int32_t where appropriate.
2024-05-22 18:14:45 -04:00
Jeod
2c4f44ad92
Merge pull request #361 from pzychotic/fix-line-endings
Converted line endings to Unix format to match .gitattributes file
2024-05-17 13:44:17 -04:00
Thomas Roß
aecd737df0 [Misc] Converted line endings to Unix format to match .gitattributes file. 2024-05-17 18:36:41 +02:00
Louis Gombert
13711c3036 Remove Aureal support
D3 used to support Aureal 3-Dimensional sound cards, providing 3D spatial audio. The hardware and drivers is outdated, so all support in code has been removed, including UI mixer setting.

Read more about A3D here: https://en.wikipedia.org/wiki/Aureal_Semiconductor#A3D
2024-05-14 00:56:34 +02:00
JeodC
a4ab78192c Join license header with historical commentrs
Join the license header with historical comments using a separator so IDEs can correctly parse the initial header.

Also use .gitattributes to ensure all files are LF.
2024-05-08 14:41:19 -04:00
Edu García
3440667e93 remove unused code (mainly windows.h) 2024-05-07 23:45:33 +01:00
Ryan C. Gordon
f8a4cb3cc0
More X11 removal.
This is all unused stuff, just doing a more-complete purge.
2024-04-30 13:04:15 -04:00
Ryan C. Gordon
6a18afab7c
Remove references to X11 and glX.
This is all in unused/unnecessary/leftover code, but the code wouldn't
build without Xlib headers on the system, which was forcing the Mac builds
to install xquartz.

This also removes renderer/SoftwareOpenGL*, which was _not_ a
software-rendered OpenGL, but just an older version of the same code that's
in HardwareOpenGL.cpp--old enough to still talk to glX directly, which is
what caught my attention.
2024-04-30 12:08:03 -04:00
Oskar Strengbohm
4582b44eb3 misc: pstring: Refactor dependents. 2024-04-29 10:01:33 +02:00
Ryan C. Gordon
6c8977caf0
Heavy patching for compiler warnings.
The vast majority of this is fixing up `char *` that should be `const char *`
but a handful of other fixes, like potential buffer overflows that GCC
noticed, etc, were applied as well.

This removes `-Wno-write-strings` from CMakeLists.txt, as it is no longer
necessary, as there is no longer a flood of compiler warning spam when
building.

This does not fix all compiler warnings; there are still a handful, and they
are legitimate, but they can be dealt with in a future commit.
2024-04-29 00:18:56 -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