Commit Graph

249 Commits

Author SHA1 Message Date
mazmazz 894ee02f3f Fix x64 build issue 2018-11-13 17:12:18 -05:00
Monster Iestyn 51df32dd3d Merge branch 'gcc-compiling-cleanup' into 'master'
Compiling cleanup and fixes

See merge request STJr/SRB2!311
2018-11-10 13:56:17 -05:00
Monster Iestyn 0bdbdd1b1e Remove FUNCMATH from functions with a void return value or args, or examine variables other than their args (which could be modified) 2018-11-08 16:26:55 +00:00
Steel Titanium 5a0cfc10f4 Update copyright info on some files 2018-11-01 14:47:19 -04:00
mazmazz a288b95458 Merge remote-tracking branch 'public-gitlab/master' into public-music-cleanup 2018-10-19 22:04:26 -04:00
Sryder 6184f91dd3 Add an int to I_PlaySound to tell an interface which channel number SRB2 is using.
I've voided this out on other sound interfaces than SDL Mixer ones because I'm both not sure whether they need it, and not sure how to make them work with it if they do.
2018-10-13 23:01:11 +01:00
Sryder 497314fdc4 Tiny fix so that joystick2 being closed can let the JoystickSubSystem close before game close.
No memory leak here, just a very tiny thing I noticed.
2018-10-09 19:43:18 +01:00
Monster Iestyn 1115f41f8e Merge branch 'zlib-split' into 'master'
Makefile: Split zlib and libpng

See merge request STJr/SRB2!285
2018-10-08 07:20:27 -04:00
Steel Titanium 232a7ae7b7 Change order of the ifdef 2018-10-07 14:52:25 -04:00
Steel Titanium def090c9f0 Move the ifdef 2018-10-07 14:45:03 -04:00
Sryder fb6c329870 Fix the crashing bug hopefully
A value of 1 in freesrc for Mix_LoadWAV_RW and Mix_LoadMus_RW calls SDL_RWclose on the RWops anyway.
For Mix_LoadWAV_RW the RWops is freed right after the data is loaded (because it makes a copy of the data in memory)
For Mix_LoadMUS_RW the RWops is freed when Mix_FreeMusic is called (because the data is not a copy)
So setting 1 on freesrc doesn't actually free the RWops immediately on Mix_LoadMus_RW *unless* it failed to load any music.
2018-10-07 10:37:45 +01:00
Sryder 02597e0bf9 Fix compiler warnings. 2018-10-07 09:26:18 +01:00
Sryder d072dd2725 I think that should be NULL, not 0 actually. 2018-10-07 00:22:23 +01:00
Sryder 7b417b573c Mix_QuickLoad_RAW sets a flag in the Mix_Chunk so that Mix_FreeChunk doesn't actually Free the sound.
Checks for the flag when freeing, and if it's 0, we free the data manually after Mix_FreeChunk.
I went back to Z_Malloc and Z_Free for this because they still work after this.
2018-10-07 00:15:42 +01:00
Sryder 725a65c1f7 Call SDL_RWclose after an SDL_RWFromMem call to close the RWops. 2018-10-07 00:15:11 +01:00
Steel Titanium 49cb1ffe9f Restore deleted endif 2018-10-04 22:38:59 -04:00
Steel Titanium 79f5f4885c Split zlib and libpng 2018-10-04 19:47:19 -04:00
Steel Titanium f88708bb75 Fix the weird indentation 2018-09-21 12:05:52 -04:00
Steel Titanium 68ec811909 Rearrange the code.
Thanks again MonsterIestyn!
2018-09-21 11:26:08 -04:00
Steel af58ba9ae3 Remove this that somehow slipped in. 2018-09-21 07:21:49 -04:00
Steel be74b4e58b Fix up errors with buildbots 2018-09-21 07:16:54 -04:00
Steel Titanium 378495cb2b Add some stuff 2018-09-20 18:33:50 -04:00
Steel Titanium a53f036149 Use MemAvailable instead 2018-09-20 18:30:46 -04:00
mazmazz 40a8c9c1ee Mixer: HAVE_LIBGME ifdef in I_LoadSong 2018-09-15 00:35:24 -04:00
mazmazz 9a5eb02459 Fix Windows buildbot for MP3_MAD/MODPLUG define (the header we use is 2.0.2) 2018-09-14 17:47:04 -04:00
mazmazz 17ec5d8022 Mixer: Better MODPLUG/MP3_MAD defines
(cherry picked from commit 5b724e18b5268b0492b3f8b8980aadd2dd41e235)
2018-09-14 17:27:31 -04:00
mazmazz fdbe3e80f6 Fix compile errors on buildbots
* Check SDL Mixer 2.0.3 for MUS_MODPLUG_UNUSED, MUS_MP3_MAD_UNUSED
* Mixed D+C in I_LoadSong
2018-09-14 17:07:13 -04:00
mazmazz b330dc2394 Don't call I_StartupSound in SFX toggle
* Mixer: make I_StartupSound return early if already set up
* Restartaudio: Add StopSFX call
2018-09-14 16:39:10 -04:00
mazmazz 76be77b93a Rip out SDL Mixer code from sdl_sound.c because superfluous
* Mixer code has been in mixer_sound.c; this file is not invoked unless compiling with NOMIXER=1
* Remove everything under #ifdef HAVE_MIXER because this is never triggered
* Comment out #ifdef HAVE_LIBGME because we don't support playing music anyway (but theoretically, it could have worked separately from Mixer)
* Stub new music calls
2018-09-14 14:52:24 -04:00
mazmazz cb4e075137 I_InitMusic SDL2: Don't unload GME indiscriminately 2018-09-14 13:36:01 -04:00
mazmazz e72610a3dc Separate StopMusic and UnloadMusic 2018-09-14 12:47:33 -04:00
mazmazz 4b1bc53db1 Compile fixes 2018-09-14 10:58:41 -04:00
mazmazz 8541963c61 I_SongPlaying detect GME properly
(cherry picked from commit e88d1477616ca66472ecb50d371e37dc79c77c0f)
2018-09-14 10:49:44 -04:00
mazmazz d94f7e3cb0 Stub I_UnloadSong because we already unload in I_StopMusic
* Stop-gap for now. Ideally the logic would be in the respective places.

