2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-12-08 15:44:56 +00:00

string_view refactor

This commit is contained in:
Jack Andersen
2017-11-12 20:19:18 -10:00
parent 742ab2514f
commit f7ec7bdc0c
345 changed files with 907 additions and 921 deletions

View File

@@ -59,7 +59,7 @@ bool ReadANCSToBlender(hecl::BlenderConnection& conn,
return false;
std::string bestName = pakRouter.getBestEntryName(*cmdlE);
hecl::SystemStringView bestNameView(bestName);
hecl::SystemStringConv bestNameView(bestName);
fileChanged(bestNameView.c_str());
typename ANCSDNA::CSKRType cskr;
@@ -79,7 +79,7 @@ bool ReadANCSToBlender(hecl::BlenderConnection& conn,
}
std::string bestName = pakRouter.getBestEntryName(entry);
hecl::SystemStringView bestNameView(bestName);
hecl::SystemStringConv bestNameView(bestName);
fileChanged(bestNameView.c_str());
/* Establish ANCS blend */
@@ -138,8 +138,8 @@ bool ReadANCSToBlender(hecl::BlenderConnection& conn,
if (cmdlE)
{
hecl::ProjectPath cmdlPath = pakRouter.getWorking(cmdlE);
os.linkBlend(cmdlPath.getAbsolutePathUTF8().c_str(),
pakRouter.getBestEntryName(*cmdlE).c_str(), true);
os.linkBlend(cmdlPath.getAbsolutePathUTF8().data(),
pakRouter.getBestEntryName(*cmdlE).data(), true);
/* Attach CMDL to CINF */
os << "if obj.name not in bpy.context.scene.objects:\n"
@@ -160,8 +160,8 @@ bool ReadANCSToBlender(hecl::BlenderConnection& conn,
if (cmdlE)
{
hecl::ProjectPath cmdlPath = pakRouter.getWorking(cmdlE);
os.linkBlend(cmdlPath.getAbsolutePathUTF8().c_str(),
pakRouter.getBestEntryName(*cmdlE).c_str(), true);
os.linkBlend(cmdlPath.getAbsolutePathUTF8().data(),
pakRouter.getBestEntryName(*cmdlE).data(), true);
/* Attach CMDL to CINF */
os << "if obj.name not in bpy.context.scene.objects:\n"

View File

@@ -89,7 +89,7 @@ void ReadMaterialSetToBlender_1_2(hecl::BlenderConnection::PyOutStream& os,
TXTR::Extract(rs, txtrPath);
}
hecl::SystemString resPath = pakRouter.getResourceRelativePath(entry, tex);
hecl::SystemUTF8View resPathView(resPath);
hecl::SystemUTF8Conv resPathView(resPath);
os.format("if '%s' in bpy.data.textures:\n"
" image = bpy.data.images['%s']\n"
" texture = bpy.data.textures[image.name]\n"
@@ -100,7 +100,7 @@ void ReadMaterialSetToBlender_1_2(hecl::BlenderConnection::PyOutStream& os,
" texture.image = image\n"
"texmap_list.append(texture)\n"
"\n", texName.c_str(), texName.c_str(),
resPathView.str().c_str(), texName.c_str());
resPathView.c_str(), texName.c_str());
}
unsigned m=0;
@@ -519,7 +519,7 @@ void InitGeomBlenderContext(hecl::BlenderConnection::PyOutStream& os,
os.format("# Master shader library\n"
"with bpy.data.libraries.load('%s', link=True, relative=True) as (data_from, data_to):\n"
" data_to.node_groups = data_from.node_groups\n"
"\n", masterShaderPath.getAbsolutePathUTF8().c_str());
"\n", masterShaderPath.getAbsolutePathUTF8().data());
}
void FinishBlenderMesh(hecl::BlenderConnection::PyOutStream& os,
@@ -1248,7 +1248,7 @@ bool WriteCMDL(const hecl::ProjectPath& outPath, const hecl::ProjectPath& inPath
atUint32 nextGroupIdx = 0;
for (const Mesh::Material& mat : mset)
{
std::string diagName = hecl::Format("%s:%s", inPath.getLastComponentUTF8(), mat.name.c_str());
std::string diagName = hecl::Format("%s:%s", inPath.getLastComponentUTF8().data(), mat.name.c_str());
hecl::Frontend::IR matIR = FE.compileSource(mat.source, diagName);
setBackends.emplace_back();
hecl::Backend::GX& matGX = setBackends.back();
@@ -1521,7 +1521,7 @@ bool WriteHMDLCMDL(const hecl::ProjectPath& outPath, const hecl::ProjectPath& in
size_t endOff = 0;
for (const Mesh::Material& mat : mset)
{
std::string diagName = hecl::Format("%s:%s", inPath.getLastComponentUTF8(), mat.name.c_str());
std::string diagName = hecl::Format("%s:%s", inPath.getLastComponentUTF8().data(), mat.name.c_str());
targetMSet.materials.emplace_back(FE, diagName, mat, mat.iprops, texPaths);
endOff = targetMSet.materials.back().binarySize(endOff);
targetMSet.head.addMaterialEndOff(endOff);
@@ -1719,7 +1719,7 @@ bool WriteHMDLMREASecs(std::vector<std::vector<uint8_t>>& secsOut, const hecl::P
texPaths.push_back(path);
}
std::string diagName = hecl::Format("%s:%s", inPath.getLastComponentUTF8(), mat.name.c_str());
std::string diagName = hecl::Format("%s:%s", inPath.getLastComponentUTF8().data(), mat.name.c_str());
matSet.materials.emplace_back(FE, diagName, mat, mat.iprops, texPaths);
endOff = matSet.materials.back().binarySize(endOff);
matSet.head.addMaterialEndOff(endOff);

View File

@@ -56,7 +56,7 @@ template
hecl::ProjectPath UniqueIDBridge::TranslatePakIdToPath(const UniqueID64& id, bool silenceWarnings);
template <class IDType>
hecl::ProjectPath UniqueIDBridge::MakePathFromString(const std::string& str)
hecl::ProjectPath UniqueIDBridge::MakePathFromString(std::string_view str)
{
if (str.empty())
return {};
@@ -69,9 +69,9 @@ hecl::ProjectPath UniqueIDBridge::MakePathFromString(const std::string& str)
return path;
}
template
hecl::ProjectPath UniqueIDBridge::MakePathFromString<UniqueID32>(const std::string& str);
hecl::ProjectPath UniqueIDBridge::MakePathFromString<UniqueID32>(std::string_view str);
template
hecl::ProjectPath UniqueIDBridge::MakePathFromString<UniqueID64>(const std::string& str);
hecl::ProjectPath UniqueIDBridge::MakePathFromString<UniqueID64>(std::string_view str);
template <class IDType>
void UniqueIDBridge::TransformOldHashToNewHash(IDType& id)
@@ -105,7 +105,7 @@ void UniqueID32::write(athena::io::YAMLDocWriter& writer) const
if (!path)
return;
writer.writeString(nullptr, path.getAuxInfo().size() ?
(path.getRelativePathUTF8() + '|' + path.getAuxInfoUTF8()) :
(std::string(path.getRelativePathUTF8()) + '|' + path.getAuxInfoUTF8().data()) :
path.getRelativePathUTF8());
}
size_t UniqueID32::binarySize(size_t __isz) const
@@ -165,8 +165,8 @@ void AuxiliaryID32::write(athena::io::YAMLDocWriter& writer) const
return;
if (m_addExtension)
path = path.getWithExtension(m_addExtension);
hecl::SystemUTF8View ufx8AuxStr(m_auxStr);
writer.writeString(nullptr, path.getRelativePathUTF8() + '|' + ufx8AuxStr);
hecl::SystemUTF8Conv ufx8AuxStr(m_auxStr);
writer.writeString(nullptr, std::string(path.getRelativePathUTF8()) + '|' + ufx8AuxStr);
}
@@ -187,7 +187,7 @@ void UniqueID64::write(athena::io::YAMLDocWriter& writer) const
if (!path)
return;
writer.writeString(nullptr, path.getAuxInfo().size() ?
(path.getRelativePathUTF8() + '|' + path.getAuxInfoUTF8()) :
(std::string(path.getRelativePathUTF8()) + '|' + path.getAuxInfoUTF8().data()) :
path.getRelativePathUTF8());
}
size_t UniqueID64::binarySize(size_t __isz) const
@@ -223,7 +223,7 @@ void UniqueID128::write(athena::io::YAMLDocWriter& writer) const
if (!path)
return;
writer.writeString(nullptr, path.getAuxInfo().size() ?
(path.getRelativePathUTF8() + '|' + path.getAuxInfoUTF8()) :
(std::string(path.getRelativePathUTF8()) + '|' + path.getAuxInfoUTF8().data()) :
path.getRelativePathUTF8());
}
size_t UniqueID128::binarySize(size_t __isz) const

View File

@@ -130,7 +130,7 @@ public:
template <class IDType>
static hecl::ProjectPath TranslatePakIdToPath(const IDType& id, bool silenceWarnings=false);
template <class IDType>
static hecl::ProjectPath MakePathFromString(const std::string& str);
static hecl::ProjectPath MakePathFromString(std::string_view str);
template <class IDType>
static void TransformOldHashToNewHash(IDType& id);

View File

@@ -376,7 +376,7 @@ bool Cook(const hecl::BlenderConnection::DataStream::MapArea& mapaIn, const hecl
if (mapaIn.verts.size() >= 256)
{
Log.report(logvisor::Error, _S("MAPA %s vertex range exceeded [%d/%d]"),
out.getRelativePath().c_str(), mapaIn.verts.size(), 255);
out.getRelativePath().data(), mapaIn.verts.size(), 255);
return false;
}

View File

@@ -40,8 +40,8 @@ bool ReadMAPUToBlender(hecl::BlenderConnection& conn,
"\n";
hecl::ProjectPath hexPath = pakRouter.getWorking(mapu.hexMapa);
os.linkBlend(hexPath.getAbsolutePathUTF8().c_str(),
pakRouter.getBestEntryName(mapu.hexMapa).c_str());
os.linkBlend(hexPath.getAbsolutePathUTF8().data(),
pakRouter.getBestEntryName(mapu.hexMapa).data());
os << "hexMesh = bpy.data.objects['MAP'].data\n";
for (const MAPU::World& wld : mapu.worlds)
@@ -62,7 +62,7 @@ bool ReadMAPUToBlender(hecl::BlenderConnection& conn,
wldXf.xf[1].vec[0], wldXf.xf[1].vec[1], wldXf.xf[1].vec[2], wldXf.xf[1].vec[3],
wldXf.xf[2].vec[0], wldXf.xf[2].vec[1], wldXf.xf[2].vec[2], wldXf.xf[2].vec[3],
wld.hexColor.r, wld.hexColor.g, wld.hexColor.b, wld.hexColor.a,
path.getParentPath().getRelativePathUTF8().c_str());
path.getParentPath().getRelativePathUTF8().data());
int idx = 0;
for (const MAPU::Transform& hexXf : wld.hexTransforms)
{

View File

@@ -42,7 +42,7 @@ bool ReadMLVLToBlender(hecl::BlenderConnection& conn,
for (const auto& area : mlvl.areas)
{
const typename PAKRouter::EntryType* mreaEntry = pakRouter.lookupEntry(area.areaMREAId);
hecl::SystemUTF8View areaDirName(*mreaEntry->unique.m_areaName);
hecl::SystemUTF8Conv areaDirName(*mreaEntry->unique.m_areaName);
os.AABBToBMesh(area.aabb[0], area.aabb[1]);
os.format("box_mesh = bpy.data.meshes.new('''%s''')\n"
@@ -56,7 +56,7 @@ bool ReadMLVLToBlender(hecl::BlenderConnection& conn,
"box.location = mtxd[0]\n"
"box.rotation_quaternion = mtxd[1]\n"
"box.scale = mtxd[2]\n",
areaDirName.str().c_str(),
areaDirName.str().data(),
area.transformMtx[0].vec[0], area.transformMtx[0].vec[1], area.transformMtx[0].vec[2], area.transformMtx[0].vec[3],
area.transformMtx[1].vec[0], area.transformMtx[1].vec[1], area.transformMtx[1].vec[2], area.transformMtx[1].vec[3],
area.transformMtx[2].vec[0], area.transformMtx[2].vec[1], area.transformMtx[2].vec[2], area.transformMtx[2].vec[3]);

View File

@@ -151,10 +151,10 @@ void PAKRouter<BRIDGETYPE>::build(std::vector<BRIDGETYPE>& bridges, std::functio
size_t bridgeIdx = 0;
for (BRIDGETYPE& bridge : bridges)
{
const std::string& name = bridge.getName();
hecl::SystemStringView sysName(name);
const auto& name = bridge.getName();
hecl::SystemStringConv sysName(name);
hecl::SystemString::const_iterator extit = sysName.sys_str().end() - 4;
hecl::SystemStringView::const_iterator extit = sysName.sys_str().end() - 4;
hecl::SystemString baseName(sysName.sys_str().begin(), extit);
m_bridgePaths.emplace_back(std::make_pair(hecl::ProjectPath(m_gameWorking, baseName),
@@ -214,12 +214,12 @@ void PAKRouter<BRIDGETYPE>::build(std::vector<BRIDGETYPE>& bridges, std::functio
{
if (auto v = catalogWriter.enterSubVector(nullptr))
{
catalogWriter.writeString(nullptr, working.getRelativePathUTF8().c_str());
catalogWriter.writeString(nullptr, working.getAuxInfoUTF8().c_str());
catalogWriter.writeString(nullptr, working.getRelativePathUTF8());
catalogWriter.writeString(nullptr, working.getAuxInfoUTF8());
}
}
else
catalogWriter.writeString(nullptr, working.getRelativePathUTF8().c_str());
catalogWriter.writeString(nullptr, working.getRelativePathUTF8());
}
}
@@ -227,8 +227,7 @@ void PAKRouter<BRIDGETYPE>::build(std::vector<BRIDGETYPE>& bridges, std::functio
intptr_t curBridgeIdx = reinterpret_cast<intptr_t>(m_curBridgeIdx.get());
const hecl::ProjectPath& pakPath = m_bridgePaths[curBridgeIdx].first;
pakPath.makeDirChain(true);
hecl::SystemString catalogPath = hecl::ProjectPath(pakPath, "!catalog.yaml").getAbsolutePath();
athena::io::FileWriter writer(catalogPath);
athena::io::FileWriter writer(hecl::ProjectPath(pakPath, "!catalog.yaml").getAbsolutePath());
catalogWriter.finish(&writer);
}
}
@@ -264,8 +263,8 @@ hecl::ProjectPath PAKRouter<BRIDGETYPE>::getCharacterWorking(const EntryType* en
hecl::ProjectPath characterPath = getWorking(characterSearch->second.first);
if (entry->type == FOURCC('EVNT'))
{
hecl::SystemStringView wideStr(characterSearch->second.second);
return characterPath.getWithExtension((_S(".") + wideStr.sys_str()).c_str(), true);
hecl::SystemStringConv wideStr(characterSearch->second.second);
return characterPath.getWithExtension((hecl::SystemString(_S(".")) + wideStr.c_str()).c_str(), true);
}
return characterPath.ensureAuxInfo(characterSearch->second.second);
}
@@ -530,7 +529,7 @@ bool PAKRouter<BRIDGETYPE>::extractResources(const BRIDGETYPE& pakBridge, bool f
continue;
std::string bestName = getBestEntryName(*entryPtr, false);
hecl::SystemStringView bestNameView(bestName);
hecl::SystemStringConv bestNameView(bestName);
float thisFac = ++count / fsz;
progress(bestNameView.c_str(), thisFac);
@@ -548,7 +547,7 @@ bool PAKRouter<BRIDGETYPE>::extractResources(const BRIDGETYPE& pakBridge, bool f
{
cooked.makeDirChain(false);
PAKEntryReadStream s = entryPtr->beginReadStream(*node);
FILE* fout = hecl::Fopen(cooked.getAbsolutePath().c_str(), _S("wb"));
FILE* fout = hecl::Fopen(cooked.getAbsolutePath().data(), _S("wb"));
fwrite(s.data(), 1, s.length(), fout);
fclose(fout);
}

View File

@@ -18,7 +18,7 @@ struct ISTRG : BigYAML
virtual std::string getUTF8(const FourCC& lang, size_t idx) const=0;
virtual std::u16string getUTF16(const FourCC& lang, size_t idx) const=0;
virtual hecl::SystemString getSystemString(const FourCC& lang, size_t idx) const=0;
virtual int32_t lookupIdx(const std::string& name) const=0;
virtual int32_t lookupIdx(std::string_view name) const=0;
virtual void gatherDependencies(std::vector<hecl::ProjectPath>& pathsOut) const;
};

View File

@@ -544,12 +544,12 @@ bool TXTR::Extract(PAKEntryReadStream& rs, const hecl::ProjectPath& outPath)
uint16_t height = rs.readUint16Big();
uint32_t numMips = rs.readUint32Big();
FILE* fp = hecl::Fopen(outPath.getAbsolutePath().c_str(), _S("wb"));
FILE* fp = hecl::Fopen(outPath.getAbsolutePath().data(), _S("wb"));
if (!fp)
{
Log.report(logvisor::Error,
_S("Unable to open '%s' for writing"),
outPath.getAbsolutePath().c_str());
outPath.getAbsolutePath().data());
return false;
}
png_structp png = png_create_write_struct(PNG_LIBPNG_VER_STRING, nullptr, PNGErr, PNGWarn);
@@ -761,12 +761,12 @@ bool TXTR::Cook(const hecl::ProjectPath& inPath, const hecl::ProjectPath& outPat
bool TXTR::CookPC(const hecl::ProjectPath& inPath, const hecl::ProjectPath& outPath)
{
FILE* inf = hecl::Fopen(inPath.getAbsolutePath().c_str(), _S("rb"));
FILE* inf = hecl::Fopen(inPath.getAbsolutePath().data(), _S("rb"));
if (!inf)
{
Log.report(logvisor::Error,
_S("Unable to open '%s' for reading"),
inPath.getAbsolutePath().c_str());
inPath.getAbsolutePath().data());
return false;
}
@@ -776,7 +776,7 @@ bool TXTR::CookPC(const hecl::ProjectPath& inPath, const hecl::ProjectPath& outP
if (png_sig_cmp((png_const_bytep)header, 0, 8))
{
Log.report(logvisor::Error, _S("invalid PNG signature in '%s'"),
inPath.getAbsolutePath().c_str());
inPath.getAbsolutePath().data());
fclose(inf);
return false;
}
@@ -801,7 +801,7 @@ bool TXTR::CookPC(const hecl::ProjectPath& inPath, const hecl::ProjectPath& outP
if (setjmp(png_jmpbuf(pngRead)))
{
Log.report(logvisor::Error, _S("unable to initialize libpng I/O for '%s'"),
inPath.getAbsolutePath().c_str());
inPath.getAbsolutePath().data());
fclose(inf);
png_destroy_read_struct(&pngRead, &info, nullptr);
return false;
@@ -837,7 +837,7 @@ bool TXTR::CookPC(const hecl::ProjectPath& inPath, const hecl::ProjectPath& outP
if (bitDepth != 8)
{
Log.report(logvisor::Error, _S("'%s' is not 8 bits-per-channel"),
inPath.getAbsolutePath().c_str());
inPath.getAbsolutePath().data());
fclose(inf);
png_destroy_read_struct(&pngRead, &info, nullptr);
return false;
@@ -869,7 +869,7 @@ bool TXTR::CookPC(const hecl::ProjectPath& inPath, const hecl::ProjectPath& outP
break;
default:
Log.report(logvisor::Error, _S("unsupported color type in '%s'"),
inPath.getAbsolutePath().c_str());
inPath.getAbsolutePath().data());
fclose(inf);
png_destroy_read_struct(&pngRead, &info, nullptr);
return false;
@@ -890,7 +890,7 @@ bool TXTR::CookPC(const hecl::ProjectPath& inPath, const hecl::ProjectPath& outP
if (setjmp(png_jmpbuf(pngRead)))
{
Log.report(logvisor::Error, _S("unable to read image in '%s'"),
inPath.getAbsolutePath().c_str());
inPath.getAbsolutePath().data());
fclose(inf);
png_destroy_read_struct(&pngRead, &info, nullptr);
return false;
@@ -979,7 +979,7 @@ bool TXTR::CookPC(const hecl::ProjectPath& inPath, const hecl::ProjectPath& outP
{
Log.report(logvisor::Error,
_S("Unable to open '%s' for writing"),
outPath.getAbsolutePath().c_str());
outPath.getAbsolutePath().data());
return false;
}

View File

@@ -8,7 +8,7 @@ namespace DataSpec
struct ITweakGame : ITweak
{
virtual const std::string& GetWorldPrefix() const = 0;
virtual std::string_view GetWorldPrefix() const = 0;
virtual bool GetSplashScreensDisabled() const = 0;
virtual float GetFirstPersonFOV() const = 0;
virtual float GetPressStartDelay() const = 0;

View File

@@ -87,78 +87,78 @@ struct ITweakPlayerRes : ITweak
void ResolveResources(const urde::IFactory& factory)
{
x4_saveStationIcon = factory.GetResourceIdByName(_GetSaveStationIcon().c_str())->id;
x8_missileStationIcon = factory.GetResourceIdByName(_GetMissileStationIcon().c_str())->id;
xc_elevatorIcon = factory.GetResourceIdByName(_GetElevatorIcon().c_str())->id;
x4_saveStationIcon = factory.GetResourceIdByName(_GetSaveStationIcon().data())->id;
x8_missileStationIcon = factory.GetResourceIdByName(_GetMissileStationIcon().data())->id;
xc_elevatorIcon = factory.GetResourceIdByName(_GetElevatorIcon().data())->id;
x10_minesBreakFirstTopIcon = factory.GetResourceIdByName(_GetMinesBreakFirstTopIcon().c_str())->id;
x14_minesBreakFirstBottomIcon = factory.GetResourceIdByName(_GetMinesBreakFirstTopIcon().c_str())->id;
x18_minesBreakSecondTopIcon = factory.GetResourceIdByName(_GetMinesBreakFirstTopIcon().c_str())->id;
x1c_minesBreakSecondBottomIcon = factory.GetResourceIdByName(_GetMinesBreakFirstTopIcon().c_str())->id;
x10_minesBreakFirstTopIcon = factory.GetResourceIdByName(_GetMinesBreakFirstTopIcon().data())->id;
x14_minesBreakFirstBottomIcon = factory.GetResourceIdByName(_GetMinesBreakFirstTopIcon().data())->id;
x18_minesBreakSecondTopIcon = factory.GetResourceIdByName(_GetMinesBreakFirstTopIcon().data())->id;
x1c_minesBreakSecondBottomIcon = factory.GetResourceIdByName(_GetMinesBreakFirstTopIcon().data())->id;
for (int i=0 ; i<9 ; ++i)
x24_lStick[i] = factory.GetResourceIdByName(_GetLStick(i).c_str())->id;
x24_lStick[i] = factory.GetResourceIdByName(_GetLStick(i).data())->id;
for (int i=0 ; i<9 ; ++i)
x4c_cStick[i] = factory.GetResourceIdByName(_GetCStick(i).c_str())->id;
x4c_cStick[i] = factory.GetResourceIdByName(_GetCStick(i).data())->id;
for (int i=0 ; i<2 ; ++i)
x74_lTrigger[i] = factory.GetResourceIdByName(_GetLTrigger(i).c_str())->id;
x74_lTrigger[i] = factory.GetResourceIdByName(_GetLTrigger(i).data())->id;
for (int i=0 ; i<2 ; ++i)
x80_rTrigger[i] = factory.GetResourceIdByName(_GetRTrigger(i).c_str())->id;
x80_rTrigger[i] = factory.GetResourceIdByName(_GetRTrigger(i).data())->id;
for (int i=0 ; i<2 ; ++i)
x8c_startButton[i] = factory.GetResourceIdByName(_GetStartButton(i).c_str())->id;
x8c_startButton[i] = factory.GetResourceIdByName(_GetStartButton(i).data())->id;
for (int i=0 ; i<2 ; ++i)
x98_aButton[i] = factory.GetResourceIdByName(_GetAButton(i).c_str())->id;
x98_aButton[i] = factory.GetResourceIdByName(_GetAButton(i).data())->id;
for (int i=0 ; i<2 ; ++i)
xa4_bButton[i] = factory.GetResourceIdByName(_GetBButton(i).c_str())->id;
xa4_bButton[i] = factory.GetResourceIdByName(_GetBButton(i).data())->id;
for (int i=0 ; i<2 ; ++i)
xb0_xButton[i] = factory.GetResourceIdByName(_GetXButton(i).c_str())->id;
xb0_xButton[i] = factory.GetResourceIdByName(_GetXButton(i).data())->id;
for (int i=0 ; i<2 ; ++i)
xbc_yButton[i] = factory.GetResourceIdByName(_GetYButton(i).c_str())->id;
xbc_yButton[i] = factory.GetResourceIdByName(_GetYButton(i).data())->id;
xc4_ballTransitionsANCS = factory.GetResourceIdByName(_GetBallTransitionsANCS().c_str())->id;
xc4_ballTransitionsANCS = factory.GetResourceIdByName(_GetBallTransitionsANCS().data())->id;
for (int i=0 ; i<5 ; ++i)
xc8_ballTransitions[i] = factory.GetResourceIdByName(_GetBallTransitionBeamRes(i).c_str())->id;
xc8_ballTransitions[i] = factory.GetResourceIdByName(_GetBallTransitionBeamRes(i).data())->id;
for (int i=0 ; i<5 ; ++i)
xc8_cineGun[i] = factory.GetResourceIdByName(_GetBeamCineModel(i).c_str())->id;
xc8_cineGun[i] = factory.GetResourceIdByName(_GetBeamCineModel(i).data())->id;
xf0_cinematicMoveOutofIntoPlayerDistance = _GetCinematicMoveOutofIntoPlayerDistance();
}
protected:
virtual const std::string& _GetSaveStationIcon() const=0;
virtual const std::string& _GetMissileStationIcon() const=0;
virtual const std::string& _GetElevatorIcon() const=0;
virtual std::string_view _GetSaveStationIcon() const=0;
virtual std::string_view _GetMissileStationIcon() const=0;
virtual std::string_view _GetElevatorIcon() const=0;
virtual const std::string& _GetMinesBreakFirstTopIcon() const=0;
virtual const std::string& _GetMinesBreakFirstBottomIcon() const=0;
virtual const std::string& _GetMinesBreakSecondTopIcon() const=0;
virtual const std::string& _GetMinesBreakSecondBottomIcon() const=0;
virtual std::string_view _GetMinesBreakFirstTopIcon() const=0;
virtual std::string_view _GetMinesBreakFirstBottomIcon() const=0;
virtual std::string_view _GetMinesBreakSecondTopIcon() const=0;
virtual std::string_view _GetMinesBreakSecondBottomIcon() const=0;
virtual const std::string& _GetLStick(size_t idx) const=0;
virtual const std::string& _GetCStick(size_t idx) const=0;
virtual std::string_view _GetLStick(size_t idx) const=0;
virtual std::string_view _GetCStick(size_t idx) const=0;
virtual const std::string& _GetLTrigger(size_t idx) const=0;
virtual const std::string& _GetRTrigger(size_t idx) const=0;
virtual const std::string& _GetStartButton(size_t idx) const=0;
virtual const std::string& _GetAButton(size_t idx) const=0;
virtual const std::string& _GetBButton(size_t idx) const=0;
virtual const std::string& _GetXButton(size_t idx) const=0;
virtual const std::string& _GetYButton(size_t idx) const=0;
virtual std::string_view _GetLTrigger(size_t idx) const=0;
virtual std::string_view _GetRTrigger(size_t idx) const=0;
virtual std::string_view _GetStartButton(size_t idx) const=0;
virtual std::string_view _GetAButton(size_t idx) const=0;
virtual std::string_view _GetBButton(size_t idx) const=0;
virtual std::string_view _GetXButton(size_t idx) const=0;
virtual std::string_view _GetYButton(size_t idx) const=0;
virtual const std::string& _GetBallTransitionsANCS() const=0;
virtual std::string_view _GetBallTransitionsANCS() const=0;
virtual const std::string& _GetBallTransitionBeamRes(size_t idx) const=0;
virtual const std::string& _GetBeamCineModel(size_t idx) const=0;
virtual std::string_view _GetBallTransitionBeamRes(size_t idx) const=0;
virtual std::string_view _GetBeamCineModel(size_t idx) const=0;
virtual float _GetCinematicMoveOutofIntoPlayerDistance() const=0;
};

View File

@@ -8,7 +8,7 @@ namespace DataSpec
struct ITweakSlideShow : ITweak
{
virtual const std::string& GetFont() const=0;
virtual std::string_view GetFont() const=0;
virtual const zeus::CColor& GetFontColor() const=0;
virtual const zeus::CColor& GetOutlineColor() const=0;
virtual float GetScanPercentInterval() const=0;