diff --git a/fast64_internal/oot/cutscene/classes.py b/fast64_internal/oot/cutscene/classes.py index bdfc5ebb3..9efd0ecc8 100644 --- a/fast64_internal/oot/cutscene/classes.py +++ b/fast64_internal/oot/cutscene/classes.py @@ -7,6 +7,10 @@ from .motion.utility import getBlenderPosition, getBlenderRotation, getRotation, getInteger +def cs_import_float(v_str: str): + return float(v_str.removesuffix("f")) + + # NOTE: ``paramNumber`` is the expected number of parameters inside the parsed commands, # this account for the unused parameters. Every classes are based on the commands arguments from ``z64cutscene_commands.h`` @@ -47,7 +51,7 @@ def __post_init__(self): self.continueFlag = self.params[0] self.camRoll = getInteger(self.params[1]) self.frame = getInteger(self.params[2]) - self.viewAngle = float(self.params[3][:-1]) + self.viewAngle = cs_import_float(self.params[3]) self.pos = [getInteger(self.params[4]), getInteger(self.params[5]), getInteger(self.params[6])] diff --git a/fast64_internal/oot/cutscene/exporter/classes.py b/fast64_internal/oot/cutscene/exporter/classes.py index c038de11b..f655b5483 100644 --- a/fast64_internal/oot/cutscene/exporter/classes.py +++ b/fast64_internal/oot/cutscene/exporter/classes.py @@ -32,6 +32,10 @@ ) +def cs_export_float(v: float): + return f"{v:f}f" + + class CutsceneCmdToC: """This class contains functions to create the cutscene commands""" @@ -102,7 +106,7 @@ def getActorCueCmd(self, actorCue: CutsceneCmdActorCue, isPlayerActor: bool): + "".join(f"{rot}, " for rot in actorCue.rot) + "".join(f"{pos}, " for pos in actorCue.startPos) + "".join(f"{pos}, " for pos in actorCue.endPos) - + "0.0f, 0.0f, 0.0f),\n" + + f"{cs_export_float(0)}, {cs_export_float(0)}, {cs_export_float(0)}),\n" ) def getCamListCmd(self, cmdName: str, startFrame: int, endFrame: int): @@ -133,7 +137,7 @@ def getCamATCmd(self, camAT: CutsceneCmdCamAT): def getCamPointCmd(self, camPoint: CutsceneCmdCamPoint): return indent * 3 + ( f"CS_CAM_POINT(" - + f"{camPoint.continueFlag}, {camPoint.camRoll}, {camPoint.frame}, {camPoint.viewAngle}f, " + + f"{camPoint.continueFlag}, {camPoint.camRoll}, {camPoint.frame}, {cs_export_float(camPoint.viewAngle)}, " + "".join(f"{pos}, " for pos in camPoint.pos) + "0),\n" )