Skip to content

Commit

Permalink
2007-08-16 Will Glynn <[email protected]>
Browse files Browse the repository at this point in the history
	* V182
	* music.h, music_vorbis.c, music_osx.c: Added music_set_mute()
	* prefs.c: calls music_set_mute() on mute change, rather than toggling the channel
	directly
	* V181
	* configure.in: bump to 0.4.6
	* music.h: replaced music API. music_start(track), music_stop() are the key calls.
	No more preloading; computers are fast these days, and one call is cleaner than two.
	* music.c: removed
	* music_vorbis.c: plays Vorbis via SDL like music.c did, but with the new API, and
	cleaner internals
	* music_osx.c: CoreMIDI implementation of common music API
	* sdl.c: now calls music_pump() in av_sync()
	* Makefile.in: reflects change from music to music_vorbis
	* os_macosx/: reflects change from music to music_osx, bundles race-data/midi/, and
	builds .dmg files with the build number in the filename (e.g. 0.4.6.181.dmg)
	* introd.c, main.c: M_LIFTOFF now plays on game start or return to main menu
	* others: updated to use the new music API
  • Loading branch information
delta407 committed Aug 17, 2007
1 parent c8057d3 commit 2f3e20f
Show file tree
Hide file tree
Showing 36 changed files with 838 additions and 367 deletions.
36 changes: 35 additions & 1 deletion ChangeLog
Original file line number Diff line number Diff line change
@@ -1,4 +1,38 @@
2007-08-09 Will Glynn <[email protected]>
2007-08-16 Will Glynn <[email protected]>

* V182

* music.h, music_vorbis.c, music_osx.c: Added music_set_mute()

* prefs.c: calls music_set_mute() on mute change, rather than toggling the channel
directly

* V181

* configure.in: bump to 0.4.6

* music.h: replaced music API. music_start(track), music_stop() are the key calls.
No more preloading; computers are fast these days, and one call is cleaner than two.

* music.c: removed

* music_vorbis.c: plays Vorbis via SDL like music.c did, but with the new API, and
cleaner internals

* music_osx.c: CoreMIDI implementation of common music API

* sdl.c: now calls music_pump() in av_sync()

* Makefile.in: reflects change from music to music_vorbis

* os_macosx/: reflects change from music to music_osx, bundles race-data/midi/, and
builds .dmg files with the build number in the filename (e.g. 0.4.6.181.dmg)

* introd.c, main.c: M_LIFTOFF now plays on game start or return to main menu

* others: updated to use the new music API

2007-08-15 Will Glynn <[email protected]>

* V180

Expand Down
2 changes: 1 addition & 1 deletion Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ BARIS_OBJS = $(addsuffix .@OBJEXT@, \
admin aimast aimis aipur ast0 ast1 ast2 ast3 ast4 budget crew endgame \
endianness futbub future hardef intel intro main mc2 mc mis_c mis_m museum \
newmis news news_sup news_suq place port prefs prest radar rdplex records \
replay review rush start vab pace gx gr sdl music gamedata mmfile options fs \
replay review rush start vab pace gx gr sdl music_vorbis gamedata mmfile options fs \
utils logging log4c log_default \
)

Expand Down
25 changes: 11 additions & 14 deletions admin.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ void Admin(char plr)
i=0;beg=1;

