Files
DevilutionX/Source/effects_stubs.cpp
Gleb MazovetskiyandClaude Sonnet 4.6 53b91fd7a2 Untangle more dependencies
Split several monolithic files to reduce transitive dependencies and
enable the dun_render_benchmark to link without bringing in all of
DevilutionX:

- Extract dungeon tile globals and loading functions from `gendung` into
  `dun_tile_data.{hpp,cpp}`
- Extract light table data and MakeLightTable from lighting into
  `engine/light_tables.{hpp,cpp}`
- Move cursor_id and SelectionRegion to cursor_defs.hpp
- Extract quest log rendering to `panels/quest_log.{hpp,cpp}`
- Extract drlg quest setpiece logic to `levels/drlg_quests.{hpp,cpp}`
- Extract quest data loading to `tables/questdat.{hpp,cpp}`
- Move `GameData` and `gbIsMultiplayer` into `game_mode.{hpp,cpp}`
- Add `parse_sfx_id.{hpp,cpp}`
- Update CMake libraries accordingly

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
2026-08-23 06:08:15 +01:00

62 lines
1.4 KiB
C++

// Stubbed implementations of effects for the NOSOUND mode.
#include "effects.h"
#include <expected>
#include <magic_enum/magic_enum.hpp>
#include "engine/random.hpp"
namespace devilution {
int sfxdelay;
SfxID sfxdnum;
bool effect_is_playing(SfxID nSFX) { return false; }
void stream_stop() { }
void PlaySFX(SfxID psfx)
{
switch (psfx) {
case SfxID::Warrior69:
case SfxID::Sorceror69:
case SfxID::Rogue69:
case SfxID::Monk69:
case SfxID::Swing:
case SfxID::SpellAcid:
case SfxID::OperateShrine:
case SfxID::Warrior14:
case SfxID::Warrior15:
case SfxID::Warrior16:
case SfxID::Warrior2:
case SfxID::Rogue14:
case SfxID::Sorceror14:
case SfxID::Monk14:
AdvanceRndSeed();
break;
default:
break;
}
}
void PlaySfxLoc(SfxID psfx, Point position, bool randomizeByCategory)
{
if (!randomizeByCategory)
return;
PlaySFX(psfx);
}
void sound_stop() { }
void sound_update() { }
void effects_cleanup_sfx(bool fullUnload) { }
void sound_init() { }
void ui_sound_init() { }
void effects_play_sound(SfxID id) { }
int GetSFXLength(SfxID nSFX) { return 0; }
std::expected<HeroSpeech, std::string> ParseHeroSpeech(std::string_view value)
{
const std::optional<HeroSpeech> enumValueOpt = magic_enum::enum_cast<HeroSpeech>(value);
if (enumValueOpt.has_value()) {
return enumValueOpt.value();
}
return std::unexpected("Unknown enum value.");
}
} // namespace devilution