Skip to content

Commit 794f136

Browse files
committed
fix: heavylog arg types
1 parent a5e6cd7 commit 794f136

4 files changed

Lines changed: 20 additions & 22 deletions

File tree

linux.mk

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ src/config_objects.c \
7272
src/config_players.c \
7373
src/config_powerhands.c \
7474
src/config_rules.c \
75+
src/config_sounds.c \
7576
src/config_settings.c \
7677
src/config_slabsets.c \
7778
src/config_strings.c \
@@ -182,6 +183,7 @@ src/lua_api_player.c \
182183
src/lua_api_room.c \
183184
src/lua_api_things.c \
184185
src/lua_api_slabs.c \
186+
src/lua_api_sound.c \
185187
src/lua_base.c \
186188
src/lua_cfg_funcs.c \
187189
src/lua_params.c \
@@ -249,6 +251,7 @@ src/roomspace_detection.c \
249251
src/scrcapt.c \
250252
src/slab_data.c \
251253
src/sounds.c \
254+
src/sound_manager.cpp \
252255
src/spdigger_stack.c \
253256
src/spritesheet.cpp \
254257
src/tasks_list.c \

src/creature_control.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ void play_creature_sound(struct Thing *thing, long snd_idx, long priority, long
313313
sample_idx = crsound->index + i; // Regular positive indices
314314
}
315315

316-
SYNCDBG(18,"Playing sample %ld (sound type %ld, index %ld) for creature %d",
316+
SYNCDBG(18,"Playing sample %d (sound type %ld, index %d) for creature %d",
317317
sample_idx, snd_idx, crsound->index, thing->model);
318318

319319
if ( use_flags ) {

src/lua_api_sound.c

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@
1717
*/
1818
/******************************************************************************/
1919
#include "pre_inc.h"
20+
#include <lua.h>
21+
#include <lauxlib.h>
22+
#include <lualib.h>
2023
#include "lua_api_sound.h"
2124
#include "sound_manager.h"
2225
#include "bflib_sound.h"
23-
24-
#ifdef __cplusplus
25-
extern "C" {
26-
#endif
26+
#include "post_inc.h"
2727

2828
/******************************************************************************/
2929
/**
@@ -172,9 +172,8 @@ int lua_PlayMusic(lua_State* L) {
172172
int track = luaL_checkinteger(L, 1);
173173
success = sound_manager_play_music(track);
174174
} else {
175-
// File path
176-
const char* filepath = luaL_checkstring(L, 1);
177-
// TODO: Implement play_music_file() wrapper
175+
// File path - TODO: Implement play_music_file() wrapper
176+
// const char* filepath = luaL_checkstring(L, 1);
178177
// success = sound_manager_play_music_file(filepath);
179178
success = false;
180179
}
@@ -238,8 +237,4 @@ void register_lua_sound_api(lua_State* L) {
238237
lua_pushinteger(L, 1);
239238
lua_setglobal(L, "SOUND_PRIORITY_LOW");
240239
}
241-
242-
#ifdef __cplusplus
243-
}
244-
#endif
245240
/******************************************************************************/

src/sound_manager.cpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -452,43 +452,43 @@ TbBool sound_manager_init(void) {
452452
return KeeperFX::SoundManager::getInstance().initialize();
453453
}
454454

455-
SoundEmitterID sound_manager_minimal_play_effect(SoundSmplTblID sample_id, long priority, SoundVolume volume) {
455+
SoundEmitterID sound_manager_play_effect(SoundSmplTblID sample_id, long priority, SoundVolume volume) {
456456
return KeeperFX::SoundManager::getInstance().playEffect(sample_id, priority, volume);
457457
}
458458

459-
void sound_manager_minimal_play_creature_sound(struct Thing* thing, long sound_type, long priority) {
459+
void sound_manager_play_creature_sound(struct Thing* thing, long sound_type, long priority) {
460460
KeeperFX::SoundManager::getInstance().playCreatureSound(thing, sound_type, priority);
461461
}
462462

463-
void sound_manager_minimal_stop_effect(SoundEmitterID emitter_id) {
463+
void sound_manager_stop_effect(SoundEmitterID emitter_id) {
464464
KeeperFX::SoundManager::getInstance().stopEffect(emitter_id);
465465
}
466466

467-
TbBool sound_manager_minimal_play_music(int track_number) {
467+
TbBool sound_manager_play_music(int track_number) {
468468
return KeeperFX::SoundManager::getInstance().playMusic(track_number);
469469
}
470470

471-
void sound_manager_minimal_stop_music(void) {
471+
void sound_manager_stop_music(void) {
472472
KeeperFX::SoundManager::getInstance().stopMusic();
473473
}
474474

475-
SoundSmplTblID sound_manager_minimal_load_custom_sound(const char* name, const char* filepath) {
475+
SoundSmplTblID sound_manager_load_custom_sound(const char* name, const char* filepath) {
476476
return KeeperFX::SoundManager::getInstance().loadCustomSound(name, filepath);
477477
}
478478

479-
SoundSmplTblID sound_manager_minimal_get_custom_sound_id(const char* name) {
479+
SoundSmplTblID sound_manager_get_custom_sound_id(const char* name) {
480480
return KeeperFX::SoundManager::getInstance().getCustomSoundId(name);
481481
}
482482

483-
TbBool sound_manager_minimal_set_creature_sound(const char* creature_model, const char* sound_type, const char* custom_sound_name) {
483+
TbBool sound_manager_set_creature_sound(const char* creature_model, const char* sound_type, const char* custom_sound_name) {
484484
return KeeperFX::SoundManager::getInstance().setCreatureSound(creature_model, sound_type, custom_sound_name);
485485
}
486486

487-
TbBool sound_manager_minimal_is_custom_sound_loaded(const char* name) {
487+
TbBool sound_manager_is_custom_sound_loaded(const char* name) {
488488
return KeeperFX::SoundManager::getInstance().isCustomSoundLoaded(name);
489489
}
490490

491-
void sound_manager_minimal_print_stats(void) {
491+
void sound_manager_print_stats(void) {
492492
KeeperFX::SoundManager::getInstance().printStats();
493493
}
494494

0 commit comments

Comments
 (0)