mirror of
https://github.com/OpenMW/openmw.git
synced 2025-01-16 15:29:55 +00:00
Simplify strings construction
This commit is contained in:
parent
5160fbc2a0
commit
b3a981e0fc
2 changed files with 3 additions and 8 deletions
|
@ -434,15 +434,12 @@ void MwIniImporter::insertMultistrmap(multistrmap& cfg, const std::string& key,
|
||||||
void MwIniImporter::importArchives(multistrmap& cfg, const multistrmap& ini) const
|
void MwIniImporter::importArchives(multistrmap& cfg, const multistrmap& ini) const
|
||||||
{
|
{
|
||||||
std::vector<std::string> archives;
|
std::vector<std::string> archives;
|
||||||
std::string baseArchive("Archives:Archive ");
|
|
||||||
std::string archive;
|
|
||||||
|
|
||||||
// Search archives listed in ini file
|
// Search archives listed in ini file
|
||||||
auto it = ini.begin();
|
auto it = ini.begin();
|
||||||
for (int i = 0; it != ini.end(); i++)
|
for (int i = 0; it != ini.end(); i++)
|
||||||
{
|
{
|
||||||
archive = baseArchive;
|
std::string archive("Archives:Archive " + std::to_string(i));
|
||||||
archive.append(std::to_string(i));
|
|
||||||
|
|
||||||
it = ini.find(archive);
|
it = ini.find(archive);
|
||||||
if (it == ini.end())
|
if (it == ini.end())
|
||||||
|
@ -537,8 +534,7 @@ void MwIniImporter::importGameFiles(
|
||||||
auto it = ini.begin();
|
auto it = ini.begin();
|
||||||
for (int i = 0; it != ini.end(); i++)
|
for (int i = 0; it != ini.end(); i++)
|
||||||
{
|
{
|
||||||
std::string gameFile("Game Files:GameFile");
|
std::string gameFile("Game Files:GameFile" + std::to_string(i));
|
||||||
gameFile.append(std::to_string(i));
|
|
||||||
|
|
||||||
it = ini.find(gameFile);
|
it = ini.find(gameFile);
|
||||||
if (it == ini.end())
|
if (it == ini.end())
|
||||||
|
|
|
@ -398,7 +398,6 @@ namespace Gui
|
||||||
file->read(name_, sizeof(name_));
|
file->read(name_, sizeof(name_));
|
||||||
if (!file->good())
|
if (!file->good())
|
||||||
fail(*file, fileName, "File too small to be a valid font");
|
fail(*file, fileName, "File too small to be a valid font");
|
||||||
std::string name(name_);
|
|
||||||
|
|
||||||
GlyphInfo data[256];
|
GlyphInfo data[256];
|
||||||
file->read((char*)data, sizeof(data));
|
file->read((char*)data, sizeof(data));
|
||||||
|
@ -408,7 +407,7 @@ namespace Gui
|
||||||
file.reset();
|
file.reset();
|
||||||
|
|
||||||
// Create the font texture
|
// Create the font texture
|
||||||
std::string bitmapFilename = "fonts/" + std::move(name) + ".tex";
|
std::string bitmapFilename = "fonts/" + std::string(name_) + ".tex";
|
||||||
|
|
||||||
Files::IStreamPtr bitmapFile = mVFS->get(bitmapFilename);
|
Files::IStreamPtr bitmapFile = mVFS->get(bitmapFilename);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue