Commit Graph

46 Commits

Author SHA1 Message Date
Azamat H. Hackimov
a16420789d Convert ddio to use new logging facility 2024-09-10 03:00:25 +03:00
Jan Engelhardt
5f0bdf8184 Fix spello "it's" 2024-09-03 13:26:51 +02:00
Jan Engelhardt
a3a31c77a2 Fix spello "seperate.." 2024-09-03 13:26:51 +02:00
Jan Engelhardt
cf748b719e Resolve out-of-bounds access restoring game for level 4
srcpath "hudburn.ogf"
srcpath "hudburn.ogf"
srcpath "shieldinv.ogf"
srcpath "shieldinv.ogf"
srcpath "level4"
==61849==ERROR: AddressSanitizer: stack-buffer-overflow on address 0x7f8665855daf at pc 0x000001019268 bp 0x7ffeaad45fc0 sp 0x7ffeaad45fb8
READ of size 1 at 0x7f8665855daf thread T0
    f0 0x1019267 in ddio_SplitPath(char const*, char*, char*, char*) $GIT/ddio/lnxfile.cpp:134
    f1 Osiris_FindLoadedModule(char*) $GIT/Descent3/OsirisLoadandBind.cpp:775
    f2 Osiris_RestoreSystemState(CFILE*) $GIT/Descent3/OsirisLoadandBind.cpp:2774
    f3 LoadGameState(char const*) $GIT/Descent3/loadstate.cpp:387
    f4 LoadCurrentSaveGame() $GIT/Descent3/gamesave.cpp:709
    f5 GameSequencer() $GIT/Descent3/gamesequence.cpp:1239
    f6 PlayGame() $GIT/Descent3/game.cpp:834
    f7 MainLoop() $GIT/Descent3/descent.cpp:550
    f8 Descent3() $GIT/Descent3/descent.cpp:508
    f9 oeD3LnxApp::run() $GIT/Descent3/sdlmain.cpp:151

Address 0x7f8665855daf is located in stack of thread T0 at offset 431 in frame
    f0 Osiris_RestoreSystemState(CFILE*) $GIT/Descent3/OsirisLoadandBind.cpp:2685

  This frame has 3 object(s):
    [32, 72) 'ei' (line 2791)
    [112, 368) 'tag' (line 2690)
    [432, 692) 'read_module_name' (line 2761) <== Memory access at offset 431 underflows this variable
