Inspection for Animation component
This commit is contained in:
@@ -222,7 +222,7 @@ class EnumWriter:
|
||||
def output_enum_tile_size(self, func_name):
|
||||
writer = self.writer
|
||||
writer.output(
|
||||
f"static {self.enum_type} {func_name}({self.enum_type} type, BzTileID *outWidth, BzTileID *outHeight) ")
|
||||
f"static {self.enum_type} {func_name}({self.enum_type} type, i32 *outWidth, i32 *outHeight) ")
|
||||
writer.block_start()
|
||||
|
||||
writer.output("switch (type) ")
|
||||
@@ -330,7 +330,22 @@ class EnumWriter:
|
||||
def output_anim_enum(self):
|
||||
writer = self.writer
|
||||
writer.enum_list(self.anim_type, self.animations)
|
||||
pass
|
||||
|
||||
def output_anim_enum_to_str(self, func_name):
|
||||
writer = self.writer
|
||||
writer.output(f"static const char *{func_name}({self.anim_type} type) ")
|
||||
writer.block_start()
|
||||
|
||||
writer.output("switch (type) ")
|
||||
writer.block_start()
|
||||
|
||||
for name in self.animations:
|
||||
writer.output(f"case {name}: return \"{name}\";\n")
|
||||
writer.output(f"default: return NULL;\n")
|
||||
|
||||
writer.block_end()
|
||||
writer.block_end()
|
||||
writer.empty_line()
|
||||
|
||||
def output_has_anim(self, func_name):
|
||||
writer = self.writer
|
||||
|
||||
Reference in New Issue
Block a user