Fixing digi_win32_ functions I broke yesterday. THANKS ZIF\!
This commit is contained in:
parent
2ba931acca
commit
a01ae0f445
|
@ -5,6 +5,7 @@ D2X-Rebirth Changelog
|
||||||
main/game.c, main/gameseq.c: Resetting GameTime, Next/Last_flare/laser/missile_time in reset_time() together so GameTime-rollover-fallbacks will not create a massive delay when starting a new level
|
main/game.c, main/gameseq.c: Resetting GameTime, Next/Last_flare/laser/missile_time in reset_time() together so GameTime-rollover-fallbacks will not create a massive delay when starting a new level
|
||||||
main/laser.c: Removed the previously used homers code and instead used old one to keep good ol' Gameplay; Removed FrameCount steps from track_track_goal() and scaled homing vector accordingly to this change, including properly scaling it to FrameTime; Made code more similar between D1X and D2X; Introduced different turn rates for different difficulty levels
|
main/laser.c: Removed the previously used homers code and instead used old one to keep good ol' Gameplay; Removed FrameCount steps from track_track_goal() and scaled homing vector accordingly to this change, including properly scaling it to FrameTime; Made code more similar between D1X and D2X; Introduced different turn rates for different difficulty levels
|
||||||
main/game.c: Fixing typo in Netgame help screen
|
main/game.c: Fixing typo in Netgame help screen
|
||||||
|
arch/sdl/digi.c, arch/sdl/digi_audio.c, main/songs.c: Fixing digi_win32_ functions I broke yesterday. THANKS ZIF!
|
||||||
|
|
||||||
20100614
|
20100614
|
||||||
--------
|
--------
|
||||||
|
|
|
@ -26,6 +26,9 @@
|
||||||
#ifdef USE_SDLMIXER
|
#ifdef USE_SDLMIXER
|
||||||
#include <digi_mixer.h>
|
#include <digi_mixer.h>
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef _WIN32
|
||||||
|
#include "hmpfile.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Sound system function pointers */
|
/* Sound system function pointers */
|
||||||
|
|
||||||
|
@ -142,9 +145,10 @@ void digi_debug()
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
// Windows native-MIDI stuff.
|
// Windows native-MIDI stuff.
|
||||||
|
int digi_win32_midi_song_playing=0;
|
||||||
void digi_win32_set_midi_volume( int mvolume )
|
void digi_win32_set_midi_volume( int mvolume )
|
||||||
{
|
{
|
||||||
int mm_volume;
|
int mm_volume, midi_volume=0;
|
||||||
|
|
||||||
if (mvolume < 0)
|
if (mvolume < 0)
|
||||||
midi_volume = 0;
|
midi_volume = 0;
|
||||||
|
@ -163,7 +167,7 @@ void digi_win32_set_midi_volume( int mvolume )
|
||||||
|
|
||||||
int digi_win32_play_midi_song( char * filename, char * melodic_bank, char * drum_bank, int loop )
|
int digi_win32_play_midi_song( char * filename, char * melodic_bank, char * drum_bank, int loop )
|
||||||
{
|
{
|
||||||
digi_stop_current_song();
|
digi_win32_stop_current_song();
|
||||||
|
|
||||||
if (filename == NULL)
|
if (filename == NULL)
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -172,8 +176,8 @@ int digi_win32_play_midi_song( char * filename, char * melodic_bank, char * drum
|
||||||
{
|
{
|
||||||
if (hmp_play(hmp,loop) != 0)
|
if (hmp_play(hmp,loop) != 0)
|
||||||
return 0; // error
|
return 0; // error
|
||||||
digi_midi_song_playing = 1;
|
digi_win32_midi_song_playing = 1;
|
||||||
digi_set_midi_volume(midi_volume);
|
digi_win32_set_midi_volume((GameCfg.MusicVolume*128)/8);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -182,11 +186,11 @@ int digi_win32_play_midi_song( char * filename, char * melodic_bank, char * drum
|
||||||
|
|
||||||
void digi_win32_stop_current_song()
|
void digi_win32_stop_current_song()
|
||||||
{
|
{
|
||||||
if (digi_midi_song_playing)
|
if (digi_win32_midi_song_playing)
|
||||||
{
|
{
|
||||||
hmp_close(hmp);
|
hmp_close(hmp);
|
||||||
hmp = NULL;
|
hmp = NULL;
|
||||||
digi_midi_song_playing = 0;
|
digi_win32_midi_song_playing = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -9,14 +9,8 @@
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#include <SDL/SDL.h>
|
#include <SDL/SDL.h>
|
||||||
#include <digi_audio.h>
|
#include <digi_audio.h>
|
||||||
|
|
||||||
#ifdef _WIN32
|
|
||||||
#include "hmpfile.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "pstypes.h"
|
#include "pstypes.h"
|
||||||
#include "error.h"
|
#include "error.h"
|
||||||
#include "fix.h"
|
#include "fix.h"
|
||||||
|
|
16
main/songs.c
16
main/songs.c
|
@ -189,7 +189,7 @@ void songs_init()
|
||||||
void songs_uninit()
|
void songs_uninit()
|
||||||
{
|
{
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
if (GameArg.DisableSdlMixer)
|
if (GameArg.SndDisableSdlMixer)
|
||||||
digi_win32_stop_current_song(); // Stop midi song, if playing
|
digi_win32_stop_current_song(); // Stop midi song, if playing
|
||||||
#endif
|
#endif
|
||||||
RBAStop();
|
RBAStop();
|
||||||
|
@ -207,7 +207,7 @@ void songs_uninit()
|
||||||
void songs_stop_all(void)
|
void songs_stop_all(void)
|
||||||
{
|
{
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
if (GameArg.DisableSdlMixer)
|
if (GameArg.SndDisableSdlMixer)
|
||||||
digi_win32_stop_current_song(); // Stop midi song, if playing
|
digi_win32_stop_current_song(); // Stop midi song, if playing
|
||||||
#endif
|
#endif
|
||||||
RBAStop();
|
RBAStop();
|
||||||
|
@ -220,10 +220,6 @@ void songs_stop_all(void)
|
||||||
|
|
||||||
void songs_pause(void)
|
void songs_pause(void)
|
||||||
{
|
{
|
||||||
#ifdef _WIN32
|
|
||||||
if (GameArg.DisableSdlMixer)
|
|
||||||
digi_win32_pause_midi();
|
|
||||||
#endif
|
|
||||||
if (GameCfg.MusicType == MUSIC_TYPE_REDBOOK)
|
if (GameCfg.MusicType == MUSIC_TYPE_REDBOOK)
|
||||||
RBAPause();
|
RBAPause();
|
||||||
#ifdef USE_SDLMIXER
|
#ifdef USE_SDLMIXER
|
||||||
|
@ -233,10 +229,6 @@ void songs_pause(void)
|
||||||
|
|
||||||
void songs_resume(void)
|
void songs_resume(void)
|
||||||
{
|
{
|
||||||
#ifdef _WIN32
|
|
||||||
if (GameArg.DisableSdlMixer)
|
|
||||||
digi_win32_resume_midi_song();
|
|
||||||
#endif
|
|
||||||
if (GameCfg.MusicType == MUSIC_TYPE_REDBOOK)
|
if (GameCfg.MusicType == MUSIC_TYPE_REDBOOK)
|
||||||
RBAResume();
|
RBAResume();
|
||||||
#ifdef USE_SDLMIXER
|
#ifdef USE_SDLMIXER
|
||||||
|
@ -325,7 +317,7 @@ int songs_play_song( int songnum, int repeat )
|
||||||
case MUSIC_TYPE_BUILTIN:
|
case MUSIC_TYPE_BUILTIN:
|
||||||
{
|
{
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
if (GameArg.DisableSdlMixer)
|
if (GameArg.SndDisableSdlMixer)
|
||||||
{
|
{
|
||||||
if (digi_win32_play_midi_song( Songs[songnum].filename, Songs[songnum].melodic_bank_file, Songs[songnum].drum_bank_file, repeat ))
|
if (digi_win32_play_midi_song( Songs[songnum].filename, Songs[songnum].melodic_bank_file, Songs[songnum].drum_bank_file, repeat ))
|
||||||
{
|
{
|
||||||
|
@ -414,7 +406,7 @@ int songs_play_level_song( int levelnum, int offset )
|
||||||
{
|
{
|
||||||
songnum = SONG_FIRST_LEVEL_SONG + (songnum % NumLevelSongs);
|
songnum = SONG_FIRST_LEVEL_SONG + (songnum % NumLevelSongs);
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
if (GameArg.DisableSdlMixer)
|
if (GameArg.SndDisableSdlMixer)
|
||||||
{
|
{
|
||||||
if (digi_win32_play_midi_song( Songs[songnum].filename, Songs[songnum].melodic_bank_file, Songs[songnum].drum_bank_file, 1 ))
|
if (digi_win32_play_midi_song( Songs[songnum].filename, Songs[songnum].melodic_bank_file, Songs[songnum].drum_bank_file, 1 ))
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue