mirror of
https://github.com/diasurgical/DevilutionX.git
synced 2026-10-12 02:13:06 +00:00
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]>
17 lines
402 B
C++
17 lines
402 B
C++
#include "parse_sfx_id.hpp"
|
|
|
|
#include <magic_enum/magic_enum.hpp>
|
|
|
|
namespace devilution {
|
|
|
|
std::expected<SfxID, std::string> ParseSfxId(std::string_view value)
|
|
{
|
|
const std::optional<SfxID> enumValueOpt = magic_enum::enum_cast<SfxID>(value);
|
|
if (enumValueOpt.has_value()) {
|
|
return enumValueOpt.value();
|
|
}
|
|
return std::unexpected("Unknown enum value.");
|
|
}
|
|
|
|
} // namespace devilution
|