Commit Graph

154 Commits

Author SHA1 Message Date
Chris Sarbora
ab819b8018
Add <cstdint> for type definitions 2024-06-24 02:05:22 -05: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
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
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
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
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
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
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
Louis Gombert
b8949f292d more windows editor 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
Chris Sarbora
45fe157563
Eliminate warnings in winapp.cpp
Uninitialized data
Bad parameters
Deprecated methods
2024-06-07 01:18:04 -05:00
Louis Gombert
15dce81bd1
Merge pull request #396 from GravisZro/cleanup
More clean up
2024-06-04 07:25:15 +00: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
691dc6487d Remove one unused macro definition and fix another 2024-06-01 22:21:51 -04:00
GravisZro
1c7e3053f2 Replace "PSPATHNAME_LEN" and "MAX_PATH" with "_MAX_PATH" 2024-06-01 22:19:41 -04:00
GravisZro
b889fee6c2 Remove Taoist typedefs 2024-06-01 22:17:44 -04:00
Louis Gombert
6d3a4c3e7f
Merge pull request #408 from GravisZro/remove/unusedpredefs
Code cleanup: Add one macro, remove five others
2024-06-01 20:51:41 +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
Azamat H. Hackimov
95caa7b6c3 Remove ncurses enabled console
This type of console is enabled only with `-svgalib` and `-dedicated` options. Since there no svgalib direct support (which is pretty old and too specific to Linux tech), it's better completely remove this code for simplicity and reducing external dependencies.
Removed `-svgalib` option as unused now.
2024-05-31 13:12:28 +03: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
Azamat H. Hackimov
6bc3c71a83 Reordering ddio_common module
Merge ddio_lnx and ddio_win into ddio_common module.
2024-05-24 22:17:44 +03:00
GravisZro
dc91b22635 Fix rebase breakage 2024-05-24 09:13:36 -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
ec73d3fe1f Remove excess stricmp definitions 2024-05-24 08:53:02 -04:00
GravisZro
13ed05cf6c Remove unused macros 2024-05-24 08:50:59 -04:00
GravisZro
f46a0b642c Move controller macros to Controller.h
Also copy one to winjoy.cpp
2024-05-24 08:50:59 -04:00
GravisZro
582970d9ef Replace SWAP with std::swap 2024-05-24 08:50:59 -04:00
GravisZro
88d1dfa948 Replace SET_MIN with std::min 2024-05-24 08:50:56 -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
fe855cf85e Fix missing header includes/restore third-party files 2024-05-23 23:14: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
cc67b9230a Replace "signed short" with "int16_t" 2024-05-23 23:04:15 -04:00
GravisZro
3dcd21b717 Replace "unsigned short" with "uint16_t" 2024-05-23 23:03:29 -04:00
GravisZro
cf0c51c8dd Replace "sint8" with "int8_t" 2024-05-23 23:02:27 -04:00
GravisZro
961d7060c2 Replace "uint8" with "uint8_t" 2024-05-23 23:01:58 -04:00
GravisZro
38f82ab9fd Replace "sint32" with "int32_t" 2024-05-23 23:01:16 -04:00
GravisZro
4bde77bc28 Replace "uint32" with "uint32_t" 2024-05-23 23:00:36 -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
0556786c12 Replace "signed int" with "int32_t" 2024-05-23 22:55:41 -04:00
GravisZro
2147cfa68b Replace "unsigned int" with "uint32_t" 2024-05-23 22:51:16 -04:00
GravisZro
fb74b66bdf Fix RAND_MAX overflow errors
In `psrand.h` it attempts to undefine RAND_MAX and then redefine it.
This may work on some compilers but G++/Clang. To resolve this error
RAND_MAX was renamed to D3_RAND_MAX but **only** in files that
included `psrand.h`. The code behavior should restored to that of the
official release.
2024-05-23 20:51:25 -04:00
Louis Gombert
a1a8056afc
Merge pull request #355 from GravisZro/fix/64bit
64-bit fixes
2024-05-23 07:21:36 +00:00