Skip to content

Commit

Permalink
fix sound effects filename case, fpc 0.3.1
Browse files Browse the repository at this point in the history
  • Loading branch information
mnalis committed Dec 8, 2020
1 parent 125d5e3 commit 4f78dee
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 19 deletions.
2 changes: 2 additions & 0 deletions Documents/changelog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
v 0.3.1
- fix sound effects filename case
v 0.3.0
- 32-bit compilation fixes (now works on i386 too)
- document location of manual in manpage
Expand Down
7 changes: 1 addition & 6 deletions c_utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -1003,7 +1003,7 @@ void play_sound(const fpc_pchar_t filename, const fpc_word_t rate)
int8_t *sound_raw, chan;
float k;
int16_t *sound, smp;
char *fn, *s, *s1;
char *fn, *s1;

if (!audio_open)
return;
Expand All @@ -1012,11 +1012,6 @@ void play_sound(const fpc_pchar_t filename, const fpc_word_t rate)
assert(fn != NULL);
s1 = strdup(filename);
assert(s1 != NULL);
s = s1;
while (*s) {
*s = (char) toupper(*s); // toupper(3) works with int, but only defined on char
s++;
}
strcpy(fn, s1);
f = fopen(fn, "rb");
if (f == NULL) {
Expand Down
20 changes: 10 additions & 10 deletions combat.pas
Original file line number Diff line number Diff line change
Expand Up @@ -227,15 +227,15 @@ procedure firingweapon(n: integer);
begin
c:=ship.gunnodes[n]; // c = our current weapon index
case weapons[c].dmgtypes[DMGTYP_ENERGY] of
0..23: if weapons[c].dmgtypes[DMGTYP_PARTICLE]>weapons[c].dmgtypes[DMGTYP_INERTIAL] then soundeffect(loc_sound()+'gun4.sam',7000)
else soundeffect(loc_sound()+'gun1.sam',7000);
24..34: soundeffect(loc_sound()+'laser1.sam',7000);
35..45: soundeffect(loc_sound()+'laser2.sam',7000);
46..56: soundeffect(loc_sound()+'laser3.sam',7000);
57..67: soundeffect(loc_sound()+'laser4.sam',7000);
68..78: soundeffect(loc_sound()+'laser5.sam',7000);
79..89: soundeffect(loc_sound()+'laser6.sam',7000);
90..100: soundeffect(loc_sound()+'laser7.sam',7000);
0..23: if weapons[c].dmgtypes[DMGTYP_PARTICLE]>weapons[c].dmgtypes[DMGTYP_INERTIAL] then soundeffect(loc_sound()+'GUN4.SAM',7000)
else soundeffect(loc_sound()+'GUN1.SAM',7000);
24..34: soundeffect(loc_sound()+'LASER1.SAM',7000);
35..45: soundeffect(loc_sound()+'LASER2.SAM',7000);
46..56: soundeffect(loc_sound()+'LASER3.SAM',7000);
57..67: soundeffect(loc_sound()+'LASER4.SAM',7000);
68..78: soundeffect(loc_sound()+'LASER5.SAM',7000);
79..89: soundeffect(loc_sound()+'LASER6.SAM',7000);
90..100: soundeffect(loc_sound()+'LASER7.SAM',7000);
end;
delay(tslice);
{if (skillcheck(4)) or ((scanning) and (random(100)<20)) then}
Expand Down Expand Up @@ -610,7 +610,7 @@ procedure takedamage(n,d: integer);
begin
//writeln (' takedamage(type=',n,', damage=', d, ')');
if dead then exit;
soundeffect(loc_sound()+'explode'+chr(49+random(2))+'.sam',9000);
soundeffect(loc_sound()+'EXPLODE'+chr(49+random(2))+'.SAM',9000);
delay(tslice div 2);
if d<1 then d:=1;
case n of
Expand Down
2 changes: 1 addition & 1 deletion version.pas
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,5 @@ implementation
begin
versionstring :=
{12345678901234567890}
'v1.30.0001 fpc 0.3.0';
'v1.30.0001 fpc 0.3.1';
end.
4 changes: 2 additions & 2 deletions weird.pas
Original file line number Diff line number Diff line change
Expand Up @@ -840,11 +840,11 @@ procedure easteregg6;
fading;
mousehide;
loadscreen(loc_data()+'intro3',@screen);
soundeffect(loc_sound()+'explode3.sam',9500);
soundeffect(loc_sound()+'EXPLODE3.SAM',9500);
fadein;
mouseshow;
repeat
if mouse.getstatus then soundeffect(loc_sound()+'explode3.sam',9500);
if mouse.getstatus then soundeffect(loc_sound()+'EXPLODE3.SAM',9500);
until fastkeypressed;
stopmod;
fading;
Expand Down

0 comments on commit 4f78dee

Please sign in to comment.