From 2520d2d8c5b9a859da92fdba2c8a48683792f720 Mon Sep 17 00:00:00 2001 From: Xottab-DUTY Date: Wed, 15 Nov 2017 20:14:55 +0500 Subject: [PATCH] Revert "Replace shared_str operator* by c_str() for xrEngine, xrNetServer and xrSound" This reverts commit 9fa48aa4ec880784c713c33792a5675b85c73b58. --- 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 c6520f15ebb..5f2c666506a 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.c_str()); + R_ASSERT3(it != WeatherCycles.end(), "Invalid weather name.", *name); 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.c_str()); + R_ASSERT3(it != WeatherFXs.end(), "Invalid weather effect name.", *name); EnvVec* PrevWeather = CurrentWeather; VERIFY(PrevWeather); CurrentWeather = &it->second; diff --git a/src/xrEngine/Environment_misc.cpp b/src/xrEngine/Environment_misc.cpp index 1ad2e8f8478..a48886ce5df 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.c_str()); + R_ASSERT3(_I->second.size() > 1, "Environment in weather must >=2", *_I->first); 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.c_str()); + R_ASSERT3(_I->second.size() > 1, "Environment in weather must >=2", *_I->first); 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 c454ea4010f..ba4d224f4e2 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().c_str()); + xr_sprintf(tmp, sizeof(tmp), "map_%s", *g_pGameLevel->name()); else - xr_sprintf(tmp, sizeof(tmp), "map_%s#%d", g_pGameLevel->name().c_str(), m_iLMScreenshotFragment); + xr_sprintf(tmp, sizeof(tmp), "map_%s#%d", *g_pGameLevel->name(), m_iLMScreenshotFragment); if (m_iLMScreenshotFragment != -1) { diff --git a/src/xrEngine/GameMtlLib.cpp b/src/xrEngine/GameMtlLib.cpp index 51d4b4454eb..bf134c6c793 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.c_str(), M1->m_Name.c_str()); + xr_sprintf(nm, sizeof(nm), "Pair: %s - %s", *M0->m_Name, *M1->m_Name); return nm; } #endif diff --git a/src/xrEngine/GameMtlLib_Engine.cpp b/src/xrEngine/GameMtlLib_Engine.cpp index bfed004bdd8..305ed78fc01 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.c_str() ? buf.c_str() : ""; + BreakingSounds = *buf ? *buf : ""; #else - CreateSounds(BreakingSounds, buf.c_str()); + CreateSounds(BreakingSounds, *buf); #endif R_ASSERT(fs.find_chunk(GAMEMTLPAIR_CHUNK_STEP)); fs.r_stringZ(buf); #ifdef GM_NON_GAME - StepSounds = buf.c_str() ? buf.c_str() : ""; + StepSounds = *buf ? *buf : ""; #else - CreateSounds(StepSounds, buf.c_str()); + CreateSounds(StepSounds, *buf); #endif R_ASSERT(fs.find_chunk(GAMEMTLPAIR_CHUNK_COLLIDE)); fs.r_stringZ(buf); #ifdef GM_NON_GAME - CollideSounds = buf.c_str() ? buf.c_str() : ""; + CollideSounds = *buf ? *buf : ""; #else - CreateSounds(CollideSounds, buf.c_str()); + CreateSounds(CollideSounds, *buf); #endif fs.r_stringZ(buf); #ifdef GM_NON_GAME - CollideParticles = buf.c_str() ? buf.c_str() : ""; + CollideParticles = *buf ? *buf : ""; #else - CreatePSs(CollideParticles, buf.c_str()); + CreatePSs(CollideParticles, *buf); #endif fs.r_stringZ(buf); #ifdef GM_NON_GAME - CollideMarks = buf.c_str() ? buf.c_str() : ""; + CollideMarks = *buf ? *buf : ""; #else - CreateMarks(&*CollideMarks, buf.c_str()); + CreateMarks(&*CollideMarks, *buf); #endif } diff --git a/src/xrEngine/ISheduled.cpp b/src/xrEngine/ISheduled.cpp index 0cbd1931c3d..d1ac756423b 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().c_str())); + VERIFY2(!Engine.Sheduler.Registered(this), make_string("0x%08x : %s", this, *shedule_Name())); // 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().c_str(); + name = *O->cName(); 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 cda5b534b8d..0a03a5cc179 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.c_str(); } + IC LPCSTR Name() const { return *m_Name; } 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 633986dd200..40cd3c93a16 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.c_str()); + R_ASSERT3(_I->second.size() > 1, "Environment in weather must >=2", *_I->first); 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 04df3c18cb8..8fa2c0bfd17 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.c_str(), texture.c_str()); + m_pFlare->CreateShader(*shader, *texture); } 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.c_str(), texture.c_str()); + m_pFlare->CreateShader(*shader, *texture); } LPCSTR gradient::texture_getter() const { return (texture.c_str()); } void gradient::texture_setter(LPCSTR value) { texture = value; - m_pFlare->CreateShader(shader.c_str(), texture.c_str()); + m_pFlare->CreateShader(*shader, *texture); } void gradient::fill( diff --git a/src/xrEngine/thunderbolt.cpp b/src/xrEngine/thunderbolt.cpp index b5441fc11e1..aedd1693f93 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.c_str(), m_GradientTop->texture.c_str()); + m_GradientTop->m_pFlare->CreateShader(*m_GradientTop->shader, *m_GradientTop->texture); } 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.c_str(), m_GradientCenter->texture.c_str()); + m_GradientCenter->m_pFlare->CreateShader(*m_GradientCenter->shader, *m_GradientCenter->texture); } void SThunderboltDesc::load(CInifile& pIni, shared_str const& sect) diff --git a/src/xrEngine/xrSheduler.cpp b/src/xrEngine/xrSheduler.cpp index e14a98137a8..d6d113a57a6 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().c_str()); + Msg("! scheduled object %s tries to unregister but is not registered", *O->shedule_Name()); #endif // DEBUG return (false); diff --git a/src/xrEngine/xr_collide_form.cpp b/src/xrEngine/xr_collide_form.cpp index 31a4373c8b9..2faf1bd3ad5 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().c_str()); + VERIFY3(K, "Can't create skeleton without Kinematics.", *O->cNameVisual()); // 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 e95397c2ad3..02f36105382 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.c_str(), m_Gradient.texture.c_str()); - m_Source.m_pRender->CreateShader(m_Source.shader.c_str(), m_Source.texture.c_str()); + m_Gradient.m_pRender->CreateShader(*m_Gradient.shader, *m_Gradient.texture); + m_Source.m_pRender->CreateShader(*m_Source.shader, *m_Source.texture); for (auto it = m_Flares.begin(); it != m_Flares.end(); it++) - it->m_pRender->CreateShader(it->shader.c_str(), it->texture.c_str()); + it->m_pRender->CreateShader(*it->shader, *it->texture); /* 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.c_str(), sect)) + if (0 == xr_strcmp(*(*it)->section, 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 3397ebde789..8f02ac0b18d 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().c_str()); + VERIFY3(O->GetDbgUpdateFrame() == Device.dwFrame, "Broken sequence of calls to 'UpdateCL'", *O->cName()); #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().c_str(), - O->cNameSect().c_str(), O->H_Parent()->ID(), O->H_Parent()->cName().c_str()); + 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()); } #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().c_str(), O->cNameSect().c_str(), *((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(),*O->cNameSect(), *((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().c_str(), + Msg("Destroying object[%x][%x] [%d][%s] frame[%d]", dynamic_cast(O), O, O->ID(), *O->cName(), 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().c_str(), P->ID(), size, Packet.w_tell(), position); + *P->cName(), 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().c_str(), size); + Msg("* %s : %d", *(P->cNameSect()), 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().c_str(), size, Packet->r_tell() - rsize); + Msg("* %s : %d - %d", *(P->cNameSect()), 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().c_str(), O->cName().c_str()); + Msg("! [%x] s[%4d]-[%s]-[%s]", O, O->ID(), *O->cNameSect(), *O->cName()); O->setDestroy(true); #ifdef DEBUG if (debug_destroy) - Msg("Destroying object [%d][%s]", O->ID(), O->cName().c_str()); + Msg("Destroying object [%d][%s]", O->ID(), *O->cName()); #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().c_str(), O->cName().c_str()); + Msg("! [%x] a[%4d]-[%s]-[%s]", O, O->ID(), *O->cNameSect(), *O->cName()); O->setDestroy(true); #ifdef DEBUG if (debug_destroy) - Msg("Destroying object [%d][%s]", O->ID(), O->cName().c_str()); + Msg("Destroying object [%d][%s]", O->ID(), *O->cName()); #endif O->net_Destroy(); Destroy(O); diff --git a/src/xrNetServer/NET_Client.cpp b/src/xrNetServer/NET_Client.cpp index 498a40f8a56..7917c4d3cab 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.c_str()); + Msg("* HOST #%d: %s\n", I + 1, *net_Hosts[I].dpSessionName); 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 b78d40335bc..1ee3cfe8c03 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.c_str(); } + pcstr net_SessionName() { return *net_Hosts.front().dpSessionName; } // 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 c87313fc4c9..289c05d398c 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.c_str(), id)) + if (0 == xr_strcmp(*s_sources[it]->fname, id)) return s_sources[it]; } diff --git a/src/xrSound/SoundRender_Environment.cpp b/src/xrSound/SoundRender_Environment.cpp index 7b9c6e3f34a..70ee36a01a0 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.c_str())) + if (0 == _stricmp(name, *(*it)->name)) 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.c_str())) + if (0 == _stricmp(name, *it->name)) 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.c_str())) + if (0 == _stricmp(name, *(*it)->name)) { xr_delete(*it); library.erase(it); diff --git a/src/xrSound/SoundRender_Source.h b/src/xrSound/SoundRender_Source.h index b955c784b82..dd33c9eebfa 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.c_str(); } + pcstr file_name() const override { return *fname; } virtual float base_volume() const { return m_fBaseVolume; } u16 channels_num() const override { return m_wformat.nChannels; } u32 bytes_total() const override { return dwBytesTotal; }