do {
PreLoadMusic(M_GOOD);
if (beg) beg=0;
else {

Expand All @@ -81,41 +80,39 @@ void Admin(char plr)
FadeIn(2,pal,10,0,0);
}

PlayMusic(0);
music_start(M_GOOD);

strncpy(IDT,(plr==0) ?"i702":"i703",4);
strncpy(IKEY,(plr==0) ? "k601":"k602",4);

i=BChoice(plr,7,(char *)AName,(char *) AImg);

switch(i) {
case 1: KillMusic();
PreLoadMusic(M_DRUMSM);
PlayMusic(0);
case 1: music_stop();
music_start(M_DRUMSM);
strcpy(IDT,"i007");strcpy(IKEY,"k007");
Budget(plr);key=0;
KillMusic();
music_stop();
break;

case 2: KillMusic();
case 2: music_stop();
strcpy(IDT,"i008");
HPurc(plr);key=0;
break;

case 3: strcpy(IDT,"i010");strcpy(IKEY,"k010");
KillMusic();
PreLoadMusic(M_MISSPLAN);
PlayMusic(0);
music_stop();
music_start(M_MISSPLAN);
Future(plr);
KillMusic();key=0;
music_stop();key=0;
break;

case 4: KillMusic();
case 4: music_stop();
strcpy(IDT,"i012");strcpy(IKEY,"k012");
AstSel(plr);key=0;
break;

case 5: KillMusic();
case 5: music_stop();
strcpy(IDT,"i013");strcpy(IKEY,"k013");
Prefs(1);key=0;
break;
Expand All @@ -133,7 +130,7 @@ void Admin(char plr)
} while (!(i==7 || (i==6 && (QUIT || LOAD)) ));

remove_savedat("PORT.TMP"); // remove temp file
KillMusic();
music_stop();
strcpy(IDT,"i000");strcpy(IKEY,"k000");
WaitForMouseUp();
}
Expand Down
17 changes: 7 additions & 10 deletions ast0.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ void Moon(char plr)
FILE *in;
GXHEADER local;
long size;
PreLoadMusic(M_HISTORY);
strcpy(IDT,"i029");strcpy(IKEY,"k029");
val=Data->P[plr].Misc[5].Safety;
FadeOut(2,pal,0,0,0);
Expand Down Expand Up @@ -73,7 +72,7 @@ void Moon(char plr)
grSetColor(1);PrintAt(144,159,"CONTINUE");
FlagSm(plr,114,43);

PlayMusic(0);
music_start(M_HISTORY);
FadeIn(2,pal,0,0,0);
WaitForMouseUp();
while (1)
Expand All @@ -83,7 +82,7 @@ void Moon(char plr)
InBox(115,152,216,162);
WaitForMouseUp();
if (key>0) delay(150);
KillMusic();
music_stop();
key=0;return; // Continue
}
}
Expand Down Expand Up @@ -393,8 +392,7 @@ void LMPict(char poff)

void LMBld(char plr)
{
int i,m;
PreLoadMusic(M_DRUMSM);
int i,m;
LMDraw(plr);

ShBox(1,120,157,168);InBox(4,122,154,166);
Expand All @@ -418,7 +416,7 @@ void LMBld(char plr)
grSetColor(6);PrintAt(m,162,"SUCCESSFUL ATTEMPTS: ");grSetColor(1);DispNum(0,0,Data->P[plr].Manned[5+i].Steps-Data->P[plr].Manned[5+i].Failures);
}

PlayMusic(0);
music_start(M_HISTORY);
FadeIn(2,pal,0,0,0);
WaitForMouseUp();
while (1)
Expand All @@ -428,7 +426,7 @@ void LMBld(char plr)
InBox(245,5,314,17);
WaitForMouseUp();
if (key>0) delay(150);
KillMusic();
music_stop();
key=0;return; // Continue
}
}
Expand All @@ -438,12 +436,11 @@ void SatBld(char plr)
{
int plan;
plan=0;
PreLoadMusic(M_HISTORY);
SatDraw(plr);
SatText(plr);
strcpy(IDT,"i019");strcpy(IKEY,"k019");
if (Data->P[plr].Probe[1].Num>=0) PlanText(plr,plan);
PlayMusic(0);
music_start(M_HISTORY);
FadeIn(2,pal,0,0,0);

key=0;
Expand All @@ -456,7 +453,7 @@ void SatBld(char plr)
WaitForMouseUp();
if (key>0) delay(150);
// OutBox(245,5,314,17);
KillMusic();
music_stop();
key=0;return; // Continue
}
else if (Data->P[plr].Probe[1].Num>=0 && ((x>=166 && y>=60 && x<=199 && y<=66 && mousebuttons>0) || key==LT_ARROW)) {
Expand Down
7 changes: 3 additions & 4 deletions ast1.c
Original file line number Diff line number Diff line change
Expand Up @@ -229,8 +229,7 @@ void AstSel(char plr)
char i,j,k,BarA,BarB,MaxMen,Index,now,now2,max,min,count,fem=0,ksel=0;
FILE *fin;
i=j=k=BarA=BarB=MaxMen=Index=now=now2=max=min=count=0;
PreLoadMusic(M_DRUMSM);
PlayMusic(0);
music_start(M_DRUMSM);
DrawAstCheck(plr);
WaitForMouseUp();
i=0;
Expand Down Expand Up @@ -258,7 +257,7 @@ DrawAstCheck(plr);
i=2;OutBox(168,135,216,147);
}
};
if (i==2) {KillMusic();return;} /* too poor for astronauts or NO */
if (i==2) {music_stop();return;} /* too poor for astronauts or NO */
BarA=0;BarB=0;
DrawAstSel(plr);

