Commit graph

17924 commits

Author SHA1 Message Date
Christoph Oelckers
f3219ca979 Merge branch 'master' of https://github.com/coelckers/gzdoom 2019-10-01 15:26:57 +02:00
Christoph Oelckers
241a47602b - small fix 2019-10-01 15:24:17 +02:00
alexey.lysiuk
8ff51ca129 - fixed build issues with POSIX targets 2019-10-01 12:06:24 +03: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
Alexander
0c2ed71cdd fix bug when down arrow gave no result after mouse move in main menu
Steps to reproduce:
1. Load game.
2. Press any key to bring up the main menu.
3. Move the mouse anywhere out of the menu entries.
4. Press Down arrow.

Expected result: the menu cursor sound is played, the first menu element is selected.
Actual result: the menu cursor sound is played, no menu element is selected.

Repeated Down arrow pressing doesn't give any result, either.

If on step 4 Up arrow is pressed, the last element in the menu is selected.
2019-09-30 20:04:44 +02:00
Christoph Oelckers
9bb8da2533 - fixed the CDDA check to not catch all RIFF files. 2019-09-30 19:57:47 +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
Christoph Oelckers
352365189f - moved the main music classes to ZMusic
What's left is the CD-Audio playback and some global functions.
2019-09-30 02:10:00 +02:00
Christoph Oelckers
6bfa1bf692 - fixed compilation with XCode and silenced several warnings 2019-09-30 01:51:53 +02:00
Christoph Oelckers
2c33e47988 - hooked up a few more CVARs and other values the music backend needs to know about and moved the MusInfo base class into zmusic. 2019-09-30 01:34:16 +02:00
Christoph Oelckers
7c27cd0c57 - moved the sound system's sound stream for the music out of the song objects.
It is now being handled by the controlling code.
While of no benefit for GZDoom itself, this finally allows to separate the entire music code into a separate, engine independent project that merely provides streamed music data when not playing on a hardware device (WinMM Midi or CD Audio.)
The tight coupling of the music code with the sound backend made this nearly impossible before
2019-09-30 00:02:31 +02:00
Christoph Oelckers
c7b379483e - reordering code a bit to see where the stream must be started. 2019-09-29 22:54:13 +02:00
Christoph Oelckers
d06ec56c2e - a bit of cleanup - moving internal class declarations into the sources.
Now i_musicinterns.h doesn't bleed the entire implementation everywhere anymore.
2019-09-29 22:32:42 +02:00
Christoph Oelckers
b9b706e951 - renamed the configuration file. 2019-09-29 22:03:14 +02:00
Christoph Oelckers
44a6b6e87c - moved all configuration code to zmusic project.
The CVARs are now just getting forwarded without any own logic.
2019-09-29 22:01:19 +02:00
Christoph Oelckers
b7b57b904d - first state of music configuration refactor. 2019-09-29 20:01:57 +02:00
Christoph Oelckers
ab016be6b9 - did a bit of reordering on I_RegisterSong.
The way CDDA was treated as an afterthought made handling of stream songs somewhat problematic, because the state could be unclear.
CDDA is an easily identifiable format so it should be tested first.
2019-09-29 15:10:06 +02:00
alexey.lysiuk
ef7a356644 - fixed inventory scroll arrows in alternative HUD
https://forum.zdoom.org/viewtopic.php?t=65976
2019-09-29 16:07:25 +03:00
Christoph Oelckers
6d7b6fb9fd - moved MIDI format detection and source creation into zmusic project. 2019-09-29 14:47:10 +02:00
Christoph Oelckers
54b994e863 - configuration key enums. Not used yet. 2019-09-29 14:13:01 +02:00
Christoph Oelckers
859028b35a - moved the stream sources to zmusic project. 2019-09-29 13:33:09 +02:00
Christoph Oelckers
247346e821 - removed ZDoom dependencies from music_libsndfile.cpp 2019-09-29 13:06:40 +02:00
Christoph Oelckers
cdf2a17c5a - moved the sound decoding code to the zmusic project.
Since this gets used by both the sound backend and the music code it needs to be in a place accessible to both.
2019-09-29 12:48:12 +02:00
Christoph Oelckers
b883d27a1f - XA, too. 2019-09-29 01:44:59 +02:00
Christoph Oelckers
dbabc3c0f6 - ... and the raw OPL format. 2019-09-29 01:31:42 +02:00
Christoph Oelckers
dbb4539f4f - gave music_gme.cpp the treatment. 2019-09-29 01:00:15 +02:00
Christoph Oelckers
5eed3dab59 - dependency cleanup in music_dumb.cpp. 2019-09-29 00:41:13 +02:00
Christoph Oelckers
7468c0f36d - consolidated the different file access interfaces in the backends into one shared version.
This was getting a bit unwieldy. The include path setup is not perfect yet, that's work for later.
(It's about time we're getting C++20 with modules so that this include path madness can be put to an end.)
2019-09-28 23:17:16 +02:00
Christoph Oelckers
d94b63b486 - uncoupled the stream sources from the low level implementation. The entire setup had the stream sources depend on the SoundStream class, severely limiting reusability. This was changed that there is one SoundStream class that uses the StreamSources as mere data source that has no knowledge and no connection to the underlying system, similar to how the MIDI system works. With this there are only 3 top level music classes left - MIDIStreamer, StreamSong and CDSong.
Also made the decode_vorbis function in DUMB a function pointer so that the library does not depend on high level code and can just ignore the vorbis case if no supported.
2019-09-28 21:04:41 +02:00
Christoph Oelckers
cfe89ef6e6 - created a new zmusic library which will eventually contain all the music playback code.
Currently all it contains are the MIDI sources and the MIDI devices, the rest needs to be reworked first.
2019-09-28 18:32:25 +02:00
Christoph Oelckers
fc6eba0c26 - more dependency removal, this time from the MIDI devices. 2019-09-28 16:50:00 +02:00