ref: 7dde64ee8491049fd5ab552c19c878f8e5828dbe
parent: 16f29587b8e4bcce8df25485dfb1fba980ba8907
author: LTCHIPS <ltchips994@gmail.com>
date: Wed Jun 6 20:36:38 EDT 2018
music's back! Had to add TRUNC to the open func's args for the MIDI track
--- a/rott/audiolib/Makefile
+++ b/rott/audiolib/Makefile
@@ -8,7 +8,7 @@
CFLAGS ?= -std=c17 -g -Og
CFLAGS += -Wall -Wextra -Wshadow -Wpedantic
-CFLAGS += $(shell sdl-config --cflags)
+CFLAGS += $(shell sdl2-config --cflags)
OBJS :=
OBJS += fx_man.o
--- a/rott/fx_man.c
+++ b/rott/fx_man.c
@@ -403,6 +403,7 @@
} // if
audio_format = (samplebits == 8) ? AUDIO_U8 : AUDIO_S16SYS;
+
if (Mix_OpenAudio(mixrate, audio_format, numchannels, 256) < 0)
{
setErrorMessage(SDL_GetError());
--- a/rott/rt_main.c
+++ b/rott/rt_main.c
@@ -264,6 +264,7 @@
{
if (!quiet)
printf( "MU_Startup: " );
+ MU_Startup(false);
if (!quiet)
printf( "%s\n", MUSIC_ErrorString( MUSIC_Error ) );
}
@@ -1088,7 +1089,9 @@
case ex_titles:
BATTLE_Shutdown();
+ SDL_SetRelativeMouseMode(SDL_FALSE);
MU_StartSong(song_title);
+ SDL_SetRelativeMouseMode(SDL_TRUE);
EnableScreenStretch();
if ((NoWait==false)&&(!modemgame))
{
--- a/rott/rt_sound.c
+++ b/rott/rt_sound.c
@@ -906,7 +906,7 @@
/* Not DOS, no address config needed */
status=MUSIC_Init( card, 0 );
-
+
if (status != MUSIC_Ok) {
if (bombonerror)
{
@@ -1094,6 +1094,8 @@
void MU_StartSong ( int songtype )
{
int songnum;
+
+ //printf("%d \n", songtype);
if (MU_Started==false)
return;
@@ -1100,7 +1102,12 @@
MU_StopSong();
+ //songtype++;
+
songnum = MU_GetNumForType ( songtype );
+
+ //printf("%d : %d \n", songtype, songnum);
+
switch (songtype)
{
case song_level:
--- a/rott/rt_util.c
+++ b/rott/rt_util.c
@@ -566,7 +566,7 @@
filename[sizeof (filename) - 1] = '\0';
FixFilePath(filename);
- handle = open(filename,O_RDWR | O_BINARY | O_CREAT | O_APPEND, S_IRUSR | S_IWUSR );
+ handle = open(filename,O_RDWR | O_BINARY | O_CREAT | O_TRUNC, S_IRUSR | S_IWUSR );
//handle = open(filename,O_RDWR | O_BINARY | O_CREAT | O_TRUNC );