Compare commits

...

1 Commits

Author SHA1 Message Date
Darks f079ceaf5a
Switched to CMake 2021-05-27 22:27:59 +02:00
15 changed files with 125 additions and 12 deletions

47
CMakeLists.txt Normal file
View File

@ -0,0 +1,47 @@
# Configure with [fxsdk build-fx] or [fxsdk build-cg], which provide the
# toolchain file and module path of the fxSDK
cmake_minimum_required(VERSION 3.15)
project(Touhou)
include(GenerateG1A)
include(GenerateG3A)
include(Fxconv)
find_package(Gint 2.5 REQUIRED)
find_package(LibImg 2.4 REQUIRED)
find_package(LibProf 2.4 REQUIRED)
set(SOURCES
src/main.c
src/engine.c
)
# Shared assets, fx-9860G-only assets and fx-CG-50-only assets
set(ASSETS
# ...
)
set(ASSETS_fx
# ...
)
set(ASSETS_cg
assets-cg/img/battlefields/battlefield1.png
assets-cg/img/battlefields/battlefield2.png
assets-cg/img/battlefields/battlefield3.png
assets-cg/img/bullets/bullet3_2.png
# ...
)
fxconv_declare_assets(${ASSETS} ${ASSETS_fx} ${ASSETS_cg} WITH_METADATA)
add_executable(touhou ${SOURCES} ${ASSETS} ${ASSETS_${FXSDK_PLATFORM}})
target_compile_options(touhou PRIVATE -Wall -Wextra -Os)
target_link_libraries(touhou Gint::Gint)
if("${FXSDK_PLATFORM_LONG}" STREQUAL fx9860G)
target_link_libraries(touhou -limg-fx -lprof-fx)
generate_g1a(TARGET touhou OUTPUT "Touhou.g1a"
NAME "Touhou" ICON assets-fx/icon.png)
elseif("${FXSDK_PLATFORM_LONG}" STREQUAL fxCG50)
target_link_libraries(touhou -limg-cg -lprof-cg)
generate_g3a(TARGET touhou OUTPUT "Touhou.g3a"
NAME "Touhou" ICONS assets-cg/icon-uns.png assets-cg/icon-sel.png)
endif()

Binary file not shown.

View File

@ -0,0 +1,7 @@
touhou.png:
type: font
charset: print
grid.size: ?
grid.padding: 1
proportional: true
name: font_touhou

BIN
assets-cg/fonts/touhou.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.8 KiB

View File

Before

Width:  |  Height:  |  Size: 21 KiB

After

Width:  |  Height:  |  Size: 21 KiB

View File

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 18 KiB

View File

@ -0,0 +1,11 @@
battlefield1.png:
type: bopti-image
name: img_battlefield1
battlefield2.png:
type: bopti-image
name: img_battlefield2
battlefield3.png:
type: bopti-image
name: img_battlefield3

View File

@ -0,0 +1,3 @@
bullet3_2.png:
type: bopti-image
name: img_bullet3_2

View File

@ -0,0 +1,11 @@
battlefield1.png:
type: bopti-image
name: img_battlefield1
battlefield2.png:
type: bopti-image
name: img_battlefield2
battlefield3.png:
type: bopti-image
name: img_battlefield3

View File

@ -0,0 +1,11 @@
battlefield1.png:
type: bopti-image
name: img_battlefield1
battlefield2.png:
type: bopti-image
name: img_battlefield2
battlefield3.png:
type: bopti-image
name: img_battlefield3

View File

@ -0,0 +1,11 @@
battlefield1.png:
type: bopti-image
name: img_battlefield1
battlefield2.png:
type: bopti-image
name: img_battlefield2
battlefield3.png:
type: bopti-image
name: img_battlefield3

View File

@ -0,0 +1,11 @@
battlefield1.png:
type: bopti-image
name: img_battlefield1
battlefield2.png:
type: bopti-image
name: img_battlefield2
battlefield3.png:
type: bopti-image
name: img_battlefield3

View File

@ -1,3 +1,4 @@
#include <gint/display.h>
#include <gint/keyboard.h>
#include <gint/timer.h>
#include <libprof.h>

View File

@ -3,13 +3,13 @@
#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;
extern bopti_image_t img_battlefield1;
extern bopti_image_t img_battlefield2;
extern bopti_image_t img_battlefield3;
extern bopti_image_t img_bullet3_2;
prof_clear(0);
prof_enter(0);
prof_t prof = prof_make();
prof_enter(prof);
dclear(C_BLACK);
// dimage(0, 0, &img_battlefield1);
@ -20,17 +20,17 @@ void draw() {
dimage((i*79) % 216, (i*41) % 216, &img_bullet3_2);
}
prof_leave(0);
prof_leave(prof);
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));
dprint(300, 10, C_NONE, C_NONE, "%i us", prof_time(prof));
dprint(300, 40, C_WHITE, C_NONE, "%i us", prof_time(prof));
dprint(300, 70, C_BLACK, C_NONE, "%i us", prof_time(prof));
dupdate();
}
int main(void)
{
prof_init(1, 0);
{
prof_init();
for(int i = 0; i < 100; i++) {
draw();