Skip to content

Commit 2520d2d

Browse files
committed
Revert "Replace shared_str operator* by c_str() for xrEngine, xrNetServer and xrSound"
This reverts commit 9fa48aa.
1 parent bfed79c commit 2520d2d

19 files changed

+51
-51
lines changed

src/xrEngine/Environment.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ void CEnvironment::SetWeather(shared_str name, bool forced)
227227
Msg("! Invalid weather name: %s", name.c_str());
228228
return;
229229
}
230-
R_ASSERT3(it != WeatherCycles.end(), "Invalid weather name.", name.c_str());
230+
R_ASSERT3(it != WeatherCycles.end(), "Invalid weather name.", *name);
231231
CurrentCycleName = it->first;
232232
if (forced)
233233
{
@@ -261,7 +261,7 @@ bool CEnvironment::SetWeatherFX(shared_str name)
261261
if (name.size())
262262
{
263263
auto it = WeatherFXs.find(name);
264-
R_ASSERT3(it != WeatherFXs.end(), "Invalid weather effect name.", name.c_str());
264+
R_ASSERT3(it != WeatherFXs.end(), "Invalid weather effect name.", *name);
265265
EnvVec* PrevWeather = CurrentWeather;
266266
VERIFY(PrevWeather);
267267
CurrentWeather = &it->second;

src/xrEngine/Environment_misc.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -619,7 +619,7 @@ void CEnvironment::load_weathers()
619619
auto _E = WeatherCycles.end();
620620
for (; _I != _E; _I++)
621621
{
622-
R_ASSERT3(_I->second.size() > 1, "Environment in weather must >=2", _I->first.c_str());
622+
R_ASSERT3(_I->second.size() > 1, "Environment in weather must >=2", *_I->first);
623623
std::sort(_I->second.begin(), _I->second.end(), sort_env_etl_pred);
624624
}
625625
R_ASSERT2(!WeatherCycles.empty(), "Empty weathers.");
@@ -704,7 +704,7 @@ void CEnvironment::load_weather_effects()
704704
auto _E = WeatherFXs.end();
705705
for (; _I != _E; _I++)
706706
{
707-
R_ASSERT3(_I->second.size() > 1, "Environment in weather must >=2", _I->first.c_str());
707+
R_ASSERT3(_I->second.size() > 1, "Environment in weather must >=2", *_I->first);
708708
std::sort(_I->second.begin(), _I->second.end(), sort_env_etl_pred);
709709
}
710710
}

src/xrEngine/FDemoRecord.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,9 +211,9 @@ void CDemoRecord::MakeLevelMapProcess()
211211

212212
string_path tmp;
213213
if (m_iLMScreenshotFragment == -1)
214-
xr_sprintf(tmp, sizeof(tmp), "map_%s", g_pGameLevel->name().c_str());
214+
xr_sprintf(tmp, sizeof(tmp), "map_%s", *g_pGameLevel->name());
215215
else
216-
xr_sprintf(tmp, sizeof(tmp), "map_%s#%d", g_pGameLevel->name().c_str(), m_iLMScreenshotFragment);
216+
xr_sprintf(tmp, sizeof(tmp), "map_%s#%d", *g_pGameLevel->name(), m_iLMScreenshotFragment);
217217

218218
if (m_iLMScreenshotFragment != -1)
219219
{

src/xrEngine/GameMtlLib.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const char* SGameMtlPair::dbg_Name()
1313
static string256 nm;
1414
SGameMtl* M0 = GMLib.GetMaterialByID(GetMtl0());
1515
SGameMtl* M1 = GMLib.GetMaterialByID(GetMtl1());
16-
xr_sprintf(nm, sizeof(nm), "Pair: %s - %s", M0->m_Name.c_str(), M1->m_Name.c_str());
16+
xr_sprintf(nm, sizeof(nm), "Pair: %s - %s", *M0->m_Name, *M1->m_Name);
1717
return nm;
1818
}
1919
#endif

src/xrEngine/GameMtlLib_Engine.cpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -70,34 +70,34 @@ void SGameMtlPair::Load(IReader& fs)
7070
R_ASSERT(fs.find_chunk(GAMEMTLPAIR_CHUNK_BREAKING));
7171
fs.r_stringZ(buf);
7272
#ifdef GM_NON_GAME
73-
BreakingSounds = buf.c_str() ? buf.c_str() : "";
73+
BreakingSounds = *buf ? *buf : "";
7474
#else
75-
CreateSounds(BreakingSounds, buf.c_str());
75+
CreateSounds(BreakingSounds, *buf);
7676
#endif
7777
R_ASSERT(fs.find_chunk(GAMEMTLPAIR_CHUNK_STEP));
7878
fs.r_stringZ(buf);
7979
#ifdef GM_NON_GAME
80-
StepSounds = buf.c_str() ? buf.c_str() : "";
80+
StepSounds = *buf ? *buf : "";
8181
#else
82-
CreateSounds(StepSounds, buf.c_str());
82+
CreateSounds(StepSounds, *buf);
8383
#endif
8484
R_ASSERT(fs.find_chunk(GAMEMTLPAIR_CHUNK_COLLIDE));
8585
fs.r_stringZ(buf);
8686
#ifdef GM_NON_GAME
87-
CollideSounds = buf.c_str() ? buf.c_str() : "";
87+
CollideSounds = *buf ? *buf : "";
8888
#else
89-
CreateSounds(CollideSounds, buf.c_str());
89+
CreateSounds(CollideSounds, *buf);
9090
#endif
9191
fs.r_stringZ(buf);
9292
#ifdef GM_NON_GAME
93-
CollideParticles = buf.c_str() ? buf.c_str() : "";
93+
CollideParticles = *buf ? *buf : "";
9494
#else
95-
CreatePSs(CollideParticles, buf.c_str());
95+
CreatePSs(CollideParticles, *buf);
9696
#endif
9797
fs.r_stringZ(buf);
9898
#ifdef GM_NON_GAME
99-
CollideMarks = buf.c_str() ? buf.c_str() : "";
99+
CollideMarks = *buf ? *buf : "";
100100
#else
101-
CreateMarks(&*CollideMarks, buf.c_str());
101+
CreateMarks(&*CollideMarks, *buf);
102102
#endif
103103
}