Expand Down Expand Up @@ -654,7 +653,7 @@ DrawAstCheck(plr);
case 5: Data->P[plr].AstroDelay=99;break;
};
OutBox(245,5,314,17);
KillMusic();
music_stop();
return; /* Done */
};
};
Expand Down
15 changes: 6 additions & 9 deletions ast2.c
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,8 @@ void Limbo(char plr)
{
int i,M[100],BarA,count,now2,tag=0;
memset(M,-1,sizeof M);
PreLoadMusic((plr==0)?M_ASTTRNG:M_ASSEMBLY);
DrawLimbo(plr);
PlayMusic(0);
music_start((plr==0)?M_ASTTRNG:M_ASSEMBLY);

now2=BarA=count=0;
ShBox(26,130+BarA*8,152,138+BarA*8);
Expand Down Expand Up @@ -258,7 +257,7 @@ void Limbo(char plr)
WaitForMouseUp();
if (key>0) delay(150);
OutBox(245,5,314,17);
KillMusic();
music_stop();
return;
};

Expand Down Expand Up @@ -318,11 +317,10 @@ void Limbo(char plr)
if (key>0) delay(140);
WaitForMouseUp();key=0;
OutBox(167,95+21*i,236,109+21*i);
KillMusic();
music_stop();
Programs(plr,i+1);
PreLoadMusic((plr==0)?M_ASTTRNG:M_ASSEMBLY);
DrawLimbo(plr);
PlayMusic(0);
music_start((plr==0)?M_ASTTRNG:M_ASSEMBLY);

InBox(241,48,313,65);OutBox(167,48,239,65);
RectFill(166,78,314,88,10);
Expand Down Expand Up @@ -379,11 +377,10 @@ void Limbo(char plr)
if (key>0) delay(140);
WaitForMouseUp();key=0;
OutBox(244,95+21*i,313,109+21*i);
KillMusic();
music_stop();
Train(plr,i+1);
PreLoadMusic((plr==0)?M_ASTTRNG:M_ASSEMBLY);
DrawLimbo(plr);
PlayMusic(0);
music_start((plr==0)?M_ASTTRNG:M_ASSEMBLY);

RectFill(166,78,314,88,10);
grSetColor(11);PrintAt(203,85,"VISIT LOCATION");
Expand Down
24 changes: 13 additions & 11 deletions ast3.c
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,6 @@ void Train(char plr,int level)
int now2,BarA,count,i,M[100];
char temp,Train[10];
static int m=1;
if (level==0) PreLoadMusic((plr==0)?M_ASTTRNG:M_ASSEMBLY);
else PreLoadMusic((plr==0)?M_DRUMSM:M_DRUMSM);
for (i=0;i<100;i++) M[i]=-1;
now2=BarA=count=0;
DrawTrain(plr,level);
Expand All @@ -184,8 +182,13 @@ void Train(char plr,int level)
level=m;
}
memset(Train,0x00,sizeof(Train));
PlayMusic(0);
switch(level) {

if (level==0)
music_start((plr==0)?M_ASTTRNG:M_ASSEMBLY);
else
music_start(M_DRUMSM);

switch(level) {
case 1:strcpy(Train,(plr==0)?"UTCP":"STCP");
Replay(plr,0,4,28,149,82,Train);break;
case 2:strcpy(Train,(plr==0)?"UTLM":"STLM");
Expand Down Expand Up @@ -374,7 +377,7 @@ void Train(char plr,int level)
WaitForMouseUp();
if (key>0) delay(150);
OutBox(245,5,314,17);
KillMusic();
music_stop();
return; /* Done */
}; /* end x-y if */
} /* end mouse if */
Expand Down Expand Up @@ -450,12 +453,12 @@ void Hospital(char plr,int sel)

