Worked on some tests.

Performance should not be a problem o/
This commit is contained in:
Darks 2020-05-31 00:12:26 +02:00
parent 83b71d2b74
commit 5a25ec324e
Signed by: Darks
GPG Key ID: F61F10FA138E797C
5 changed files with 54 additions and 13 deletions

8
.gitignore vendored
View File

@ -1 +1,9 @@
# Gimp tests files
assets-raw/*.xcf
# Auto-built sprites
*_tmp.png
# Build directories
build-fx/*
build-cg/*

View File

@ -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/%

Binary file not shown.

View File

@ -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 <NAME>, 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

View File

@ -1,17 +1,47 @@
#include <gint/display.h>
#include <gint/keyboard.h>
#include <libprof.h>
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;
}