Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom campaign sound #3676

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,7 @@ obj/roomspace.o \
obj/roomspace_detection.o \
obj/scrcapt.o \
obj/slab_data.o \
obj/soundbanks.o \
obj/sounds.o \
obj/spdigger_stack.o \
obj/steam_api.o \
Expand Down
8 changes: 4 additions & 4 deletions src/bflib_guibtns.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

#include <string.h>
#include <stdio.h>

#include "samples.h"
#include "bflib_basics.h"
#include "bflib_memory.h"
#include "globals.h"
Expand Down Expand Up @@ -63,15 +63,15 @@ TbBool check_if_pos_is_over_button(const struct GuiButton *gbtn, TbScreenPos pos

void do_sound_menu_click(void)
{
play_non_3d_sample_no_overlap(61);
play_non_3d_sample_no_overlap(Smpl_0061);
}

void do_sound_button_click(struct GuiButton *gbtn)
{
if (gbtn->gbtype == LbBtnT_RadioBtn)
play_non_3d_sample(60);
play_non_3d_sample(Smpl_0060);
else
play_non_3d_sample(61);
play_non_3d_sample(Smpl_0061);
}

void setup_input_field(struct GuiButton *gbtn, const char * empty_text)
Expand Down
4 changes: 2 additions & 2 deletions src/bflib_network.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
/******************************************************************************/
#include "pre_inc.h"
#include "bflib_network.h"

#include "samples.h"
#include "bflib_basics.h"
#include "bflib_enet.h"
#include "bflib_datetm.h"
Expand Down Expand Up @@ -368,7 +368,7 @@ static void HandleLoginRequest(NetUserId source, char * ptr, char * end)
//presume login successful from here
NETMSG("User %s successfully logged in", netstate.users[source].name);
netstate.users[source].progress = USER_LOGGEDIN;
play_non_3d_sample(76);
play_non_3d_sample(Smpl_0076);

//send reply
ptr = netstate.msg_buffer;
Expand Down
12 changes: 6 additions & 6 deletions src/bflib_sndlib.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ extern "C"
typedef int(WINAPI *FARPROCP)(const void *);
typedef int(WINAPI *FARPROCSIII)(const char *, int, int, int);
typedef int(WINAPI *FARPROCIIII)(int, int, int, int);
typedef struct SampleInfo *(WINAPI *FARPROC_PLAY1)(int, int, int, int, int, unsigned char, unsigned char, void *, int);
typedef struct SampleInfo *(WINAPI *FARPROC_PLAY1)(int, int, int, int, int, unsigned char, unsigned char, const void *, int);

HMODULE WSND7R;

Expand Down Expand Up @@ -403,39 +403,39 @@ extern "C"
return 0;
}

void StopSample(SoundEmitterID emit_id, SoundSmplTblID smptbl_id)
void StopSample(SoundEmitterID emit_id, SoundSmplID smptbl_id)
{
if (_StopSample != NULL)
{
((FARPROCII)_StopSample)(emit_id, smptbl_id);
}
}

void SetSampleVolume(SoundEmitterID emit_id, SoundSmplTblID smptbl_id, SoundVolume volume)
void SetSampleVolume(SoundEmitterID emit_id, SoundSmplID smptbl_id, SoundVolume volume)
{
if (_SetSampleVolume != NULL)
{
((FARPROCIIII)_SetSampleVolume)(emit_id, smptbl_id, volume, 0);
}
}

void SetSamplePan(SoundEmitterID emit_id, SoundSmplTblID smptbl_id, SoundPan pan)
void SetSamplePan(SoundEmitterID emit_id, SoundSmplID smptbl_id, SoundPan pan)
{
if (_SetSamplePan != NULL)
{
((FARPROCIIII)_SetSamplePan)(emit_id, smptbl_id, pan, 0);
}
}

void SetSamplePitch(SoundEmitterID emit_id, SoundSmplTblID smptbl_id, SoundPitch pitch)
void SetSamplePitch(SoundEmitterID emit_id, SoundSmplID smptbl_id, SoundPitch pitch)
{
if (_SetSamplePitch != NULL)
{
((FARPROCIIII)_SetSamplePitch)(emit_id, smptbl_id, pitch, 0);
}
}

struct SampleInfo *PlaySampleFromAddress(SoundEmitterID emit_id, SoundSmplTblID smpl_idx, SoundVolume volume, SoundPan pan, SoundPitch pitch, unsigned char a6, unsigned char a7, void *buf, SoundSFXID sfxid)
struct SampleInfo *PlaySampleFromAddress(SoundEmitterID emit_id, SoundSmplID smpl_idx, SoundVolume volume, SoundPan pan, SoundPitch pitch, unsigned char a6, unsigned char a7, const void *buf, SoundSFXID sfxid)
{
if (_PlaySampleFromAddress != NULL)
{
Expand Down
12 changes: 6 additions & 6 deletions src/bflib_sndlib.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ struct SampleInfo { // sizeof = 29
unsigned char field_4[4];
unsigned char field_8;
unsigned char field_9[9];
SoundSmplTblID smptbl_id;
SoundSmplID smptbl_id;
unsigned char field_14[3];
unsigned char flags_17;
unsigned long field_18;
Expand Down Expand Up @@ -74,11 +74,11 @@ void SetupAudioOptionDefaults(struct SoundSettings *);
TbBool IsSamplePlaying(SoundMilesID);
struct SampleInfo * GetLastSampleInfoStructure(void);
SoundVolume GetCurrentSoundMasterVolume(void);
void StopSample(SoundEmitterID, SoundSmplTblID);
void SetSampleVolume(SoundEmitterID, SoundSmplTblID, SoundVolume);
void SetSamplePan(SoundEmitterID, SoundSmplTblID, SoundPan);
void SetSamplePitch(SoundEmitterID, SoundSmplTblID, SoundPitch);
struct SampleInfo * PlaySampleFromAddress(SoundEmitterID, SoundSmplTblID, SoundVolume, SoundPan, SoundPitch, unsigned char a6, unsigned char a7, void * buf, SoundSFXID);
void StopSample(SoundEmitterID, SoundSmplID);
void SetSampleVolume(SoundEmitterID, SoundSmplID, SoundVolume);
void SetSamplePan(SoundEmitterID, SoundSmplID, SoundPan);
void SetSamplePitch(SoundEmitterID, SoundSmplID, SoundPitch);
struct SampleInfo * PlaySampleFromAddress(SoundEmitterID, SoundSmplID, SoundVolume, SoundPan, SoundPitch, unsigned char a6, unsigned char a7, const void * buf, SoundSFXID);
/******************************************************************************/
#ifdef __cplusplus
}
Expand Down
Loading