summaryrefslogtreecommitdiff
path: root/ZAPD/ZRoom/ZRoomCommand.cpp
diff options
context:
space:
mode:
authorAnghelo Carvajal <angheloalf95@gmail.com>2021-04-15 07:49:28 -0400
committerGitHub <noreply@github.com>2021-04-15 07:49:28 -0400
commit179af7d11fd27b046edfb1bbadade865033583d7 (patch)
tree316a55e5c0857e26184d6758a324483e029e8849 /ZAPD/ZRoom/ZRoomCommand.cpp
parent96ffc1e62720f0f43eb4885e6e7dbaf76a2f6cd2 (diff)
Rename "Prerender" to "Background", properly extract PolygonType1 multi format and change some structs used. (#107)
* Extract BgImage Signed-off-by: angie <angheloalf95@gmail.com> * improve the output a bit Signed-off-by: angie <angheloalf95@gmail.com> * extract backgrounds for multipoly Signed-off-by: angie <angheloalf95@gmail.com> * Extract the dlists of PolygonDlist Signed-off-by: angie <angheloalf95@gmail.com> * commands in the next line Signed-off-by: angie <angheloalf95@gmail.com> * Move a lot of repeated code into a class Signed-off-by: angie <angheloalf95@gmail.com> * Use PolygonDlist instead of MeshEntry0 Signed-off-by: angie <angheloalf95@gmail.com> * Rename prerender to background Signed-off-by: angie <angheloalf95@gmail.com> * format Signed-off-by: angie <angheloalf95@gmail.com> * last cleanup Signed-off-by: angie <angheloalf95@gmail.com> * Handle jpg padding Signed-off-by: angie <angheloalf95@gmail.com> * Add a few checks and warnings for jpeg validity Signed-off-by: Angie <angheloalf95@gmail.com> * typo Signed-off-by: Angie <angheloalf95@gmail.com> * fix merge error Signed-off-by: angie <angheloalf95@gmail.com> * Fix background extraction that somehow was broken Signed-off-by: angie <angheloalf95@gmail.com> * re-add the trailling line feed Signed-off-by: angie <angheloalf95@gmail.com> * add trailing line feed again Signed-off-by: angie <angheloalf95@gmail.com> * fix an already fixed warning Signed-off-by: angie <angheloalf95@gmail.com> * fix crash when no config file is provided * run format
Diffstat (limited to 'ZAPD/ZRoom/ZRoomCommand.cpp')
-rw-r--r--ZAPD/ZRoom/ZRoomCommand.cpp9
1 files changed, 2 insertions, 7 deletions
diff --git a/ZAPD/ZRoom/ZRoomCommand.cpp b/ZAPD/ZRoom/ZRoomCommand.cpp
index 8d3baeb..370e198 100644
--- a/ZAPD/ZRoom/ZRoomCommand.cpp
+++ b/ZAPD/ZRoom/ZRoomCommand.cpp
@@ -1,4 +1,5 @@
#include "ZRoomCommand.h"
+#include "StringHelper.h"
using namespace std;
@@ -11,13 +12,7 @@ ZRoomCommand::ZRoomCommand(ZRoom* nZRoom, std::vector<uint8_t> rawData, int rawD
string ZRoomCommand::GenerateSourceCodePass1(string roomName, int baseAddress)
{
- char line[2048];
-
- // sprintf(line, "%s _%s_set%04X_cmd%02X = { 0x%02X,", GetCommandCName().c_str(),
- // roomName.c_str(), baseAddress, cmdIndex, cmdID);
- sprintf(line, " 0x%02X,", (uint8_t)cmdID);
-
- return string(line);
+ return StringHelper::Sprintf("0x%02X,", (uint8_t)cmdID);
}
string ZRoomCommand::GenerateSourceCodePass2(string roomName, int baseAddress)