From baec38c80e66734e752d9b5fe603e244a3589259 Mon Sep 17 00:00:00 2001 From: jaburns Date: Mon, 19 Oct 2020 13:03:51 -0600 Subject: [PATCH] Clean up python script --- Makefile | 2 +- import-mario-geo.py | 11 +++-------- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/Makefile b/Makefile index 29aa889..29fcb0e 100644 --- a/Makefile +++ b/Makefile @@ -31,7 +31,7 @@ $(BUILD_DIR)/%.o: %.c $(BIN_FILE): $(O_FILES) $(CC) $(LDFLAGS) -o $@ $^ -dist/include/libsm64.h: src/libsm64.h +$(LIB_H_FILE): src/libsm64.h cp -f $< $@ all: $(BIN_FILE) $(LIB_H_FILE) diff --git a/import-mario-geo.py b/import-mario-geo.py index b57be25..250dfb6 100755 --- a/import-mario-geo.py +++ b/import-mario-geo.py @@ -48,6 +48,7 @@ extern void *mario_geo_ptr; model_inc_h = """ #pragma once + #include "../include/types.h" #include "../include/PR/gbi.h" """ @@ -74,16 +75,10 @@ def main(): if skip > 0: skip = skip - 1 lines[i] = "//" + lines[i] - continue - - if lines[i].startswith("ALIGNED8 static const u8 mario_"): + elif lines[i].startswith("ALIGNED8 static const u8 mario_"): skip = 2 lines[i] = "//" + lines[i] - continue - - lines[i] = lines[i].replace("#include", "//#include") - lines[i] = lines[i].replace("ALIGNED8 static const u8 mario", "static const u8 xxx") - if lines[i].startswith("const "): + elif lines[i].startswith("const "): model_inc_h += "\nextern " + lines[i].replace(" = {", ";") lines.insert(0, "#include \"../gfx_macros.h\"")