X-Git-Url: https://harrygodden.com/git/?a=blobdiff_plain;ds=sidebyside;f=world_sfd.h;h=c6fa66b0fdb49942485fb85c8fb3ab022fc22132;hb=86dbcd5796ed674ca9433cce1ace8bef322cd121;hp=71fee37a59acacd60417f7bd0e3bd52c321c9f00;hpb=4a883ac1b2506032f9dddab342712de46f2ca734;p=carveJwlIkooP6JGAAIwe30JlM.git diff --git a/world_sfd.h b/world_sfd.h index 71fee37..c6fa66b 100644 --- a/world_sfd.h +++ b/world_sfd.h @@ -1,8 +1,6 @@ #ifndef SFD_H #define SFD_H -#include "common.h" -#include "model.h" #include "world.h" #include "shaders/scoretext.h" @@ -11,25 +9,9 @@ vg_tex2d tex_scoretext = { .path = "textures/scoretext.qoi", .flags = VG_TEXTURE_CLAMP|VG_TEXTURE_NEAREST }; -struct sfd_instance -{ - float *buffer; - - u32 w,h; -}; - - -struct subworld_sfd -{ - scene mesh; - mdl_submesh *sm_module, *sm_card; - glmesh temp; - - struct sfd_instance tester; -}; - -static struct subworld_sfd *subworld_sfd(void); - +/* + * TODO: utf-8 -> ascii + */ float sfd_encode_glyph( char c ) { @@ -120,7 +102,7 @@ static void sfd_update( struct sfd_instance *display ) static void sfd_render( struct sfd_instance *display, m4x4f projection, v3f camera, m4x3f transform ) { - struct subworld_sfd *sfd = subworld_sfd(); + struct subworld_sfd *sfd = &world.sfd; scene_bind( &sfd->mesh ); shader_scoretext_use(); @@ -160,7 +142,7 @@ static void sfd_render( struct sfd_instance *display, static int world_sfd_test( int argc, const char *argv[] ) { - struct subworld_sfd *sfd = subworld_sfd(); + struct subworld_sfd *sfd = &world.sfd; if( argc == 2 ) { @@ -173,7 +155,7 @@ static int world_sfd_test( int argc, const char *argv[] ) static void world_sfd_init(void) { - struct subworld_sfd *sfd = subworld_sfd(); + struct subworld_sfd *sfd = &world.sfd; vg_function_push( (struct vg_cmd){ .name = "sfd", @@ -216,7 +198,7 @@ static void world_sfd_init(void) free( mboard ); vg_tex2d_init( (vg_tex2d *[]){ &tex_scoretext }, 1 ); - sfd_new( &sfd->tester, 16, 8 ); + sfd_new( &sfd->tester, 27, 13 ); } static void world_sfd_register(void)