src/xrEngine/ISheduled.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ ScheduledBase::ScheduledBase()
1616
extern BOOL g_bSheduleInProgress;
1717
ScheduledBase::~ScheduledBase()
1818
{
19-
VERIFY2(!Engine.Sheduler.Registered(this), make_string("0x%08x : %s", this, shedule_Name().c_str()));
19+
VERIFY2(!Engine.Sheduler.Registered(this), make_string("0x%08x : %s", this, *shedule_Name()));
2020

2121
// sad, but true
2222
// we need this to become MASTER_GOLD
@@ -35,7 +35,7 @@ void ScheduledBase::shedule_Update(u32 dt)
3535
LPCSTR name = "unknown";
3636
IGameObject* O = dynamic_cast<IGameObject*>(this);
3737
if (O)
38-
name = O->cName().c_str();
38+
name = *O->cName();
3939
xrDebug::Fatal(DEBUG_INFO, "'shedule_Update' called twice per frame for %s", name);
4040
}
4141
shedule.dbg_update_shedule = shedule.dbg_startframe;

src/xrEngine/ObjectAnimator.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class ENGINE_API CObjectAnimator
3030

3131
void Clear();
3232
void Load(LPCSTR name);
33-
IC LPCSTR Name() const { return m_Name.c_str(); }
33+
IC LPCSTR Name() const { return *m_Name; }
3434
float& Speed() { return m_Speed; }
3535
COMotion* Play(bool bLoop, LPCSTR name = 0);
3636
void Pause(bool val) { return m_MParam.Pause(val); }

src/xrEngine/editor_environment_manager.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ void manager::load_weathers()
115115
auto _E = WeatherCycles.end();
116116
for (; _I != _E; _I++)
117117
{
118-
R_ASSERT3(_I->second.size() > 1, "Environment in weather must >=2", _I->first.c_str());
118+
R_ASSERT3(_I->second.size() > 1, "Environment in weather must >=2", *_I->first);
119119
std::sort(_I->second.begin(), _I->second.end(), sort_env_etl_pred);
120120
}
121121
R_ASSERT2(!WeatherCycles.empty(), "Empty weathers.");

src/xrEngine/editor_environment_thunderbolts_gradient.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ void gradient::load(CInifile& config, shared_str const& section_id, LPCSTR prefi
3232
texture = config.r_string(section_id, strconcat(sizeof(temp), temp, prefix, "_texture"));
3333
fOpacity = config.r_float(section_id, strconcat(sizeof(temp), temp, prefix, "_opacity"));
3434
fRadius = config.r_fvector2(section_id, strconcat(sizeof(temp), temp, prefix, "_radius"));
35-
m_pFlare->CreateShader(shader.c_str(), texture.c_str());
35+
m_pFlare->CreateShader(*shader, *texture);
3636
}
3737

3838
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()); }
4848
void gradient::shader_setter(LPCSTR value)
4949
{
5050
shader = value;
51-
m_pFlare->CreateShader(shader.c_str(), texture.c_str());
51+
m_pFlare->CreateShader(*shader, *texture);
5252
}
5353

5454
LPCSTR gradient::texture_getter() const { return (texture.c_str()); }
5555
void gradient::texture_setter(LPCSTR value)
5656
{
5757
texture = value;
58-
m_pFlare->CreateShader(shader.c_str(), texture.c_str());
58+
m_pFlare->CreateShader(*shader, *texture);
5959
}
6060

6161
void gradient::fill(

src/xrEngine/thunderbolt.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ void SThunderboltDesc::create_top_gradient(CInifile& pIni, shared_str const& sec
3838
m_GradientTop->texture = pIni.r_string(sect, "gradient_top_texture");
3939
m_GradientTop->fRadius = pIni.r_fvector2(sect, "gradient_top_radius");
4040
m_GradientTop->fOpacity = pIni.r_float(sect, "gradient_top_opacity");
41-
m_GradientTop->m_pFlare->CreateShader(m_GradientTop->shader.c_str(), m_GradientTop->texture.c_str());
41+
m_GradientTop->m_pFlare->CreateShader(*m_GradientTop->shader, *m_GradientTop->texture);
4242
}
4343

4444
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&
4848
m_GradientCenter->texture = pIni.r_string(sect, "gradient_center_texture");
4949
m_GradientCenter->fRadius = pIni.r_fvector2(sect, "gradient_center_radius");
5050
m_GradientCenter->fOpacity = pIni.r_float(sect, "gradient_center_opacity");
51-
m_GradientCenter->m_pFlare->CreateShader(m_GradientCenter->shader.c_str(), m_GradientCenter->texture.c_str());
51+
m_GradientCenter->m_pFlare->CreateShader(*m_GradientCenter->shader, *m_GradientCenter->texture);
5252
}
5353

5454
void SThunderboltDesc::load(CInifile& pIni, shared_str const& sect)

0 commit comments

Comments
 (0)