diff --git a/Support/include/FontWriter/Type/types.hpp b/Support/include/FontWriter/Type/types.hpp new file mode 100644 index 00000000..d3453350 --- /dev/null +++ b/Support/include/FontWriter/Type/types.hpp @@ -0,0 +1,9 @@ +#pragma once +#include + +namespace JabyEngine { + struct FontInfo { + GPU::SizeU16 VRAMSize; + GPU::SizeU16 FontSize; + }; +} diff --git a/Support/include/FontWriter/default_font.hpp b/Support/include/FontWriter/default_font.hpp new file mode 100644 index 00000000..1f1bbd15 --- /dev/null +++ b/Support/include/FontWriter/default_font.hpp @@ -0,0 +1,13 @@ +#pragma once +#include "Type/types.hpp" + +namespace JabyEngine { + struct DefaultFont { + static constexpr auto Info = FontInfo { + .VRAMSize = {64, 80}, + .FontSize = {12, 16} + }; + + static void load(GPU::PositionU16 vram_dst); + }; +} \ No newline at end of file diff --git a/Support/include/FontWriter/font_writer.hpp b/Support/include/FontWriter/font_writer.hpp index be1cdbc1..74d6f80f 100644 --- a/Support/include/FontWriter/font_writer.hpp +++ b/Support/include/FontWriter/font_writer.hpp @@ -1,3 +1,8 @@ #pragma once +#include "Type/types.hpp" -void test(); \ No newline at end of file +namespace JabyEngine { + struct FontWriter { + static void setup(GPU::PositionU16 vram_pos, const FontInfo& font_info); + }; +} \ No newline at end of file diff --git a/Support/src/.gitignore b/Support/src/.gitignore new file mode 100644 index 00000000..967f7555 --- /dev/null +++ b/Support/src/.gitignore @@ -0,0 +1 @@ +FontWriter/src/default_font_data.hpp \ No newline at end of file diff --git a/Support/src/FontWriter/Makefile b/Support/src/FontWriter/Makefile index 2ac085be..8a452fc0 100644 --- a/Support/src/FontWriter/Makefile +++ b/Support/src/FontWriter/Makefile @@ -4,6 +4,8 @@ include $(JABY_ENGINE_DIR)/mkfile/RebuildTarget.mk ARTIFACT = libFontWriter BUILD_DIR = bin +DEFAULT_FONT_IMAGE = src/default_font_data.hpp + CCFLAGS += -I../../include -I$(JABY_ENGINE_DIR)/include CCFLAGS += -save-temps=obj @@ -18,6 +20,9 @@ LIB_OBJS = $(filter-out $(MAIN_BOOT_OBJ) $(OVERLAY_BOOT_OBJ),$(OBJS)) #$(info $$var is [${MAIN_BOOT_OBJ}]) #$(info $$var2 is [${LIB_OBJS}]) +$(DEFAULT_FONT_IMAGE): ressources/DefaultFont.png + jaby_engine_fconv --lz4 $< simple-tim clut4 | cpp_out --name default_font_data -o $@ + #Linking rule $(TARGET).a: $(LIB_OBJS) @mkdir -p $(dir $@) @@ -29,7 +34,7 @@ $(LIB_DIR)/$(ARTIFACT).a: $(TARGET).a cp $(TARGET).a $(LIB_DIR)/$(ARTIFACT).a #Rules section for default compilation and linking -all: $(LIB_DIR)/$(ARTIFACT).a +all: $(DEFAULT_FONT_IMAGE) $(LIB_DIR)/$(ARTIFACT).a clean: rm -fr $(OUTPUT_DIR) diff --git a/Support/src/FontWriter/ressources/DefaultFont.png b/Support/src/FontWriter/ressources/DefaultFont.png new file mode 100644 index 00000000..ff9aa423 --- /dev/null +++ b/Support/src/FontWriter/ressources/DefaultFont.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6e00f5567fb753ed56959073d37ca4fbd2891bd5f6ff3e8097d16597474d4091 +size 2971 diff --git a/Support/src/FontWriter/src/FontWriter.cpp b/Support/src/FontWriter/src/FontWriter.cpp deleted file mode 100644 index b9dc5df3..00000000 --- a/Support/src/FontWriter/src/FontWriter.cpp +++ /dev/null @@ -1,6 +0,0 @@ -#include -#include - -void test() { - printf("Hello Planschi c:\n"); -} diff --git a/Support/src/FontWriter/src/default_font.cpp b/Support/src/FontWriter/src/default_font.cpp new file mode 100644 index 00000000..19814531 --- /dev/null +++ b/Support/src/FontWriter/src/default_font.cpp @@ -0,0 +1,9 @@ +#include "default_font_data.hpp" +#include +#include + +namespace JabyEngine { + void DefaultFont :: load(GPU::PositionU16 vram_dst) { + printf("Loading DefaultFont @0x%p -> %lu\n", default_font_data, sizeof(default_font_data)); + } +} \ No newline at end of file diff --git a/Support/src/FontWriter/src/font_writer.cpp b/Support/src/FontWriter/src/font_writer.cpp new file mode 100644 index 00000000..5a77a50c --- /dev/null +++ b/Support/src/FontWriter/src/font_writer.cpp @@ -0,0 +1,8 @@ +#include +#include + +namespace JabyEngine { + void FontWriter :: setup(GPU::PositionU16 vram_pos, const FontInfo& font_info) { + printf("Hello Planschi c:\n"); + } +} \ No newline at end of file