Skip to content

Commit

Permalink
change unused depth to _depth and add my stashed changes.. oops
Browse files Browse the repository at this point in the history
  • Loading branch information
Lilaa3 committed Oct 8, 2024
1 parent abe037e commit c3dc5e1
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions fast64_internal/sm64/sm64_objects.py
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ def __init__(self, model, position, rotation, behaviour, bparam, acts, name):
self.rotation = rotation
self.name = name # to sort by when exporting

def to_c(self, depth=0):
def to_c(self, _depth=0):
if self.acts == 0x1F:
return (
"OBJECT("
Expand Down Expand Up @@ -356,7 +356,7 @@ def __init__(self, index, condition, strength, position):
self.position = position
self.name = "whirlpool" # for sorting

def to_c(self, depth=0):
def to_c(self, _depth=0):
return (
"WHIRPOOL("
+ str(self.index)
Expand All @@ -381,7 +381,7 @@ def __init__(self, preset, position, rotation, bparam):
self.position = position
self.rotation = rotation

def to_c(self, depth=0):
def to_c(self, _depth=0):
if self.bparam is None:
return (
"MACRO_OBJECT("
Expand Down Expand Up @@ -433,7 +433,7 @@ def to_binary(self):
data.extend(int(self.bparam).to_bytes(2, "big"))
return data

def to_c(self, depth=0):
def to_c(self, _depth=0):
if self.rotation is None:
return (
"SPECIAL_OBJECT("
Expand Down Expand Up @@ -485,7 +485,7 @@ def __init__(self, area, position, rotation):
self.rotation = rotation
self.name = "Mario" # for sorting

def to_c(self, depth=0):
def to_c(self, _depth=0):
return (
"MARIO_POS("
+ str(self.area)
Expand Down Expand Up @@ -605,7 +605,7 @@ def to_binary(self):
data.extend(int(round(self.height)).to_bytes(2, "big", signed=True))
return data

def to_c(self, depth=0):
def to_c(self, _depth=0):
data = (
"COL_WATER_BOX("
+ ("0x00" if self.waterBoxType == "Water" else "0x32")
Expand Down Expand Up @@ -637,7 +637,7 @@ def __init__(self, area, functionName, position, rotation, scale, emptyScale):
def to_binary(self):
raise PluginError("Binary exporting not implemented for camera volumens.")

def to_c(self, depth=0):
def to_c(self, _depth=0):
data = (
"{"
+ str(self.area)
Expand Down Expand Up @@ -690,7 +690,7 @@ def __init__(self, area, level, permaswap, functionName, position, scale, emptyS
def to_binary(self):
raise PluginError("Binary exporting not implemented for puppycam volumes.")

def to_c(self, depth=0):
def to_c(self, _depth=0):
data = (
"{"
+ str(self.level)
Expand Down Expand Up @@ -776,7 +776,7 @@ def size(self):
def to_binary(self, segmentData):
raise PluginError("Custom commands are not supported for binary exports.")

def to_c(self, tabs=""):
def to_c(self, depth=0):
assert isinstance(self.cmd, str), "Command is not str"
arg_groups = []
if self.matrix is not None:
Expand All @@ -793,7 +793,8 @@ def to_c(self, tabs=""):
if self.parameter is not None:
arg_groups.append(f"/*param*/ {self.parameter}")
if len(str(arg_groups)) > 100:
args = f",\n{tabs}\t".join(arg_groups)
seperator = ",\n" + ("\t" * (depth + 1))
args = seperator.join(arg_groups)
else:
args = ", ".join(arg_groups)
return f"{self.cmd}({args})"
Expand Down Expand Up @@ -2433,7 +2434,7 @@ def calc_offsets_from_objects(self, reverse=False):
ret.z = int(round(-difference.y * bpy.context.scene.blenderF3DScale))
return ret

def to_c(self, depth=0):
def to_c(self, _depth=0):
if self.warpType == "Instant":
offset = Vector()

Expand Down

0 comments on commit c3dc5e1

Please sign in to comment.