aboutsummaryrefslogtreecommitdiff
path: root/headers
diff options
context:
space:
mode:
authorkdx <kikoodx@paranoici.org>2023-03-31 10:08:21 +0200
committerkdx <kikoodx@paranoici.org>2023-03-31 10:08:21 +0200
commite96c359a840974adea4d3d1d3445377f159ecdf0 (patch)
treeac4d65e3154f4fbda48a89c2426af070c0cd56c1 /headers
parent9253907755440731773cc5cf002440998bf2693b (diff)
downloadtzr-e96c359a840974adea4d3d1d3445377f159ecdf0.tar.gz
playsound args
Diffstat (limited to 'headers')
-rw-r--r--headers/TZR_sound.h7
-rw-r--r--headers/TZR_types.h8
2 files changed, 14 insertions, 1 deletions
diff --git a/headers/TZR_sound.h b/headers/TZR_sound.h
index e9677b2..612dfaa 100644
--- a/headers/TZR_sound.h
+++ b/headers/TZR_sound.h
@@ -1,4 +1,9 @@
#pragma once
#include "TZR_types.h"
-int TZR_PlaySound(TZR_Uint id);
+#define TZR_PlaySound(...) _TZR_PlaySound(&(const TZR_PlaySoundArgs){ \
+ .id=0, .loop=0, .volume=1.0f, ._=0, __VA_ARGS__ })
+#ifdef TZR_PARANOID
+[[nodiscard]]
+#endif
+int _TZR_PlaySound(const TZR_PlaySoundArgs *args);
diff --git a/headers/TZR_types.h b/headers/TZR_types.h
index f60b889..ea63f2d 100644
--- a/headers/TZR_types.h
+++ b/headers/TZR_types.h
@@ -37,6 +37,7 @@ typedef enum TZR_EventType TZR_EventType;
typedef struct TZR_Event TZR_Event;
typedef struct TZR_DrawImageArgs TZR_DrawImageArgs;
typedef struct TZR_DrawRectangleArgs TZR_DrawRectangleArgs;
+typedef struct TZR_PlaySoundArgs TZR_PlaySoundArgs;
typedef enum TZR_KeyState TZR_KeyState;
struct TZR_Config {
@@ -123,3 +124,10 @@ struct TZR_DrawRectangleArgs {
bool fill;
bool center;
};
+
+struct TZR_PlaySoundArgs {
+ int _;
+ int id;
+ int loop;
+ float volume;
+};