summaryrefslogtreecommitdiffstats
path: root/game/client/resource
diff options
context:
space:
mode:
Diffstat (limited to 'game/client/resource')
-rw-r--r--game/client/resource/sound_effect.cc8
-rw-r--r--game/client/resource/texture_gui.cc6
2 files changed, 7 insertions, 7 deletions
diff --git a/game/client/resource/sound_effect.cc b/game/client/resource/sound_effect.cc
index 0d987a5..75d5984 100644
--- a/game/client/resource/sound_effect.cc
+++ b/game/client/resource/sound_effect.cc
@@ -24,9 +24,9 @@ static drwav_bool32 drwav_seek_physfs(void* file, int offset, drwav_seek_origin
}
template<>
-resource_ptr<SoundEffect> resource::load<SoundEffect>(const char* name, unsigned int flags)
+resource_ptr<SoundEffect> resource::load<SoundEffect>(std::string_view name, unsigned int flags)
{
- auto it = resource_map.find(name);
+ auto it = resource_map.find(std::string(name));
if(it != resource_map.cend()) {
// Return an existing resource
@@ -38,7 +38,7 @@ resource_ptr<SoundEffect> resource::load<SoundEffect>(const char* name, unsigned
return nullptr;
}
- auto file = PHYSFS_openRead(name);
+ auto file = PHYSFS_openRead(std::string(name).c_str());
if(file == nullptr) {
spdlog::warn("resource: {} [SoundEffect]: {}", name, PHYSFS_getErrorByCode(PHYSFS_getLastErrorCode()));
@@ -76,7 +76,7 @@ resource_ptr<SoundEffect> resource::load<SoundEffect>(const char* name, unsigned
delete[] samples;
- return resource_map.insert_or_assign(name, new_resource).first->second;
+ return resource_map.insert_or_assign(std::string(name), new_resource).first->second;
}
template<>
diff --git a/game/client/resource/texture_gui.cc b/game/client/resource/texture_gui.cc
index 971e201..415845d 100644
--- a/game/client/resource/texture_gui.cc
+++ b/game/client/resource/texture_gui.cc
@@ -8,9 +8,9 @@
static emhash8::HashMap<std::string, resource_ptr<TextureGUI>> resource_map;
template<>
-resource_ptr<TextureGUI> resource::load<TextureGUI>(const char* name, unsigned int flags)
+resource_ptr<TextureGUI> resource::load<TextureGUI>(std::string_view name, unsigned int flags)
{
- auto it = resource_map.find(name);
+ auto it = resource_map.find(std::string(name));
if(it != resource_map.cend()) {
// Return an existing resource
@@ -67,7 +67,7 @@ resource_ptr<TextureGUI> resource::load<TextureGUI>(const char* name, unsigned i
new_resource->size.x = image->size.x;
new_resource->size.y = image->size.y;
- return resource_map.insert_or_assign(name, new_resource).first->second;
+ return resource_map.insert_or_assign(std::string(name), new_resource).first->second;
}
return nullptr;