Commit graph

15837 commits

Author SHA1 Message Date
alexey.lysiuk
d3c50eadaa
- removed test code
https://forum.zdoom.org/viewtopic.php?t=66065
2019-10-08 22:23:43 +03:00
alexey.lysiuk
d87170ed9e
- restored command line arguments initialization in SDL backend 2019-10-08 22:18:47 +03:00
alexey.lysiuk
f678b5d4d6 - fixed crash on closing fatal error window
Framebuffer was accessed after its destruction
2019-10-08 12:39:45 +02:00
alexey.lysiuk
d87f7593b8 - fixed compilation of POSIX targets
src/posix/cocoa/i_main.mm:152:2: error: use of undeclared identifier 'ShutdownJoysticks'
src/posix/sdl/i_system.cpp:128:3: error: ‘I_FatalError_Gtk’ was not declared in this scope
src/posix/sdl/st_start.cpp:329:8: error: ‘CExitEvent’ was not declared in this scope
2019-10-08 10:48:43 +03:00
Christoph Oelckers
523fd0bf3a Revert "AsmJit update"
This reverts commit 747b3dfcfe.

# Conflicts:
#	libraries/asmjit/asmjit/core/compiler.h

This had to be reverted because it breaks exception handling which is a critical problem.
With the updated code any exception thrown inside code that had a JITed call stack would crash.
2019-10-07 20:34:55 +02:00
Christoph Oelckers
2e7af1338c - the big cleanup of the exit cleanup is done!
atterm is gone and only a few system-side functions use atexit.
All game side cleanup is performed in D_DoomMain now.
2019-10-07 20:28:55 +02:00
Christoph Oelckers
6f821a9198 - fixed compilation on Windows. 2019-10-07 18:59:18 +02:00
Christoph Oelckers
ff379e7c0c replaced all 'exit's with an ExitEvent exception
The main exits are initiated from code that cannot filter this back to D_DoomMain easily so the exception is the only way to get there.

The 3 main points of exit are:

* quit/exit CCMD
* quitting the menu through ST_Endoom
* receiving a quit message on the main window.
2019-10-07 01:24:51 +02:00
Christoph Oelckers
5d265d2d88 - don't exit from within a window proc.
This should be handled by the message pump evaluating WM_QUIT which is how Windows suggests this to be done.
2019-10-07 01:11:53 +02:00
Christoph Oelckers
c95a07d2c4 - missed one exit. 2019-10-07 01:10:37 +02:00
Christoph Oelckers
0a611e1992 - refactored the exit calls out of the networking code
These ones were particularly bad examples of misusing the exit handlers by temporarily installing one themselves and then calling exit to clean stuff up.

Now they just return an error code to D_DoomMain to perform a regular exit.
2019-10-07 00:55:14 +02:00
Christoph Oelckers
96006eb94f - moved all exception handling out of the backends
The main catch is now in D_DoomMain, only calling platform specific functions to handle the output for the error.

As a nice side effect, -norun can now be done without an exception, just by exiting D_DoomMain with a special exit code.
2019-10-07 00:37:56 +02:00
Christoph Oelckers
b5fa08bf15 - consolidated I_FatalError functions
This also removes the handling from thr Posix backend and will not compile on non-Windows.
2019-10-07 00:20:07 +02:00
Christoph Oelckers
cd086ae1da - consolidated the 3 I_Error implementations
Debug output is now being handled by the respective interface functions, not by the Windows I_Error itself.
2019-10-07 00:01:12 +02:00
Christoph Oelckers
5a72e0bfb7 - added a new texture class using stb_image to read a more formats.
This implementation only reads GIF, BMP and PIC formats. No animated GIF support because stb_image does not handle that.
PNG, JPG and TGA are still being handled by the existing dedicated implementations.
PSD and HDR are impractical for reading texture data and thus are disabled.
PnM could be enabled, if its identification semantics were stronger. stb_image only checks the first two characters which simply would falsely identify several flats with the right colors in the first two bytes.