2024-08-30 02:37:42 +02:00
Louis Gombert
672a82ec6f
Merge pull request #544 from winterheart/reactivate-editor
Reactivate editor
2024-08-26 22:17:12 +02:00
Azamat H. Hackimov
39e971504e DDIO: implement mouse grab state functions
Hide global variable ddio_mouseGrabbed.
2024-08-21 12:29:28 +03:00
Azamat H. Hackimov
79db9aa3e2 Move platform-specific defines and macros to own file crossplat.h 2024-08-20 23:09:27 +03:00
Azamat H. Hackimov
54f9d75e62 Reduce linux_fix.h usage in project 2024-08-20 23:08:10 +03:00
Azamat H. Hackimov
16a6866885 DDIO: new crossplatform SleepMS() function
Use C++ chrono and thread for crossplatform sleep function.
2024-08-20 23:08:10 +03:00
Thomas Roß
7b71873a69 [Cleanup] Removed function declarations that are not implemented. 2024-08-20 20:03:02 +02:00
Thomas Roß
3162d4a4af [DDIO] Deleted unused ddio_win.h. 2024-08-20 20:03:02 +02:00
thfrwn
35bcbe8bf0 build on OpenBSD via Linux pathways 2024-08-20 10:03:24 -04:00
Azamat H. Hackimov
36080f1f08 DDIO: Delete unused ddio_GetRootFromPath() 2024-08-15 11:50:36 +03:00
Azamat H. Hackimov
38ac2b19fc Additional notes for documentation of ddio_GetSysRoots()
On UNIX-like systems there only one element list.
2024-08-15 11:50:36 +03:00
Azamat H. Hackimov
306db747cc Change signature of ddio_DoForeachFile()
There no return value usage across the project, change return type of function to void.
2024-08-15 11:50:36 +03:00
Azamat H. Hackimov
842ef19bfd Implement root mount points (drives) in DoPathFileDialog()
List root mount points / drives in separate listbox.
2024-08-15 11:50:36 +03:00
Azamat H. Hackimov
7c4a4d2566 DDIO: remove DLLddio_FindFileStart functions as unused
Cleanup code in core and netcon.
2024-08-15 11:50:36 +03:00
Azamat H. Hackimov
0805e97061 DDIO: New ddio_DoForeachFile() function
Cross-platform ddio_DoForeachFile() replaces platform-specific ddio_FindFileStart(), ddio_FindNextFile() and ddio_FindFileClose() functions.
2024-08-15 11:47:43 +03:00
Azamat H. Hackimov
ec065b2a07 DDIO: remove unused ddio_GetFullPath() 2024-08-15 11:47:43 +03:00
Louis Gombert
60c5dbf1fe CMake: add all headers to target sources
This can help with CMake IDE integration and file indexing.
2024-08-09 17:09:14 +02:00
Louis Gombert
1328a8c846 Remove non-functional OpenGL logging methods 2024-07-28 17:52:01 +02:00
Azamat H. Hackimov
8fd119bd3d MVE: Make timer code crossplatform 2024-07-09 03:40:49 +03:00
Azamat H. Hackimov
de49da0e9a DDIO: Remove unused platform-dependent functions
Remove ddio_CreateDir(), ddio_RemoveDir(), ddio_SaveWorkingDir(), ddio_RestoreWorkingDir(), ddio_DirExists(). Replace them in code with std::fs alternatives.
2024-07-01 12:50:49 +03:00
Azamat H. Hackimov
81555afd15 CFILE: convert cf_Diff() to use std::fs::path
Convert cf_Diff() and underlying functions to use std::filesystem::path
2024-07-01 12:50:49 +03:00
Azamat H. Hackimov
c47210be75 CFILE: convert cf_CopyFile() cf_CopyFileTime() to use std::fs::path
Convert cf_CopyFile() cf_CopyFileTime() and underlying functions to use std::filesystem::path
2024-07-01 12:50:49 +03:00
Louis Gombert
74c7b2cb0c Fix bad rebase for sdlmain.cpp 2024-06-29 18:28:23 +02:00
Louis Gombert
99a39d645d Remove unused DirectX-related files 2024-06-29 18:21:38 +02:00
Louis Gombert
91c18fefc5 Windows SDL2 compilation 2024-06-29 18:21:37 +02:00
Azamat H. Hackimov
59487976f6 Isolate misc module
Isolate misc module for better dependency handling.
2024-06-27 01:26:35 +03:00
Louis Gombert
ed79350a13
Merge pull request #462 from tophyr/gno-gnu-glob
Remove GLOB_PERIOD from ddio_FindFileStart
2024-06-24 19:59:51 +00:00
Chris Sarbora
652ef55f9a
Remove GLOB_PERIOD from ddio_FindFileStart
GLOB_PERIOD is a GNU extension and is not supported on non-glibc
2024-06-24 02:08:36 -05: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
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
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
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
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
15dce81bd1
Merge pull request #396 from GravisZro/cleanup
More clean up
2024-06-04 07:25:15 +00:00
Azamat H. Hackimov
9416458f9c Cleanup mono debugging code
Remove unused mono debug code.
2024-06-03 01:40:33 +03: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
Azamat H. Hackimov
683cac5ea5 Remove unused lorestimer arg option
lorestimer was required only for Windows (9x, I guess?), and now with chrono library, that can provide any resolution, it's redundant. Removing related field of ddio_init_info struct.
2024-05-27 10:31:45 +03:00
Azamat H. Hackimov
24e0c315e1 Use chrono steady_clock for time measurement
Implementing static ChronoTimer class based on C++11 chrono library that replaces platform dependent time measurement implementation.
2024-05-27 10:31:42 +03:00
GravisZro
9cf9781369 Properly format/use variadic macros 2024-05-24 20:57:17 -04:00
Azamat H. Hackimov
a0929aefe2 Rename ddio_common to ddio 2024-05-24 22:18:14 +03:00