From 769f5702a422d14bfb0a60a39319da4b4bf9ec1f Mon Sep 17 00:00:00 2001 From: Anghelo Carvajal Date: Mon, 10 May 2021 12:25:39 -0400 Subject: ZRoom refactor (#124) * Remove redundant methods * first pass os cleaning * More cleaning * Fix compilation errors * Fix dumb crashes * Fix dumb issues * Removing most uses of GenerateSourceCodePass1 * more cleanup * Move segmentOffset to ZRoomCommand * Half of ParseRawData * somehow broken... * fix broken stuff * This may or may not be broken * More cleaning * Remove GenerateSourceCodePass2 * More cleanup and pointer removal * Use PolygonType2 in SetMesh * another small cleanup * Merge PolygonDlist and PolygonDlist2 * More code merging * GetDeclarationPtrName * Remove most repeated externs and a bit of redundant code * Dumb MM fixes * small fix (cherry picked from commit 0813fd69538491c5aceb00d79d19bf59fd082ca7) * Another dumb fix * Remove GenerateExterns * Change DeclareReferences signature * Refactor SetAnimatedTextureList * const std::vector& * another small bunch of changes * last parserawdata and declarereferences separation probably * Move parserawdata * Remove GenerateSourceCodePass1 * Use macros for commands * Make ZRoomCommand inherit ZResource * shrink scenes tluts * ProcessTextureIntersections * small output improvements * Small changes * run format * SCENE_CMD -> SCENECMD * fix merge errors * run format * fix some warnings * update macros names * Add again different commands for each game ni SCENE_CMD_ROOM_BEHAVIOR * macro update * More booleans * Move declaration to its own file * minor changes * Update according to latest reviews in oot * run format * Yet another cutscene change * Remove special scene/room segment code * This is crashing and I don't know why * remove includeFilePrefix * fix merge issues * always pass a parent to zresource * move path to its own zclass and properly implement parserawdata in commands * Fix GetDeclarationPtrName uses * Some ZPath fixes (still broken tho) * Fix ZPath declarations * Fix weird problem * Add `Path` to the docs * run format * clean syotes code * A bunch of changes for MM * run format --- ZAPD/ZRoom/Commands/SetCameraSettings.cpp | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) (limited to 'ZAPD/ZRoom/Commands/SetCameraSettings.cpp') diff --git a/ZAPD/ZRoom/Commands/SetCameraSettings.cpp b/ZAPD/ZRoom/Commands/SetCameraSettings.cpp index b377107..fb41b88 100644 --- a/ZAPD/ZRoom/Commands/SetCameraSettings.cpp +++ b/ZAPD/ZRoom/Commands/SetCameraSettings.cpp @@ -1,20 +1,23 @@ #include "SetCameraSettings.h" -#include "../../BitConverter.h" -#include "../../StringHelper.h" -SetCameraSettings::SetCameraSettings(ZRoom* nZRoom, std::vector rawData, - uint32_t rawDataIndex) - : ZRoomCommand(nZRoom, rawData, rawDataIndex) +#include "BitConverter.h" +#include "StringHelper.h" + +SetCameraSettings::SetCameraSettings(ZFile* nParent) : ZRoomCommand(nParent) { - cameraMovement = rawData[rawDataIndex + 0x01]; - mapHighlight = BitConverter::ToInt32BE(rawData, rawDataIndex + 4); } -std::string SetCameraSettings::GenerateSourceCodePass1(std::string roomName, uint32_t baseAddress) +void SetCameraSettings::ParseRawData() { - return StringHelper::Sprintf( - "%s 0x%02X, 0x%08X", ZRoomCommand::GenerateSourceCodePass1(roomName, baseAddress).c_str(), - cameraMovement, mapHighlight); + ZRoomCommand::ParseRawData(); + cameraMovement = cmdArg1; + mapHighlight = BitConverter::ToUInt32BE(parent->GetRawData(), rawDataIndex + 4); +} + +std::string SetCameraSettings::GetBodySourceCode() const +{ + return StringHelper::Sprintf("SCENE_CMD_MISC_SETTINGS(0x%02X, 0x%08X)", cameraMovement, + mapHighlight); } std::string SetCameraSettings::GetCommandCName() const @@ -25,4 +28,4 @@ std::string SetCameraSettings::GetCommandCName() const RoomCommand SetCameraSettings::GetRoomCommand() const { return RoomCommand::SetCameraSettings; -} \ No newline at end of file +} -- cgit v1.2.3