Using Windows code to play HMP files on Windows build; Fixed Jukebox keys in help screen; Allow -noredundancy in Singleplayer; Fixed processing of Console keys if Console is not active; Added Multiplayer hints to README; Made INI wrapping safer and more accurate
This commit is contained in:
parent
decaf3cc6d
commit
885074607c
|
@ -1,5 +1,9 @@
|
||||||
D1X-Rebirth Changelog
|
D1X-Rebirth Changelog
|
||||||
|
|
||||||
|
20080601
|
||||||
|
--------
|
||||||
|
include/args.h, main/inferno.c, main/hud.c, main/game.c, main/gamecntl.c, misc/args.c, d2x.ini, README.txt, arch/sdl/digi_mixer.c, arch/sdl/digi_mixer_music.c, arch/sdl/digi_audio.c, arch/win32/include/hmpfile.h, arch/win32/hmpfile.c: Using Windows code to play HMP files on Windows build; Fixed Jukebox keys in help screen; Allow -noredundancy in Singleplayer; Fixed processing of Console keys if Console is not active; Added Multiplayer hints to README; Made INI wrapping safer and more accurate
|
||||||
|
|
||||||
20080528
|
20080528
|
||||||
--------
|
--------
|
||||||
arch/sdl/rbaudio.c, main/songs.c: allow an audio CD to be played if it's inserted after D1X is launched, hopefully find the first audio CD if multiple CDs are inserted
|
arch/sdl/rbaudio.c, main/songs.c: allow an audio CD to be played if it's inserted after D1X is launched, hopefully find the first audio CD if multiple CDs are inserted
|
||||||
|
|
14
README.txt
14
README.txt
|
@ -53,12 +53,22 @@ For example:
|
||||||
See INSTALL.txt.
|
See INSTALL.txt.
|
||||||
|
|
||||||
|
|
||||||
3. Legal stuff
|
3. Multiplayer
|
||||||
|
|
||||||
|
DXX-Rebirth supports Multiplayer over (obsoleted) IPX and UDP/IP.
|
||||||
|
Using UDP/IP works over LAN and Internet. Since the Networking code of the Descent Engine is Peer-to-Peer, it is necessary for
|
||||||
|
all players (Host and Clients) to open port UDP 31017.
|
||||||
|
Clients can put an offset to this port by using '-ip_baseport OFFSET'.
|
||||||
|
Hosts can also use option '-ip_relay' to route players with closed ports. Use this with caution. It will increase Lag and Ping drastically.
|
||||||
|
UDP/IP also supports IPv6 by compiling the game with the designated flag. Please note IPv4- and IPv6-builds cannot play together.
|
||||||
|
|
||||||
|
|
||||||
|
4. Legal stuff
|
||||||
|
|
||||||
See COPYING.txt
|
See COPYING.txt
|
||||||
|
|
||||||
|
|
||||||
4. Contact
|
5. Contact
|
||||||
|
|
||||||
http://www.dxx-rebirth.de/
|
http://www.dxx-rebirth.de/
|
||||||
zicodxx [at] yahoo [dot] de
|
zicodxx [at] yahoo [dot] de
|
||||||
|
|
|
@ -431,11 +431,6 @@ void digi_audio_end_sound(int channel)
|
||||||
SoundSlots[channel].persistent = 0;
|
SoundSlots[channel].persistent = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef _WIN32
|
|
||||||
hmp_file *hmp = NULL;
|
|
||||||
static int digi_midi_song_playing = 0;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// MIDI stuff follows.
|
// MIDI stuff follows.
|
||||||
void digi_audio_set_midi_volume( int mvolume )
|
void digi_audio_set_midi_volume( int mvolume )
|
||||||
{
|
{
|
||||||
|
|
|
@ -33,6 +33,10 @@
|
||||||
#include "gr.h" // needed for piggy.h
|
#include "gr.h" // needed for piggy.h
|
||||||
#include "piggy.h"
|
#include "piggy.h"
|
||||||
|
|
||||||
|
#ifdef _WIN32
|
||||||
|
#include "hmpfile.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#define MIX_DIGI_DEBUG 0
|
#define MIX_DIGI_DEBUG 0
|
||||||
#define MIX_OUTPUT_FORMAT AUDIO_S16
|
#define MIX_OUTPUT_FORMAT AUDIO_S16
|
||||||
#define MIX_OUTPUT_CHANNELS 2
|
#define MIX_OUTPUT_CHANNELS 2
|
||||||
|
@ -182,6 +186,23 @@ void digi_mixer_set_digi_volume( int dvolume )
|
||||||
}
|
}
|
||||||
|
|
||||||
void digi_mixer_set_midi_volume( int mvolume ) {
|
void digi_mixer_set_midi_volume( int mvolume ) {
|
||||||
|
#ifdef _WIN32
|
||||||
|
int mm_volume;
|
||||||
|
|
||||||
|
if (mvolume < 0)
|
||||||
|
midi_volume = 0;
|
||||||
|
else if (mvolume > 127)
|
||||||
|
midi_volume = 127;
|
||||||
|
else
|
||||||
|
midi_volume = mvolume;
|
||||||
|
|
||||||
|
// scale up from 0-127 to 0-0xffff
|
||||||
|
mm_volume = (midi_volume << 1) | (midi_volume & 1);
|
||||||
|
mm_volume |= (mm_volume << 8);
|
||||||
|
|
||||||
|
if (hmp)
|
||||||
|
midiOutSetVolume((HMIDIOUT)hmp->hmidi, mm_volume | mm_volume << 16);
|
||||||
|
#endif
|
||||||
midi_volume = mvolume;
|
midi_volume = mvolume;
|
||||||
if (!digi_initialised) return;
|
if (!digi_initialised) return;
|
||||||
mix_set_music_volume(mvolume);
|
mix_set_music_volume(mvolume);
|
||||||
|
@ -225,7 +246,19 @@ void digi_mixer_play_midi_song(char * filename, char * melodic_bank, char * drum
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// standard song playback
|
// standard song playback
|
||||||
mix_play_music(filename, loop);
|
#ifdef _WIN32
|
||||||
|
if (!GameArg.SndExternalMusic)
|
||||||
|
{
|
||||||
|
if ((hmp = hmp_open(filename)))
|
||||||
|
{
|
||||||
|
hmp_play(hmp,loop);
|
||||||
|
digi_midi_song_playing = 1;
|
||||||
|
digi_set_midi_volume(midi_volume);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
#endif
|
||||||
|
mix_play_music(filename, loop);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -235,6 +268,14 @@ int digi_mixer_music_exists(const char *filename)
|
||||||
}
|
}
|
||||||
|
|
||||||
void digi_mixer_stop_current_song() {
|
void digi_mixer_stop_current_song() {
|
||||||
|
#ifdef _WIN32
|
||||||
|
if (digi_midi_song_playing)
|
||||||
|
{
|
||||||
|
hmp_close(hmp);
|
||||||
|
hmp = NULL;
|
||||||
|
digi_midi_song_playing = 0;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
jukebox_stop(); //stops jukebox as well as standard music
|
jukebox_stop(); //stops jukebox as well as standard music
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -94,10 +94,10 @@ void mix_play_music(char *filename, int loop) {
|
||||||
|
|
||||||
// What is the extension of external files? If none, default to internal MIDI
|
// What is the extension of external files? If none, default to internal MIDI
|
||||||
if (GameArg.SndExternalMusic) {
|
if (GameArg.SndExternalMusic) {
|
||||||
sprintf(rel_filename, "%s/%s.%3s", basedir, music_title, GameArg.SndExternalMusic); // add extension
|
snprintf(rel_filename, strlen(basedir)+strlen(music_title)+6, "%s/%s.%s", basedir, music_title, GameArg.SndExternalMusic); // add extension
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
sprintf(rel_filename, "%s/%s.mid", basedir, music_title);
|
snprintf(rel_filename, strlen(basedir)+strlen(music_title)+6, "%s/%s.mid", basedir, music_title);
|
||||||
convert_hmp(filename, rel_filename);
|
convert_hmp(filename, rel_filename);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -15,6 +15,8 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
extern void PumpMessages(void);
|
extern void PumpMessages(void);
|
||||||
|
hmp_file *hmp = NULL;
|
||||||
|
int digi_midi_song_playing = 0;
|
||||||
|
|
||||||
hmp_file *hmp_open(const char *filename) {
|
hmp_file *hmp_open(const char *filename) {
|
||||||
int i;
|
int i;
|
||||||
|
|
|
@ -51,4 +51,7 @@ hmp_file *hmp_open(const char *filename);
|
||||||
int hmp_play(hmp_file *hmp, int bLoop);
|
int hmp_play(hmp_file *hmp, int bLoop);
|
||||||
void hmp_close(hmp_file *hmp);
|
void hmp_close(hmp_file *hmp);
|
||||||
|
|
||||||
|
extern hmp_file *hmp;
|
||||||
|
extern int digi_midi_song_playing;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
2
d1x.ini
2
d1x.ini
|
@ -12,6 +12,7 @@
|
||||||
;-autodemo Start in demo mode
|
;-autodemo Start in demo mode
|
||||||
;-notitles Skip title screens
|
;-notitles Skip title screens
|
||||||
;-window Run the game in a window
|
;-window Run the game in a window
|
||||||
|
;-noredundancy Do not send messages when picking up redundant items
|
||||||
|
|
||||||
Controls:
|
Controls:
|
||||||
|
|
||||||
|
@ -36,7 +37,6 @@
|
||||||
Multiplayer:
|
Multiplayer:
|
||||||
|
|
||||||
;-mprofile Enable multiplayer game profiles
|
;-mprofile Enable multiplayer game profiles
|
||||||
;-noredundancy Do not send messages when picking up redundant items in multiplayer
|
|
||||||
;-playermessages View only messages from other players in multi - overrides -noredundancy
|
;-playermessages View only messages from other players in multi - overrides -noredundancy
|
||||||
;-ipxnetwork <n> Use IPX network number <n>
|
;-ipxnetwork <n> Use IPX network number <n>
|
||||||
;-ip_baseport <n> Use <p> as offset from normal port
|
;-ip_baseport <n> Use <p> as offset from normal port
|
||||||
|
|
|
@ -52,6 +52,7 @@ typedef struct Arg
|
||||||
int SysWindow;
|
int SysWindow;
|
||||||
int SysAutoDemo;
|
int SysAutoDemo;
|
||||||
int SysNoTitles;
|
int SysNoTitles;
|
||||||
|
int SysNoRedundancy;
|
||||||
int CtlNoMouse;
|
int CtlNoMouse;
|
||||||
int CtlNoJoystick;
|
int CtlNoJoystick;
|
||||||
int CtlMouselook;
|
int CtlMouselook;
|
||||||
|
@ -67,7 +68,6 @@ typedef struct Arg
|
||||||
#endif
|
#endif
|
||||||
int EdiNoBm;
|
int EdiNoBm;
|
||||||
int MplGameProfile;
|
int MplGameProfile;
|
||||||
int MplNoRedundancy;
|
|
||||||
int MplPlayerMessages;
|
int MplPlayerMessages;
|
||||||
const char *MplIpxNetwork;
|
const char *MplIpxNetwork;
|
||||||
int MplIpBasePort;
|
int MplIpBasePort;
|
||||||
|
|
10
main/game.c
10
main/game.c
|
@ -1414,8 +1414,8 @@ void show_help()
|
||||||
m[nitems].type = NM_TYPE_TEXT; m[nitems++].text = TXT_HELP_1TO5;
|
m[nitems].type = NM_TYPE_TEXT; m[nitems++].text = TXT_HELP_1TO5;
|
||||||
m[nitems].type = NM_TYPE_TEXT; m[nitems++].text = TXT_HELP_6TO10;
|
m[nitems].type = NM_TYPE_TEXT; m[nitems++].text = TXT_HELP_6TO10;
|
||||||
#ifdef USE_SDLMIXER
|
#ifdef USE_SDLMIXER
|
||||||
m[nitems].type = NM_TYPE_TEXT; m[nitems++].text = "Shift-F9/F10\t Play/Pause Jukebox";
|
m[nitems].type = NM_TYPE_TEXT; m[nitems++].text = "Alt-Shift-F9/F10\t Play/Pause Jukebox";
|
||||||
m[nitems].type = NM_TYPE_TEXT; m[nitems++].text = "Shift-F11/F12\t Previous/Next Song";
|
m[nitems].type = NM_TYPE_TEXT; m[nitems++].text = "Alt-Shift-F11/F12\t Previous/Next Song";
|
||||||
#endif
|
#endif
|
||||||
m[nitems].type = NM_TYPE_TEXT; m[nitems++].text = "";
|
m[nitems].type = NM_TYPE_TEXT; m[nitems++].text = "";
|
||||||
m[nitems].type = NM_TYPE_TEXT; m[nitems++].text = "MULTIPLAYER:";
|
m[nitems].type = NM_TYPE_TEXT; m[nitems++].text = "MULTIPLAYER:";
|
||||||
|
@ -2508,11 +2508,9 @@ void ReadControls()
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
while ((key=key_inkey_time(&key_time)) != 0) {
|
while ((key=key_inkey_time(&key_time)) != 0) {
|
||||||
if (con_events(key))
|
if (con_events(key) && con_render)
|
||||||
{
|
|
||||||
game_flush_inputs();
|
game_flush_inputs();
|
||||||
continue;
|
|
||||||
}
|
|
||||||
if (Player_is_dead)
|
if (Player_is_dead)
|
||||||
HandleDeathKey(key);
|
HandleDeathKey(key);
|
||||||
|
|
||||||
|
|
|
@ -163,7 +163,7 @@ int HUD_init_message_va(char * format, va_list args)
|
||||||
|
|
||||||
// Added by Leighton
|
// Added by Leighton
|
||||||
|
|
||||||
if ((Game_mode & GM_MULTI) && GameArg.MplNoRedundancy)
|
if (GameArg.SysNoRedundancy)
|
||||||
if (!strnicmp ("You already",message,11) || !stricmp("your laser is maxed out!",message))
|
if (!strnicmp ("You already",message,11) || !stricmp("your laser is maxed out!",message))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
|
|
@ -148,6 +148,7 @@ void show_commandline_help()
|
||||||
printf( " -autodemo %s\n", "Start in demo mode");
|
printf( " -autodemo %s\n", "Start in demo mode");
|
||||||
printf( " -notitles %s\n", "Skip title screens");
|
printf( " -notitles %s\n", "Skip title screens");
|
||||||
printf( " -window %s\n", "Run the game in a window");
|
printf( " -window %s\n", "Run the game in a window");
|
||||||
|
printf( " -noredundancy %s\n", "Do not send messages when picking up redundant items");
|
||||||
|
|
||||||
printf( "\n Controls:\n\n");
|
printf( "\n Controls:\n\n");
|
||||||
printf( " -nomouse %s\n", "Deactivate mouse");
|
printf( " -nomouse %s\n", "Deactivate mouse");
|
||||||
|
@ -173,7 +174,6 @@ void show_commandline_help()
|
||||||
#ifdef NETWORK
|
#ifdef NETWORK
|
||||||
printf( "\n Multiplayer:\n\n");
|
printf( "\n Multiplayer:\n\n");
|
||||||
printf( " -mprofile %s\n", "Enable multiplayer game profiles");
|
printf( " -mprofile %s\n", "Enable multiplayer game profiles");
|
||||||
printf( " -noredundancy %s\n", "Do not send messages when picking up redundant items in multiplayer");
|
|
||||||
printf( " -playermessages %s\n", "View only messages from other players in multi - overrides -noredundancy");
|
printf( " -playermessages %s\n", "View only messages from other players in multi - overrides -noredundancy");
|
||||||
printf( " -ipxnetwork <n> %s\n", "Use IPX network number <n>");
|
printf( " -ipxnetwork <n> %s\n", "Use IPX network number <n>");
|
||||||
printf( " -ip_baseport <n> %s\n", "Use <n> as offset from normal port (allows multiple instances of d1x to be run on a single computer)");
|
printf( " -ip_baseport <n> %s\n", "Use <n> as offset from normal port (allows multiple instances of d1x to be run on a single computer)");
|
||||||
|
|
21
misc/args.c
21
misc/args.c
|
@ -85,7 +85,8 @@ int FindResArg(char *prefix, int *sw, int *sh)
|
||||||
void AppendIniArgs(void)
|
void AppendIniArgs(void)
|
||||||
{
|
{
|
||||||
PHYSFS_file *f;
|
PHYSFS_file *f;
|
||||||
char *line,*word;
|
char *line, *token;
|
||||||
|
char separator[] = " ";
|
||||||
|
|
||||||
f = PHYSFSX_openReadBuffered(INI_FILENAME);
|
f = PHYSFSX_openReadBuffered(INI_FILENAME);
|
||||||
|
|
||||||
|
@ -93,14 +94,18 @@ void AppendIniArgs(void)
|
||||||
while(!PHYSFS_eof(f) && Num_args < MAX_ARGS)
|
while(!PHYSFS_eof(f) && Num_args < MAX_ARGS)
|
||||||
{
|
{
|
||||||
line=fgets_unlimited(f);
|
line=fgets_unlimited(f);
|
||||||
word=splitword(line,' ');
|
|
||||||
|
|
||||||
Args[Num_args++] = d_strdup(word);
|
token = strtok(line, separator); /* first token in current line */
|
||||||
|
if (token)
|
||||||
|
Args[Num_args++] = d_strdup(token);
|
||||||
|
while( token != NULL )
|
||||||
|
{
|
||||||
|
token = strtok(NULL, separator); /* next tokens in current line */
|
||||||
|
if (token)
|
||||||
|
Args[Num_args++] = d_strdup(token);
|
||||||
|
}
|
||||||
|
|
||||||
if(line)
|
d_free(line);
|
||||||
Args[Num_args++] = d_strdup(line);
|
|
||||||
|
|
||||||
d_free(line); d_free(word);
|
|
||||||
}
|
}
|
||||||
PHYSFS_close(f);
|
PHYSFS_close(f);
|
||||||
}
|
}
|
||||||
|
@ -142,6 +147,7 @@ void ReadCmdArgs(void)
|
||||||
GameArg.SysWindow = FindArg("-window");
|
GameArg.SysWindow = FindArg("-window");
|
||||||
GameArg.SysNoTitles = FindArg("-notitles");
|
GameArg.SysNoTitles = FindArg("-notitles");
|
||||||
GameArg.SysAutoDemo = FindArg("-autodemo");
|
GameArg.SysAutoDemo = FindArg("-autodemo");
|
||||||
|
GameArg.SysNoRedundancy = FindArg("-noredundancy");
|
||||||
|
|
||||||
// Control Options
|
// Control Options
|
||||||
|
|
||||||
|
@ -174,7 +180,6 @@ void ReadCmdArgs(void)
|
||||||
// Multiplayer Options
|
// Multiplayer Options
|
||||||
|
|
||||||
GameArg.MplGameProfile = FindArg("-mprofile");
|
GameArg.MplGameProfile = FindArg("-mprofile");
|
||||||
GameArg.MplNoRedundancy = FindArg("-noredundancy");
|
|
||||||
GameArg.MplPlayerMessages = FindArg("-playermessages");
|
GameArg.MplPlayerMessages = FindArg("-playermessages");
|
||||||
GameArg.MplIpxNetwork = get_str_arg("-ipxnetwork", NULL);
|
GameArg.MplIpxNetwork = get_str_arg("-ipxnetwork", NULL);
|
||||||
GameArg.MplIpBasePort = get_int_arg("-ip_baseport", 0);
|
GameArg.MplIpBasePort = get_int_arg("-ip_baseport", 0);
|
||||||
|
|
Loading…
Reference in a new issue