Button sound effect (#312)

* Removed magic number for CARD_FOCUS_SFX_PITCH_OFFSET_RANGE
This commit is contained in:
MeirGavish
2025-12-13 16:10:15 +02:00
committed by GitHub
parent 8a9750b0b3
commit 81e6b7ab31
6 changed files with 77 additions and 31 deletions
+4 -1
View File
@@ -42,10 +42,13 @@
/**
* @brief Play a sound effect, wrapper for mmEffectEx()
* See https://maxmod.org/ref/functions/mm_sound_effect.html
* and https://maxmod.org/ref/functions/mmEffectEx.html
*
* @param id the sound id to play, from maxmod compiled soundbank.h header
* @param rate the pitch rate, the default value is @ref MM_BASE_PTCH_RATE
* @param volume the volume ranging from 0 (silent) to 255 (loudest)
*/
void play_sfx(mm_word id, mm_word rate);
void play_sfx(mm_word id, mm_word rate, mm_byte volume);
#endif
+6 -5
View File
@@ -4,11 +4,12 @@
#include <maxmod.h>
#include <tonc.h>
#define CARD_SPRITE_SIZE 32
#define MAX_AFFINES 32
#define MAX_SPRITES 128
#define MAX_SPRITE_OBJECTS 16
#define SPRITE_FOCUS_RAISE_PX 10
#define CARD_SPRITE_SIZE 32
#define MAX_AFFINES 32
#define MAX_SPRITES 128
#define MAX_SPRITE_OBJECTS 16
#define SPRITE_FOCUS_RAISE_PX 10
#define CARD_FOCUS_SFX_PITCH_OFFSET_RANGE 512
typedef struct
{