# Conflicts:
#	src/sdl/mixer_sound.c

(cherry picked from commit eae5d3333f5001512c82f22f2b1433a955b3a6c3)
2018-09-14 10:49:44 -04:00
mazmazz 5f22b7d973 Volume fixes
# Conflicts:
#	src/sdl/mixer_sound.c

(cherry picked from commit d39b7011c5b12e5b7abe3e493971e003469a1f3d)
2018-09-14 10:49:44 -04:00
mazmazz 2fbe206ecb A word
(cherry picked from commit fb6f8c8a0752c229f5b7369729437c8fecb54d45)
2018-09-14 10:49:44 -04:00
mazmazz b0c47e2fb1 GME fix: play song in I_PlaySong, not I_LoadSong
(cherry picked from commit 5f21bf230d9716b7cc5b52e4bf3591ebe01e9f3a)
2018-09-14 10:45:39 -04:00
mazmazz 4d61f00b86 Refactor I_MusicType MusicPlaying and MusicPaused other targets
(cherry picked from commit 9e6eebeb8d6b4119d87e9678bb6b0687e3dc5217)
2018-09-14 10:45:39 -04:00
mazmazz eacf0ba00b Refactor I_MusicType MusicPlaying and MusicPaused -> I_SongType ...
(cherry picked from commit 4b82de9e540d6dc0651bbe8db8e5e15cba39f650)
2018-09-14 10:45:38 -04:00
mazmazz d535c14fc6 Refactoring and reordering other targets
(cherry picked from commit cf065e106f68fb8af3b0568eba188c8235b1656e)
2018-09-14 10:43:46 -04:00
mazmazz 5bac836d4c Minor refactoring and reordering
* I_GetMusicType() -> I_MusicType()
* Wrap MIDI volume hack in #ifdef _WIN32

(cherry picked from commit a7d51bf81030c228937a8e759f8f43b85817fce6)
2018-09-14 10:42:27 -04:00
mazmazz 17cf310b84 nodigimusic nomusic nosound refactor other targets
(cherry picked from commit 86f151db654beb14e8d6893cdff2adaa965e8e4b)
2018-09-14 10:35:56 -04:00
mazmazz 44557d9c9d I_MusicPlaying, I_MusicPaused other targets
(cherry picked from commit d5ec38815968e267aceb59a48a6cb6d3292c0b69)
2018-09-14 10:28:35 -04:00
mazmazz 011a043dba Refactoring, music statues
* S_Init -> S_InitSfxChannels because it did mostly SFX anyway
* S_MusicPlaying, S_MusicPaused, S_MusicName, S_MusicExists new status methods
* I_MusicPlaying, I_MusicPaused

(cherry picked from commit f5f0b5e76c2fd405c8cc895dde653c5ed2652622)
2018-09-14 10:28:29 -04:00
mazmazz e58a8f4fe1 Consolidate I_SetDigMusicVolume and I_SetMIDIMusicVolume other targets
(cherry picked from commit 9fb9386f84b3739fe765a78bcb9683eb7e98bc36)
2018-09-14 10:23:47 -04:00
mazmazz a7ed7b2c90 Consolidate I_SetDigMusicVolume and I_SetMIDIMusicVolume into one method
* In s_sound, they are merged to one method as well, but there are still two separate digvolume and seqvolume variables
* Simplified Dig/MidiMusicDisabled in s_sound
* Method reordering

(cherry picked from commit 701cc5a7dd1dfead87a42ec7558c9fa6a1deb193)
2018-09-14 10:23:37 -04:00
mazmazz 46b53e8bae Added I_GetMusicType and removed midimode variable: other targets
(cherry picked from commit 14b393ab16736bb44dab6fd4a90b7bdd8ff782e0)
2018-09-14 09:55:45 -04:00
mazmazz 06b7367941 Added I_GetMusicType and removed midimode variable
* Revised S_PlayMusic arguments
* Now music plays again!

(cherry picked from commit 55f3803e4b9f8104c90cc6c769d54121e5bac0b8)
2018-09-14 09:42:29 -04:00
mazmazz b59aa27104 Loose ends other targets
(cherry picked from commit 9a5fc5f66a31baf713c6f32f7a696b933da6907b)
2018-09-14 09:41:08 -04:00
Monster Iestyn 9d3aad9036 Merge branch 'XPMupdate' into 'master'
update XPM icon

See merge request STJr/SRB2!267
2018-08-21 10:31:25 -04:00