This is more or less a waste product of getting stb_image to work with something actually testable, so it is just provided as-is.
2019-10-06 08:37:23 +02:00
Rachael Alexanderson
5cbb1c86ab - add missing information for the drawers, from the wallsprite code. this reverts a revert.
This reverts commit 338430995e.
2019-10-05 14:51:48 -04:00
drfrag
e6c6b617e2 - Fixed crash with wallsprites in the software renderer for real. 2019-10-05 19:18:00 +02:00
drfrag
338430995e Revert "- fixed a crash in the software renderer that caused wallsprites to crash"
This reverts commit 0dea6fcecc.
2019-10-05 19:18:00 +02:00
alexey.lysiuk
46270326be - implemented str(n)icmp function definitions via CMake macro 2019-10-05 14:47:36 +03:00
alexey.lysiuk
9332316c2a - set initial vsync state after creation of framebuffer
https://forum.zdoom.org/viewtopic.php?t=66020
2019-10-04 10:46:52 +03:00
Rachael Alexanderson
0dea6fcecc - fixed a crash in the software renderer that caused wallsprites to crash
(note: there is still a bug with grabbing the texture for these)
2019-10-03 23:32:14 -04:00
alexey.lysiuk
1d9b5cb239 - restored ability to link with thirdparty sound libraries explicitly
DYN_SNDFILE=NO and DYN_MPG123=NO were ignored while DYN_FLUIDSYNTH=NO broke compilation
These options should be applied to ZMusic target instead of the main executable
As a bonus, it's now possible to build GZDoom without FluidSynth
2019-10-03 12:22:46 +03:00
alexey.lysiuk
ad3327bdf5 - fixed compilation of Cocoa backend
src/posix/cocoa/st_start.mm:63:7: error: redefinition of 'FBasicStartupScreen'
2019-10-02 10:57:39 +03:00
Christoph Oelckers
b0acfc3ce6 - split up st_start.cpp into one file with the Windows interface code and a second one which only contains platform independent code.
Since this made heavy use of Windows type, those were duplicated to avoid rewriting the entire interface.
This split at least reduces the amount of code needed to refactor for making the screens work on other platforms than Windows.
2019-10-01 23:00:13 +02:00
Christoph Oelckers
5179a69fdb - don't let Vulkan access the vid_vsync variable directly.
Since the FrameBuffers have a SetVsync method anything these last set must count, not the global variable directly.
2019-10-01 20:50:15 +02:00
Christoph Oelckers
b9d4e77214 - eliminate a little bit of redundancy. 2019-10-01 20:13:40 +02:00
Christoph Oelckers
d2c156224b - cleanup of the sound init/exit code.
Now there is only one single entry point for both, instead of previously 2 entry and 4 exit points.
This also eliminates the explicit shutdown of ZMusic. Timidity++'s two buffers have been put in containers that self-destruct on shutdown and calling dumb_exit is not necessary because the only feature requiring it is not used by any code in the music library.
2019-10-01 20:04:46 +02:00
Christoph Oelckers
86ab366958 - some reformatting on exit code, mainly to make searching for the content easier. 2019-10-01 19:06:28 +02:00
Christoph Oelckers
241a47602b - small fix 2019-10-01 15:24:17 +02:00
Christoph Oelckers
338ae15a4c - sanitized exit code a bit
Instead of trying a homegrown way to avoid recursive exceptions, let's do it with the defined procedure C++ has for this case: call std::terminate.

