From 9fa48aa4ec880784c713c33792a5675b85c73b58 Mon Sep 17 00:00:00 2001 From: Xottab-DUTY Date: Mon, 13 Nov 2017 18:35:08 +0500 Subject: [PATCH] Replace shared_str operator* by c_str() for xrEngine, xrNetServer and xrSound --- src/xrEngine/Environment.cpp | 4 ++-- src/xrEngine/Environment_misc.cpp | 4 ++-- src/xrEngine/FDemoRecord.cpp | 4 ++-- src/xrEngine/GameMtlLib.cpp | 2 +- src/xrEngine/GameMtlLib_Engine.cpp | 20 ++++++++-------- src/xrEngine/ISheduled.cpp | 4 ++-- src/xrEngine/ObjectAnimator.h | 2 +- src/xrEngine/editor_environment_manager.cpp | 2 +- ...itor_environment_thunderbolts_gradient.cpp | 6 ++--- src/xrEngine/thunderbolt.cpp | 4 ++-- src/xrEngine/xrSheduler.cpp | 2 +- src/xrEngine/xr_collide_form.cpp | 2 +- src/xrEngine/xr_efflensflare.cpp | 8 +++---- src/xrEngine/xr_object_list.cpp | 24 +++++++++---------- src/xrNetServer/NET_Client.cpp | 2 +- src/xrNetServer/NET_Client.h | 2 +- .../SoundRender_Core_SourceManager.cpp | 2 +- src/xrSound/SoundRender_Environment.cpp | 6 ++--- src/xrSound/SoundRender_Source.h | 2 +- 19 files changed, 51 insertions(+), 51 deletions(-) diff --git a/src/xrEngine/Environment.cpp b/src/xrEngine/Environment.cpp index 5f2c666506a..c6520f15ebb 100644 --- a/src/xrEngine/Environment.cpp +++ b/src/xrEngine/Environment.cpp @@ -227,7 +227,7 @@ void CEnvironment::SetWeather(shared_str name, bool forced) Msg("! Invalid weather name: %s", name.c_str()); return; } - R_ASSERT3(it != WeatherCycles.end(), "Invalid weather name.", *name); + R_ASSERT3(it != WeatherCycles.end(), "Invalid weather name.", name.c_str()); CurrentCycleName = it->first; if (forced) { @@ -261,7 +261,7 @@ bool CEnvironment::SetWeatherFX(shared_str name) if (name.size()) { auto it = WeatherFXs.find(name); - R_ASSERT3(it != WeatherFXs.end(), "Invalid weather effect name.", *name); + R_ASSERT3(it != WeatherFXs.end(), "Invalid weather effect name.", name.c_str()); EnvVec* PrevWeather = CurrentWeather; VERIFY(PrevWeather); CurrentWeather = &it->second; diff --git a/src/xrEngine/Environment_misc.cpp b/src/xrEngine/Environment_misc.cpp index a48886ce5df..1ad2e8f8478 100644 --- a/src/xrEngine/Environment_misc.cpp +++ b/src/xrEngine/Environment_misc.cpp @@ -619,7 +619,7 @@ void CEnvironment::load_weathers() auto _E = WeatherCycles.end(); for (; _I != _E; _I++) { - R_ASSERT3(_I->second.size() > 1, "Environment in weather must >=2", *_I->first); + R_ASSERT3(_I->second.size() > 1, "Environment in weather must >=2", _I->first.c_str()); std::sort(_I->second.begin(), _I->second.end(), sort_env_etl_pred); } R_ASSERT2(!WeatherCycles.empty(), "Empty weathers."); @@ -704,7 +704,7 @@ void CEnvironment::load_weather_effects() auto _E = WeatherFXs.end(); for (; _I != _E; _I++) { - R_ASSERT3(_I->second.size() > 1, "Environment in weather must >=2", *_I->first); + R_ASSERT3(_I->second.size() > 1, "Environment in weather must >=2", _I->first.c_str()); std::sort(_I->second.begin(), _I->second.end(), sort_env_etl_pred); } } diff --git a/src/xrEngine/FDemoRecord.cpp b/src/xrEngine/FDemoRecord.cpp index ba4d224f4e2..c454ea4010f 100644 --- a/src/xrEngine/FDemoRecord.cpp +++ b/src/xrEngine/FDemoRecord.cpp @@ -211,9 +211,9 @@ void CDemoRecord::MakeLevelMapProcess() string_path tmp; if (m_iLMScreenshotFragment == -1) - xr_sprintf(tmp, sizeof(tmp), "map_%s", *g_pGameLevel->name()); + xr_sprintf(tmp, sizeof(tmp), "map_%s", g_pGameLevel->name().c_str()); else - xr_sprintf(tmp, sizeof(tmp), "map_%s#%d", *g_pGameLevel->name(), m_iLMScreenshotFragment); + xr_sprintf(tmp, sizeof(tmp), "map_%s#%d", g_pGameLevel->name().c_str(), m_iLMScreenshotFragment); if (m_iLMScreenshotFragment != -1) { diff --git a/src/xrEngine/GameMtlLib.cpp b/src/xrEngine/GameMtlLib.cpp index bf134c6c793..51d4b4454eb 100644 --- a/src/xrEngine/GameMtlLib.cpp +++ b/src/xrEngine/GameMtlLib.cpp @@ -13,7 +13,7 @@ const char* SGameMtlPair::dbg_Name() static string256 nm; SGameMtl* M0 = GMLib.GetMaterialByID(GetMtl0()); SGameMtl* M1 = GMLib.GetMaterialByID(GetMtl1()); - xr_sprintf(nm, sizeof(nm), "Pair: %s - %s", *M0->m_Name, *M1->m_Name); + xr_sprintf(nm, sizeof(nm), "Pair: %s - %s", M0->m_Name.c_str(), M1->m_Name.c_str()); return nm; } #endif diff --git a/src/xrEngine/GameMtlLib_Engine.cpp b/src/xrEngine/GameMtlLib_Engine.cpp index 305ed78fc01..bfed004bdd8 100644 --- a/src/xrEngine/GameMtlLib_Engine.cpp +++ b/src/xrEngine/GameMtlLib_Engine.cpp @@ -70,34 +70,34 @@ void SGameMtlPair::Load(IReader& fs) R_ASSERT(fs.find_chunk(GAMEMTLPAIR_CHUNK_BREAKING)); fs.r_stringZ(buf); #ifdef GM_NON_GAME - BreakingSounds = *buf ? *buf : ""; + BreakingSounds = buf.c_str() ? buf.c_str() : ""; #else - CreateSounds(BreakingSounds, *buf); + CreateSounds(BreakingSounds, buf.c_str()); #endif R_ASSERT(fs.find_chunk(GAMEMTLPAIR_CHUNK_STEP)); fs.r_stringZ(buf); #ifdef GM_NON_GAME - StepSounds = *buf ? *buf : ""; + StepSounds = buf.c_str() ? buf.c_str() : ""; #else - CreateSounds(StepSounds, *buf); + CreateSounds(StepSounds, buf.c_str()); #endif R_ASSERT(fs.find_chunk(GAMEMTLPAIR_CHUNK_COLLIDE)); fs.r_stringZ(buf); #ifdef GM_NON_GAME - CollideSounds = *buf ? *buf : ""; + CollideSounds = buf.c_str() ? buf.c_str() : ""; #else - CreateSounds(CollideSounds, *buf); + CreateSounds(CollideSounds, buf.c_str()); #endif fs.r_stringZ(buf); #ifdef GM_NON_GAME - CollideParticles = *buf ? *buf : ""; + CollideParticles = buf.c_str() ? buf.c_str() : ""; #else - CreatePSs(CollideParticles, *buf); + CreatePSs(CollideParticles, buf.c_str()); #endif fs.r_stringZ(buf); #ifdef GM_NON_GAME - CollideMarks = *buf ? *buf : ""; + CollideMarks = buf.c_str() ? buf.c_str() : ""; #else - CreateMarks(&*CollideMarks, *buf); + CreateMarks(&*CollideMarks, buf.c_str()); #endif } diff --git a/src/xrEngine/ISheduled.cpp b/src/xrEngine/ISheduled.cpp index d1ac756423b..0cbd1931c3d 100644 --- a/src/xrEngine/ISheduled.cpp +++ b/src/xrEngine/ISheduled.cpp @@ -16,7 +16,7 @@ ScheduledBase::ScheduledBase() extern BOOL g_bSheduleInProgress; ScheduledBase::~ScheduledBase() { - VERIFY2(!Engine.Sheduler.Registered(this), make_string("0x%08x : %s", this, *shedule_Name())); + VERIFY2(!Engine.Sheduler.Registered(this), make_string("0x%08x : %s", this, shedule_Name().c_str())); // sad, but true // we need this to become MASTER_GOLD @@ -35,7 +35,7 @@ void ScheduledBase::shedule_Update(u32 dt) LPCSTR name = "unknown"; IGameObject* O = dynamic_cast(this); if (O) - name = *O->cName(); + name = O->cName().c_str(); xrDebug::Fatal(DEBUG_INFO, "'shedule_Update' called twice per frame for %s", name); } shedule.dbg_update_shedule = shedule.dbg_startframe; diff --git a/src/xrEngine/ObjectAnimator.h b/src/xrEngine/ObjectAnimator.h index 0a03a5cc179..cda5b534b8d 100644 --- a/src/xrEngine/ObjectAnimator.h +++ b/src/xrEngine/ObjectAnimator.h @@ -30,7 +30,7 @@ class ENGINE_API CObjectAnimator void Clear(); void Load(LPCSTR name); - IC LPCSTR Name() const { return *m_Name; } + IC LPCSTR Name() const { return m_Name.c_str(); } float& Speed() { return m_Speed; } COMotion* Play(bool bLoop, LPCSTR name = 0); void Pause(bool val) { return m_MParam.Pause(val); } diff --git a/src/xrEngine/editor_environment_manager.cpp b/src/xrEngine/editor_environment_manager.cpp index 40cd3c93a16..633986dd200 100644 --- a/src/xrEngine/editor_environment_manager.cpp +++ b/src/xrEngine/editor_environment_manager.cpp @@ -115,7 +115,7 @@ void manager::load_weathers() auto _E = WeatherCycles.end(); for (; _I != _E; _I++) { - R_ASSERT3(_I->second.size() > 1, "Environment in weather must >=2", *_I->first); + R_ASSERT3(_I->second.size() > 1, "Environment in weather must >=2", _I->first.c_str()); std::sort(_I->second.begin(), _I->second.end(), sort_env_etl_pred); } R_ASSERT2(!WeatherCycles.empty(), "Empty weathers."); diff --git a/src/xrEngine/editor_environment_thunderbolts_gradient.cpp b/src/xrEngine/editor_environment_thunderbolts_gradient.cpp index 8fa2c0bfd17..04df3c18cb8 100644 --- a/src/xrEngine/editor_environment_thunderbolts_gradient.cpp +++ b/src/xrEngine/editor_environment_thunderbolts_gradient.cpp @@ -32,7 +32,7 @@ void gradient::load(CInifile& config, shared_str const& section_id, LPCSTR prefi texture = config.r_string(section_id, strconcat(sizeof(temp), temp, prefix, "_texture")); fOpacity = config.r_float(section_id, strconcat(sizeof(temp), temp, prefix, "_opacity")); fRadius = config.r_fvector2(section_id, strconcat(sizeof(temp), temp, prefix, "_radius")); - m_pFlare->CreateShader(*shader, *texture); + m_pFlare->CreateShader(shader.c_str(), texture.c_str()); } void gradient::save(CInifile& config, shared_str const& section_id, LPCSTR prefix) @@ -48,14 +48,14 @@ LPCSTR gradient::shader_getter() const { return (shader.c_str()); } void gradient::shader_setter(LPCSTR value) { shader = value; - m_pFlare->CreateShader(*shader, *texture); + m_pFlare->CreateShader(shader.c_str(), texture.c_str()); } LPCSTR gradient::texture_getter() const { return (texture.c_str()); } void gradient::texture_setter(LPCSTR value) { texture = value; - m_pFlare->CreateShader(*shader, *texture); + m_pFlare->CreateShader(shader.c_str(), texture.c_str()); } void gradient::fill( diff --git a/src/xrEngine/thunderbolt.cpp b/src/xrEngine/thunderbolt.cpp index aedd1693f93..b5441fc11e1 100644 --- a/src/xrEngine/thunderbolt.cpp +++ b/src/xrEngine/thunderbolt.cpp @@ -38,7 +38,7 @@ void SThunderboltDesc::create_top_gradient(CInifile& pIni, shared_str const& sec m_GradientTop->texture = pIni.r_string(sect, "gradient_top_texture"); m_GradientTop->fRadius = pIni.r_fvector2(sect, "gradient_top_radius"); m_GradientTop->fOpacity = pIni.r_float(sect, "gradient_top_opacity"); - m_GradientTop->m_pFlare->CreateShader(*m_GradientTop->shader, *m_GradientTop->texture); + m_GradientTop->m_pFlare->CreateShader(m_GradientTop->shader.c_str(), m_GradientTop->texture.c_str()); } void SThunderboltDesc::create_center_gradient(CInifile& pIni, shared_str const& sect) @@ -48,7 +48,7 @@ void SThunderboltDesc::create_center_gradient(CInifile& pIni, shared_str const& m_GradientCenter->texture = pIni.r_string(sect, "gradient_center_texture"); m_GradientCenter->fRadius = pIni.r_fvector2(sect, "gradient_center_radius"); m_GradientCenter->fOpacity = pIni.r_float(sect, "gradient_center_opacity"); - m_GradientCenter->m_pFlare->CreateShader(*m_GradientCenter->shader, *m_GradientCenter->texture); + m_GradientCenter->m_pFlare->CreateShader(m_GradientCenter->shader.c_str(), m_GradientCenter->texture.c_str()); } void SThunderboltDesc::load(CInifile& pIni, shared_str const& sect) diff --git a/src/xrEngine/xrSheduler.cpp b/src/xrEngine/xrSheduler.cpp index d6d113a57a6..e14a98137a8 100644 --- a/src/xrEngine/xrSheduler.cpp +++ b/src/xrEngine/xrSheduler.cpp @@ -178,7 +178,7 @@ bool CSheduler::internal_Unregister(ISheduled* O, BOOL RT, bool warn_on_not_foun #ifdef DEBUG if (warn_on_not_found) - Msg("! scheduled object %s tries to unregister but is not registered", *O->shedule_Name()); + Msg("! scheduled object %s tries to unregister but is not registered", O->shedule_Name().c_str()); #endif // DEBUG return (false); diff --git a/src/xrEngine/xr_collide_form.cpp b/src/xrEngine/xr_collide_form.cpp index 2faf1bd3ad5..31a4373c8b9 100644 --- a/src/xrEngine/xr_collide_form.cpp +++ b/src/xrEngine/xr_collide_form.cpp @@ -98,7 +98,7 @@ CCF_Skeleton::CCF_Skeleton(IGameObject* O) : ICollisionForm(O, cftObject) IRenderVisual* pVisual = O->Visual(); // IKinematics* K = PKinematics(pVisual); VERIFY3(K,"Can't create skeleton without Kinematics.",*O->cNameVisual()); IKinematics* K = PKinematics(pVisual); - VERIFY3(K, "Can't create skeleton without Kinematics.", *O->cNameVisual()); + VERIFY3(K, "Can't create skeleton without Kinematics.", O->cNameVisual().c_str()); // bv_box.set (K->vis.box); bv_box.set(pVisual->getVisData().box); bv_box.getsphere(bv_sphere.P, bv_sphere.R); diff --git a/src/xrEngine/xr_efflensflare.cpp b/src/xrEngine/xr_efflensflare.cpp index 02f36105382..e95397c2ad3 100644 --- a/src/xrEngine/xr_efflensflare.cpp +++ b/src/xrEngine/xr_efflensflare.cpp @@ -118,10 +118,10 @@ void CLensFlareDescriptor::load(CInifile* pIni, LPCSTR sect) void CLensFlareDescriptor::OnDeviceCreate() { // shaders - m_Gradient.m_pRender->CreateShader(*m_Gradient.shader, *m_Gradient.texture); - m_Source.m_pRender->CreateShader(*m_Source.shader, *m_Source.texture); + m_Gradient.m_pRender->CreateShader(m_Gradient.shader.c_str(), m_Gradient.texture.c_str()); + m_Source.m_pRender->CreateShader(m_Source.shader.c_str(), m_Source.texture.c_str()); for (auto it = m_Flares.begin(); it != m_Flares.end(); it++) - it->m_pRender->CreateShader(*it->shader, *it->texture); + it->m_pRender->CreateShader(it->shader.c_str(), it->texture.c_str()); /* m_Gradient.hShader = CreateShader (*m_Gradient.texture,*m_Gradient.shader); m_Source.hShader = CreateShader (*m_Source.texture,*m_Source.shader); @@ -609,7 +609,7 @@ shared_str CLensFlare::AppendDef(CEnvironment& environment, CInifile* pIni, LPCS if (!sect || (0 == sect[0])) return ""; for (auto it = m_Palette.begin(); it != m_Palette.end(); it++) - if (0 == xr_strcmp(*(*it)->section, sect)) + if (0 == xr_strcmp((*it)->section.c_str(), sect)) return sect; environment.add_flare(m_Palette, sect); diff --git a/src/xrEngine/xr_object_list.cpp b/src/xrEngine/xr_object_list.cpp index 8f02ac0b18d..3397ebde789 100644 --- a/src/xrEngine/xr_object_list.cpp +++ b/src/xrEngine/xr_object_list.cpp @@ -139,7 +139,7 @@ void CObjectList::SingleUpdate(IGameObject* O) O->UpdateCL(); - VERIFY3(O->GetDbgUpdateFrame() == Device.dwFrame, "Broken sequence of calls to 'UpdateCL'", *O->cName()); + VERIFY3(O->GetDbgUpdateFrame() == Device.dwFrame, "Broken sequence of calls to 'UpdateCL'", O->cName().c_str()); #if 0 // ndef DEBUG __try { @@ -147,8 +147,8 @@ void CObjectList::SingleUpdate(IGameObject* O) if (O->H_Parent() && (O->H_Parent()->getDestroy() || O->H_Root()->getDestroy())) { // Push to destroy-queue if it isn't here already - Msg("! ERROR: incorrect destroy sequence for object[%d:%s], section[%s], parent[%d:%s]", O->ID(), *O->cName(), - *O->cNameSect(), O->H_Parent()->ID(), *O->H_Parent()->cName()); + Msg("! ERROR: incorrect destroy sequence for object[%d:%s], section[%s], parent[%d:%s]", O->ID(), O->cName().c_str(), + O->cNameSect().c_str(), O->H_Parent()->ID(), O->H_Parent()->cName().c_str()); } #if 0 // ndef DEBUG } @@ -156,7 +156,7 @@ void CObjectList::SingleUpdate(IGameObject* O) { IGameObject* parent_obj = O->H_Parent(); IGameObject* root_obj = O->H_Root(); - Msg ("! ERROR: going to crush: [%d:%s], section[%s], parent_obj_addr[0x%08x], root_obj_addr[0x%08x]",O->ID(),*O->cName(),*O->cNameSect(), *((u32*)&parent_obj), *((u32*)&root_obj)); + Msg ("! ERROR: going to crush: [%d:%s], section[%s], parent_obj_addr[0x%08x], root_obj_addr[0x%08x]",O->ID(),O->cName().c_str(), O->cNameSect().c_str(), *((u32*)&parent_obj), *((u32*)&root_obj)); if (parent_obj) { __try @@ -318,7 +318,7 @@ void CObjectList::Update(bool bForce) // Msg ("Object [%x]", O); #ifdef DEBUG if (debug_destroy) - Msg("Destroying object[%x][%x] [%d][%s] frame[%d]", dynamic_cast(O), O, O->ID(), *O->cName(), + Msg("Destroying object[%x][%x] [%d][%s] frame[%d]", dynamic_cast(O), O, O->ID(), O->cName().c_str(), Device.dwFrame); #endif // DEBUG O->net_Destroy(); @@ -378,14 +378,14 @@ u32 CObjectList::net_Export(NET_Packet* _Packet, u32 start, u32 max_object_size) if (size >= 256) { xrDebug::Fatal(DEBUG_INFO, "Object [%s][%d] exceed network-data limit\n size=%d, Pend=%d, Pstart=%d", - *P->cName(), P->ID(), size, Packet.w_tell(), position); + P->cName().c_str(), P->ID(), size, Packet.w_tell(), position); } } #endif if (g_Dump_Export_Obj) { u32 size = u32(Packet.w_tell() - position) - sizeof(u8); - Msg("* %s : %d", *(P->cNameSect()), size); + Msg("* %s : %d", P->cNameSect().c_str(), size); } Packet.w_chunk_close8(position); // if (0==(--count)) @@ -420,7 +420,7 @@ void CObjectList::net_Import(NET_Packet* Packet) P->net_Import(*Packet); if (g_Dump_Import_Obj) - Msg("* %s : %d - %d", *(P->cNameSect()), size, Packet->r_tell() - rsize); + Msg("* %s : %d - %d", P->cNameSect().c_str(), size, Packet->r_tell() - rsize); } else Packet->r_advance(size); @@ -452,12 +452,12 @@ void CObjectList::Unload() while (objects_sleeping.size()) { IGameObject* O = objects_sleeping.back(); - Msg("! [%x] s[%4d]-[%s]-[%s]", O, O->ID(), *O->cNameSect(), *O->cName()); + Msg("! [%x] s[%4d]-[%s]-[%s]", O, O->ID(), O->cNameSect().c_str(), O->cName().c_str()); O->setDestroy(true); #ifdef DEBUG if (debug_destroy) - Msg("Destroying object [%d][%s]", O->ID(), *O->cName()); + Msg("Destroying object [%d][%s]", O->ID(), O->cName().c_str()); #endif O->net_Destroy(); Destroy(O); @@ -465,12 +465,12 @@ void CObjectList::Unload() while (objects_active.size()) { IGameObject* O = objects_active.back(); - Msg("! [%x] a[%4d]-[%s]-[%s]", O, O->ID(), *O->cNameSect(), *O->cName()); + Msg("! [%x] a[%4d]-[%s]-[%s]", O, O->ID(), O->cNameSect().c_str(), O->cName().c_str()); O->setDestroy(true); #ifdef DEBUG if (debug_destroy) - Msg("Destroying object [%d][%s]", O->ID(), *O->cName()); + Msg("Destroying object [%d][%s]", O->ID(), O->cName().c_str()); #endif O->net_Destroy(); Destroy(O); diff --git a/src/xrNetServer/NET_Client.cpp b/src/xrNetServer/NET_Client.cpp index 7917c4d3cab..498a40f8a56 100644 --- a/src/xrNetServer/NET_Client.cpp +++ b/src/xrNetServer/NET_Client.cpp @@ -667,7 +667,7 @@ bool IPureClient::Connect(pcstr options) net_csEnumeration.Enter(); // real connect for (u32 I = 0; I < net_Hosts.size(); I++) - Msg("* HOST #%d: %s\n", I + 1, *net_Hosts[I].dpSessionName); + Msg("* HOST #%d: %s\n", I + 1, net_Hosts[I].dpSessionName.c_str()); R_CHK(net_Hosts.front().pHostAddress->Duplicate(&pHostAddress)); // dump_URL ("! c2s ", pHostAddress); diff --git a/src/xrNetServer/NET_Client.h b/src/xrNetServer/NET_Client.h index 1ee3cfe8c03..b78d40335bc 100644 --- a/src/xrNetServer/NET_Client.h +++ b/src/xrNetServer/NET_Client.h @@ -106,7 +106,7 @@ class XRNETSERVER_API IPureClient : private MultipacketReciever, private Multipa bool net_isCompleted_Sync() const { return net_Syncronised; } bool net_isDisconnected() const; GameDescriptionData const& get_net_DescriptionData() const { return m_game_description; } - pcstr net_SessionName() { return *net_Hosts.front().dpSessionName; } + pcstr net_SessionName() { return net_Hosts.front().dpSessionName.c_str(); } // receive void StartProcessQueue() { net_Queue.Lock(); } // WARNING ! after Start must be End !!! <- virtual NET_Packet* net_msg_Retreive() { return net_Queue.Retreive(); } // | diff --git a/src/xrSound/SoundRender_Core_SourceManager.cpp b/src/xrSound/SoundRender_Core_SourceManager.cpp index 289c05d398c..c87313fc4c9 100644 --- a/src/xrSound/SoundRender_Core_SourceManager.cpp +++ b/src/xrSound/SoundRender_Core_SourceManager.cpp @@ -13,7 +13,7 @@ CSoundRender_Source* CSoundRender_Core::i_create_source(pcstr name) *strext(id) = 0; for (u32 it = 0; it < s_sources.size(); it++) { - if (0 == xr_strcmp(*s_sources[it]->fname, id)) + if (0 == xr_strcmp(s_sources[it]->fname.c_str(), id)) return s_sources[it]; } diff --git a/src/xrSound/SoundRender_Environment.cpp b/src/xrSound/SoundRender_Environment.cpp index 70ee36a01a0..7b9c6e3f34a 100644 --- a/src/xrSound/SoundRender_Environment.cpp +++ b/src/xrSound/SoundRender_Environment.cpp @@ -184,14 +184,14 @@ void SoundEnvironment_LIB::Unload() int SoundEnvironment_LIB::GetID(pcstr name) { for (auto it = library.begin(); it != library.end(); ++it) - if (0 == _stricmp(name, *(*it)->name)) + if (0 == _stricmp(name, (*it)->name.c_str())) return int(it - library.begin()); return -1; } CSoundRender_Environment* SoundEnvironment_LIB::Get(pcstr name) { for (const auto& it : library) - if (0 == _stricmp(name, *it->name)) + if (0 == _stricmp(name, it->name.c_str())) return it; return nullptr; } @@ -204,7 +204,7 @@ CSoundRender_Environment* SoundEnvironment_LIB::Append(CSoundRender_Environment* void SoundEnvironment_LIB::Remove(pcstr name) { for (auto it = library.begin(); it != library.end(); ++it) - if (0 == _stricmp(name, *(*it)->name)) + if (0 == _stricmp(name, (*it)->name.c_str())) { xr_delete(*it); library.erase(it); diff --git a/src/xrSound/SoundRender_Source.h b/src/xrSound/SoundRender_Source.h index dd33c9eebfa..b955c784b82 100644 --- a/src/xrSound/SoundRender_Source.h +++ b/src/xrSound/SoundRender_Source.h @@ -39,7 +39,7 @@ class XRSOUND_EDITOR_API CSoundRender_Source : public CSound_source float length_sec() const override { return fTimeTotal; } u32 game_type() const override { return m_uGameType; } - pcstr file_name() const override { return *fname; } + pcstr file_name() const override { return fname.c_str(); } virtual float base_volume() const { return m_fBaseVolume; } u16 channels_num() const override { return m_wformat.nChannels; } u32 bytes_total() const override { return dwBytesTotal; }