grSetColor(1);
if (plr==0) {
if (sel==0) {DispBig(40,5,"US HOSPITAL",0,-1);PreLoadMusic(M_BADNEWS);}
else {DispBig(37,5,"ARLINGTON CEMETERY",0,-1);PreLoadMusic(M_USFUN);}
if (sel==0) {DispBig(40,5,"US HOSPITAL",0,-1);music_start(M_BADNEWS);}
else {DispBig(37,5,"ARLINGTON CEMETERY",0,-1);music_start(M_USFUN);}
};
if (plr==1) {
if (sel==0) {DispBig(40,5,"SOVIET INFIRMARY",0,-1);PreLoadMusic(M_INTERLUD);}
else {DispBig(40,5,"KREMLIN WALL",0,-1);PreLoadMusic(M_SVFUN);}
if (sel==0) {DispBig(40,5,"SOVIET INFIRMARY",0,-1);music_start(M_INTERLUD);}
else {DispBig(40,5,"KREMLIN WALL",0,-1);music_start(M_SVFUN);}
}
grSetColor(1);
PrintAt(257,13,"CONTINUE");
Expand All @@ -472,7 +475,6 @@ void Hospital(char plr,int sel)
};
DispLeft(plr,BarA,count,now2,&M[0]);
FadeIn(2,pal,10,0,0);
PlayMusic(0);
WaitForMouseUp();
while (1)
{
Expand Down Expand Up @@ -536,7 +538,7 @@ void Hospital(char plr,int sel)
{
InBox(245,5,314,17);
WaitForMouseUp();
KillMusic();
music_stop();
return; /* Done */
}; /* end x-y if */
}; /* end while */
Expand Down
7 changes: 3 additions & 4 deletions ast4.c
Original file line number Diff line number Diff line change
Expand Up @@ -459,13 +459,12 @@ void Programs(char plr,char prog)
char ksel=0;
strcpy(IDT,"i036");strcpy(IKEY,"k036");

PreLoadMusic(M_PRGMTRG);
for (i=0;i<100;i++) M[i]=-1;
max=prog;
if (max>4) max=4;
if (prog==4) max=3;
now2=0;BarA=count=grp=0;
PlayMusic(0);
music_start(M_PRGMTRG);
DrawProgs(plr,prog);
Flts(0,0);
for (i=0;i<8;i++) {
Expand All @@ -487,7 +486,7 @@ void Programs(char plr,char prog)
FadeIn(2,pal,10,0,0);
chk=CheckProgram(plr,prog);

if (chk==0) {if (plr==0) Help("i113");else Help("i114");KillMusic();return;}
if (chk==0) {if (plr==0) Help("i113");else Help("i114");music_stop();return;}
WaitForMouseUp();
while (1)
{
Expand Down Expand Up @@ -868,7 +867,7 @@ void Programs(char plr,char prog)
for(i=0;i<count;i++) {
Data->P[plr].Pool[M[i]].Assign=0;
};
KillMusic();
music_stop();
return; /* Done */
};
}
Expand Down
5 changes: 2 additions & 3 deletions budget.c
Original file line number Diff line number Diff line change
Expand Up @@ -489,15 +489,14 @@ int RetFile(char plr,int card)
void Viewing(char plr)
{
int ctop,bline=0,oset,maxcard;
PreLoadMusic(M_SOVTYP);
DrawViewing(plr);
maxcard=oset=Data->P[plr].eCount-1;
bline=RetFile(plr,oset);
ctop=0;
DrawVText(ctop);
InBox(244,184,313,194);
FadeIn(2,pal,10,0,0);
PlayMusic(0);
music_start(M_SOVTYP);
WaitForMouseUp();
while (1)
{
Expand Down Expand Up @@ -555,7 +554,7 @@ void Viewing(char plr)
InBox(245,5,314,17);
if (key>0) delay(150);
//OutBox(245,5,314,17);
KillMusic();
music_stop();
return; // Continue
};
}
Expand Down
Loading

0 comments on commit 2f3e20f

Please sign in to comment.