This allowed removing some old hackery inherited from Boom and will now hopefully allow sanitizing the exit procedure to the point that it can be done without depending on exit handlers.
2019-10-01 01:37:21 +02:00
Christoph Oelckers
ff40bcd178 - moced I_DetectOS call into D_DoomMain
This requires the console and was the reason for this strange setup.
2019-10-01 01:02:49 +02:00
Christoph Oelckers
a1a73ef2b3 - moved the initial C_InitConsole call into D_DoomMain
The only difference here were the size values on Windows but for this initial call they have been useless for a long time. When this code was written the console buffer still had a fixed width that needed to be set before adding any text.
2019-10-01 01:00:37 +02:00
Christoph Oelckers
9f15efc5f5 - also put the Windows system specific exit handlers into atexit's list
Again, these have no place in the game's own uninit code.
2019-10-01 00:51:14 +02:00
Christoph Oelckers
eae593b1f5 - put SDL_Quit into the atexit queue instead of atterm
System exit procedures should not go in there.
2019-10-01 00:44:28 +02:00
Christoph Oelckers
12440bbca3 - new exception class for quitting the game
This will eventually replace the atexit mess, right now it isn't used.
2019-10-01 00:43:12 +02:00
Christoph Oelckers
e7c388dccd - don't throw exceptions before the system isn't initialized
If the window cannot be opened this has no way to report the problem. In this case a message box is needed.
2019-10-01 00:42:21 +02:00
Christoph Oelckers
42a54ef545 - copied the restart cleanup code into its own function 2019-10-01 00:30:44 +02:00
Christoph Oelckers
282047e67c - added a mapping table from DOS-IBM-437 to Unicode
This is for future use, added now so that it won't get lost.
2019-10-01 00:26:07 +02:00
Christoph Oelckers
2a3205200f - reordered a few things in the startup procedure
Mainly done to isolate the calls that actually manipulate the global frame buffer.

V_Init alsoi initialized some palette data, which was moved to V_InitPalette and did something entirely different when running a restart as opposed to an initial start.
2019-10-01 00:21:51 +02:00
Christoph Oelckers
a2883cdf39 - added missing return to the GENMIDI loader. 2019-10-01 00:11:41 +02:00
Braden Obrzut
63f2bf7ae3 - Document limitation of TArray and silence warnings about non-trivial types being trivially moved 2019-09-30 20:45:52 +02:00
Alexander
ff9715c080 add m_quickexit option for quick exit in game menu
Default: off (false)

When this option is enabled (true), then exiting the game from
main menu and by menu_quit command doesn't require confirmation
and doesn't play sound.
2019-09-30 20:07:45 +02:00
Christoph Oelckers
a76cdd0946 - fixed crash with non-looping music ending.
In this case it was the song terminating the stream, with the new setup the main music code has to do this itself.
2019-09-30 19:41:03 +02:00
Christoph Oelckers
83e8e5535d - fixed compilation on Windows. 2019-09-30 18:21:34 +02:00
Christoph Oelckers
2b87941d7d Merge branch 'master' into zmusic_work
# Conflicts:
#	src/sound/music/i_musicinterns.h
2019-09-30 17:48:34 +02:00
Christoph Oelckers
c61e8ada86 - removed the remains of the FModEx-style stream implementation
FMod had MP3/Ogg playback integrated right into itself, and the OpenAL backend tried to replicate this functionality.

This functionality, however, has been removed over two years ago when FMod started breaking things more and more, it was only this backing implementation that was left in.
2019-09-30 03:01:33 +02:00
Christoph Oelckers
2bc72f38cc - renamed a few functions in the public interface of ZMusic. 2019-09-30 02:40:22 +02:00
Christoph Oelckers
02507effe8 - moved the music loader code to ZMusic.
This was the final piece of code reorganization.

What's left is cleaning up the interface.
2019-09-30 02:35:47 +02:00
Christoph Oelckers
c42deda6e6 - cleanup of the remaining music code in the main project 2019-09-30 02:31:12 +02:00
Christoph Oelckers
d0cf21654e - moved the CD Audio code to ZMusic, too.
This was the last player class.
This code was also cleaned up for non-Windows systems where CD Audio is not implemented.
Instead of providing an empty implementation, all related code is now explicitly deactivated.
2019-09-30 02:22:53 +02:00