summaryrefslogtreecommitdiff
path: root/ZAPD/ZCutscene.cpp
diff options
context:
space:
mode:
authorlouist103 <35883445+louist103@users.noreply.github.com>2021-10-11 14:05:18 -0400
committerGitHub <noreply@github.com>2021-10-11 14:05:18 -0400
commit1c687a69c1f6b84a3fea1bcab8e141f8a26e16dc (patch)
treeaef5f75cefb24ad9d77a7c69776b6df6eba004b5 /ZAPD/ZCutscene.cpp
parent4994e732406ffa2942f9c9ea6ff14c424cd0b896 (diff)
string -> const string& and more (#199)
* all possible strings use const & and make some strings const char* * remove ='' from new strings * formatter * revert globals * Fix warning (error)
Diffstat (limited to 'ZAPD/ZCutscene.cpp')
-rw-r--r--ZAPD/ZCutscene.cpp34
1 files changed, 17 insertions, 17 deletions
diff --git a/ZAPD/ZCutscene.cpp b/ZAPD/ZCutscene.cpp
index 1157f08..f3621d0 100644
--- a/ZAPD/ZCutscene.cpp
+++ b/ZAPD/ZCutscene.cpp
@@ -87,7 +87,7 @@ CutsceneCommandSceneTransFX::~CutsceneCommandSceneTransFX()
std::string ZCutscene::GetBodySourceCode() const
{
- std::string output = "";
+ std::string output;
uint32_t curPtr = 0;
output += StringHelper::Sprintf(" CS_BEGIN_CUTSCENE(%i, %i),\n", commands.size(), endFrame);
@@ -492,10 +492,10 @@ std::string CutsceneCommandSetCameraPos::GetCName()
std::string CutsceneCommandSetCameraPos::GenerateSourceCode([[maybe_unused]] uint32_t baseAddress)
{
- std::string result = "";
+ std::string result;
- std::string listStr = "";
- std::string posStr = "";
+ std::string listStr;
+ std::string posStr;
if (commandID == (int32_t)CutsceneCommands::SetCameraFocus)
{
@@ -583,7 +583,7 @@ std::string CutsceneCommandFadeBGM::GetCName()
std::string CutsceneCommandFadeBGM::GenerateSourceCode([[maybe_unused]] uint32_t baseAddress)
{
- std::string result = "";
+ std::string result;
result += StringHelper::Sprintf("CS_FADE_BGM_LIST(%i),\n", entries.size());
@@ -636,7 +636,7 @@ CutsceneCommandPlayBGM::CutsceneCommandPlayBGM(const std::vector<uint8_t>& rawDa
std::string CutsceneCommandPlayBGM::GenerateSourceCode([[maybe_unused]] uint32_t baseAddress)
{
- std::string result = "";
+ std::string result;
result += StringHelper::Sprintf("CS_PLAY_BGM_LIST(%i),\n", entries.size());
@@ -679,7 +679,7 @@ CutsceneCommandStopBGM::CutsceneCommandStopBGM(const std::vector<uint8_t>& rawDa
std::string CutsceneCommandStopBGM::GenerateSourceCode([[maybe_unused]] uint32_t baseAddress)
{
- std::string result = "";
+ std::string result;
result += StringHelper::Sprintf("CS_STOP_BGM_LIST(%i),\n", entries.size());
@@ -737,7 +737,7 @@ CutsceneCommandEnvLighting::CutsceneCommandEnvLighting(const std::vector<uint8_t
std::string CutsceneCommandEnvLighting::GenerateSourceCode([[maybe_unused]] uint32_t baseAddress)
{
- std::string result = "";
+ std::string result;
result += StringHelper::Sprintf("CS_LIGHTING_LIST(%i),\n", entries.size());
@@ -793,7 +793,7 @@ CutsceneCommandUnknown9::CutsceneCommandUnknown9(const std::vector<uint8_t>& raw
std::string CutsceneCommandUnknown9::GenerateSourceCode([[maybe_unused]] uint32_t baseAddress)
{
- std::string result = "";
+ std::string result;
result += StringHelper::Sprintf("CS_CMD_09_LIST(%i),\n", entries.size());
@@ -851,7 +851,7 @@ CutsceneCommandUnknown::CutsceneCommandUnknown(const std::vector<uint8_t>& rawDa
std::string CutsceneCommandUnknown::GenerateSourceCode([[maybe_unused]] uint32_t baseAddress)
{
- std::string result = "";
+ std::string result;
result += StringHelper::Sprintf("CS_UNK_DATA_LIST(0x%02X, %i),\n", commandID, entries.size());
@@ -909,7 +909,7 @@ std::string CutsceneCommandDayTime::GetCName()
std::string CutsceneCommandDayTime::GenerateSourceCode([[maybe_unused]] uint32_t baseAddress)
{
- std::string result = "";
+ std::string result;
result += StringHelper::Sprintf("CS_TIME_LIST(%i),\n", entries.size());
@@ -960,7 +960,7 @@ std::string CutsceneCommandTextbox::GetCName()
std::string CutsceneCommandTextbox::GenerateSourceCode([[maybe_unused]] uint32_t baseAddress)
{
- std::string result = "";
+ std::string result;
result += StringHelper::Sprintf("CS_TEXT_LIST(%i),\n", entries.size());
@@ -1026,8 +1026,8 @@ CutsceneCommandActorAction::CutsceneCommandActorAction(const std::vector<uint8_t
std::string CutsceneCommandActorAction::GenerateSourceCode([[maybe_unused]] uint32_t baseAddress)
{
- std::string result = "";
- std::string subCommand = "";
+ std::string result;
+ std::string subCommand;
if (commandID == 10)
{
@@ -1083,7 +1083,7 @@ std::string CutsceneCommandTerminator::GetCName()
std::string CutsceneCommandTerminator::GenerateSourceCode([[maybe_unused]] uint32_t baseAddress)
{
- std::string result = "";
+ std::string result;
result += StringHelper::Sprintf("CS_TERMINATOR(0x%04X, %i, %i),\n", base, startFrame, endFrame);
@@ -1105,7 +1105,7 @@ CutsceneCommandEnd::CutsceneCommandEnd(const std::vector<uint8_t>& rawData, uint
std::string CutsceneCommandEnd::GenerateSourceCode([[maybe_unused]] uint32_t baseAddress)
{
- std::string result = "";
+ std::string result;
result += StringHelper::Sprintf("CS_END(),\n");
@@ -1159,7 +1159,7 @@ CutsceneCommandSpecialAction::CutsceneCommandSpecialAction(const std::vector<uin
std::string CutsceneCommandSpecialAction::GenerateSourceCode([[maybe_unused]] uint32_t baseAddress)
{
- std::string result = "";
+ std::string result;
result += StringHelper::Sprintf("CS_MISC_LIST(%i),\n", entries.size());