Skip to content

Commit

Permalink
Map most N3D sounds #712
Browse files Browse the repository at this point in the history
  • Loading branch information
cxong committed Mar 27, 2024
1 parent 63ace03 commit bf32455
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/cdogs/cwolfmap/n3d.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ char *CWN3DLoadLanguageEnu(const char *path)
goto bail;
}
zip_entry_open(zip, "language.enu");
const size_t bufsize = zip_entry_size(zip);
const size_t bufsize = (size_t)zip_entry_size(zip);
buf = malloc(bufsize);
zip_entry_noallocread(zip, (void *)buf, bufsize);

Expand Down
23 changes: 22 additions & 1 deletion src/cdogs/map_wolf.c
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,22 @@ static const char *soundsSOD[] = {
"chars/die/trans", "chars/alert/bill", "chars/die/bill",
"chars/die/ubermutant", "chars/alert/knight", "chars/die/knight",
"chars/alert/angel", "chars/die/angel", "chaingun_pickup", "spear"};
// TODO BS6:
// TODO: map unknown sounds
static const char *soundsN3D[] = {
// 0-9
"chars/alert/antelope", "somesortofooohsound?", "bullet_pickup", "oooh?",
"door_close", "cantaloupe", "cantaloupe_feeder", "goat_kick", "gulp?",
"chars/die/animal",
// 10-19
"chars/alert/elephant", "1up", "super_feeder", "chars/alert/giraffe",
"chars/alert/goat", "small_feeder", "doof?", "chars/alert/kangaroo",
"whistle", "hand_feed",
// 20-29
"chars/alert/monkey", "chars/alert/bear", "door", "chars/alert/ostrich",
"chars/alert/ox", "hurt", "dundundun?", "secret_door", "chars/alert/sheep",
"large_feeder",
// 30-32
"spit", "watermelon", "watermelon_feeder"}; // TODO BS6:
// https://github.com/bibendovsky/bstone/blob/3dea1ef72a101519afd17aa95c881da40a18040d/src/bstone_audio_content_mgr.cpp#L320-L398
static const char *GetSound(const CWMapType type, const int i)
{
Expand All @@ -175,6 +190,9 @@ static const char *GetSound(const CWMapType type, const int i)
return soundsW6[i];
case CWMAPTYPE_SOD:
return soundsSOD[i];
case CWMAPTYPE_N3D:
return soundsN3D[i];
break;
default:
CASSERT(false, "unknown map type");
return NULL;
Expand Down Expand Up @@ -435,6 +453,9 @@ static const char *GetAdlibSound(const CWMapType type, const int i)
return adlibSoundsW6[i];
case CWMAPTYPE_SOD:
return adlibSoundsSOD[i];
case CWMAPTYPE_N3D:
// N3D has no adlib sounds
return NULL;
default:
CASSERT(false, "unknown map type");
return NULL;
Expand Down

0 comments on commit bf32455

Please sign in to comment.