diff --git a/.gitignore b/.gitignore index f47f8fe..bd44142 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,9 @@ +# Gimp tests files assets-raw/*.xcf + +# Auto-built sprites +*_tmp.png + +# Build directories +build-fx/* +build-cg/* diff --git a/Makefile b/Makefile index 861a60b..aab0bac 100644 --- a/Makefile +++ b/Makefile @@ -66,8 +66,10 @@ src := $(wildcard src/*.[csS] \ src/*/*.[csS] \ src/*/*/*.[csS] \ src/*/*/*/*.[csS]) -assets-fx := $(wildcard assets-fx/*/*) -assets-cg := $(wildcard assets-cg/*/*) +assets-fx := $(wildcard assets-fx/*/*.png \ + assets-fx/*/*/*.png) +assets-cg := $(wildcard assets-cg/*/*.png \ + assets-cg/*/*/*.png) # Object files obj-fx := $(src:%=build-fx/%.o) \ @@ -139,7 +141,7 @@ build-fx/assets/img/%.o: assets-fx/img/% fxconv --bopti-image $< -o $@ $(FXCONVFX) name:img_$(basename $*) $(IMG.$*) build-cg/assets/img/%.o: assets-cg/img/% @ mkdir -p $(dir $@) - fxconv --bopti-image $< -o $@ $(FXCONVCG) name:img_$(basename $*) $(IMG.$*) profile:p4 + fxconv --bopti-image $< -o $@ $(FXCONVCG) name:img_$(notdir $(basename $*)) $(IMG.$*) profile:p4 # Fonts build-fx/assets/fonts/%.o: assets-fx/fonts/% @@ -147,7 +149,8 @@ build-fx/assets/fonts/%.o: assets-fx/fonts/% fxconv -f $< -o $@ $(FXCONVFX) name:font_$(basename $*) $(FONT.$*) build-cg/assets/fonts/%.o: assets-cg/fonts/% @ mkdir -p $(dir $@) - fxconv -f $< -o $@ $(FXCONVCG) name:font_$(basename $*) $(FONT.$*) + fxconv -f $< -o $@ $(FXCONVCG) name:font_$(basename $*) $(FONT.$*) \ + charset:print grid.size:14x14 grid.padding:0 propotional:true profile:p4 # Binaries build-fx/assets/bin/%.o: assets-fx/bin/% diff --git a/Touhou.g3a b/Touhou.g3a index 7a0e4da..ef5e64a 100644 Binary files a/Touhou.g3a and b/Touhou.g3a differ diff --git a/project.cfg b/project.cfg index ae722a9..e883742 100644 --- a/project.cfg +++ b/project.cfg @@ -9,7 +9,7 @@ NAME := Touhou # Internal name, should be '@' followed by at most 7 uppercase letters. # WARNING: If this convention is not followed, the add-in might not appear in # the main menu of the calculator! -INTERNAL := TOUHOU +INTERNAL := @TOUHOU # Output file name. The default is to take , replace spaces with dashes, # and add .g1a (or .g3a). You can specify a different folder if you want. @@ -60,8 +60,8 @@ INCLUDE := -I include # Libraries. Add one -l option for each library you are using, and also # suitable -L options if you have library files in custom folders. To use # fxlib, add libfx.a to the project directory and use "-L . -lfx". -LIBS_FX := -LIBS_CG := +LIBS_FX := -lprof +LIBS_CG := -lprof # Base linker flags for the fxSDK, you usually want to keep these. LDFLAGS_FX := -T fx9860g.ld -lgint-fx $(LIBS_FX) -lgint-fx -lgcc diff --git a/src/main.c b/src/main.c index f30ff85..7bf7ff0 100644 --- a/src/main.c +++ b/src/main.c @@ -1,17 +1,47 @@ #include #include +#include + +void draw() { + extern image_t img_battlefield1; + extern image_t img_battlefield2; + extern image_t img_battlefield3; + extern image_t img_bullet3_2; + + prof_clear(0); + prof_enter(0); + + dclear(C_BLACK); + // dimage(0, 0, &img_battlefield1); + // dimage(0, 0, &img_battlefield2); + dimage(0, 0, &img_battlefield3); + + for(int i = 0; i < 2000; i++) { + dimage((i*79) % 216, (i*41) % 216, &img_bullet3_2); + } + + prof_leave(0); + + dprint(300, 10, C_NONE, C_NONE, "%i us", prof_time(0)); + dprint(300, 40, C_WHITE, C_NONE, "%i us", prof_time(0)); + dprint(300, 70, C_BLACK, C_NONE, "%i us", prof_time(0)); + dupdate(); +} int main(void) { - extern image_t img_bg; + extern font_t font_touhou; + prof_init(1, 0); - dclear(C_WHITE); - dtext(1, 1, "Sample fxSDK add-in.", C_BLACK, C_NONE); + // dfont(&font_touhou); - dimage(20, 0, &img_bg); - - dupdate(); + for(int i = 0; i < 100; i++) { + draw(); + } getkey(); + + prof_quit(); + return 1; }