X-Git-Url: https://harrygodden.com/git/?a=blobdiff_plain;f=world_sfd.h;h=1b59e5a8c509cb477968473298b327b9d19def2d;hb=409edea2cf6271956137918e4e0b4f1c2addf620;hp=3f94c4ed86fae271a5948d20c521179ccf395c65;hpb=0ae443b3f6b4b753f9a2eba58da597ae8cb14b4f;p=carveJwlIkooP6JGAAIwe30JlM.git diff --git a/world_sfd.h b/world_sfd.h index 3f94c4e..1b59e5a 100644 --- a/world_sfd.h +++ b/world_sfd.h @@ -7,8 +7,10 @@ #include "world.h" +#if 0 #include "shaders/scoretext.h" #include "shaders/vblend.h" +#endif vg_tex2d tex_scoretext = { .path = "textures/scoretext.qoi", .flags = VG_TEXTURE_CLAMP|VG_TEXTURE_NEAREST }; @@ -56,22 +58,22 @@ float sfd_encode_glyph( char c ) VG_STATIC void sfd_encode( u32 row, const char *str ) { int end=0; - u32 row_h = world.sfd.h -1 -row; + u32 row_h = world_global.sfd.h -1 -row; - for( int i=0; imtx_prev.pv, pvm_prev, pvm_prev ); + + shader_scoretext_uPv( cam->mtx.pv ); + shader_scoretext_uPvmPrev( pvm_prev ); shader_scoretext_uMdl( transform ); - shader_scoretext_uCamera( camera ); + shader_scoretext_uCamera( cam->transform[3] ); for( int y=0;ymtx.pv ); + shader_vblend_uPvmPrev( pvm_prev ); + shader_vblend_uMdl( transform ); - shader_vblend_uCamera( camera ); + shader_vblend_uCamera( cam->transform[3] ); mesh_bind( &world.sfd.mesh_base ); mesh_draw( &world.sfd.mesh_base ); +#endif } VG_STATIC int world_sfd_test( int argc, const char *argv[] ) { if( argc == 2 ) { - int row = vg_min( vg_max(atoi(argv[0]),0), world.sfd.h); + int row = vg_min( vg_max(atoi(argv[0]),0), world_global.sfd.h); sfd_encode( row, argv[1] ); } @@ -156,7 +166,10 @@ VG_STATIC int world_sfd_test( int argc, const char *argv[] ) VG_STATIC void world_sfd_init(void) { vg_info( "world_sfd_init\n" ); + +#if 0 shader_scoretext_register(); +#endif vg_function_push( (struct vg_cmd){ .name = "sfd", @@ -177,11 +190,13 @@ VG_STATIC void world_sfd_init(void) m4x3f identity; m4x3_identity( identity ); + /* FIXME: dont use scene header for this you fucking idiots */ for( int i=4;i<6;i++ ) { u32 vert_start = sc->vertex_count; - scene_add_submesh( sc, mboard, card, identity ); + scene_add_mdl_submesh( sc, mboard, card, identity ); +#if 0 for( int j=0; jvertex_count; j++ ) { mdl_vert *vert = &sc->arrvertices[ vert_start+j ]; @@ -191,12 +206,13 @@ VG_STATIC void world_sfd_init(void) vert->colour[0] = 0.0f; vert->colour[1] = i*36; } +#endif } vg_acquire_thread_sync(); { - scene_upload( sc, &world.sfd.mesh_display ); - mdl_unpack_submesh( mboard, &world.sfd.mesh_base, backer ); + scene_upload( sc, &world_global.sfd.mesh_display ); + mdl_unpack_submesh( mboard, &world_global.sfd.mesh_base, backer ); vg_tex2d_init( (vg_tex2d *[]){ &tex_scoretext }, 1 ); } @@ -205,12 +221,13 @@ VG_STATIC void world_sfd_init(void) int w = 27, h = 13; - world.sfd.w = w; - world.sfd.h = h; - world.sfd.buffer = vg_linear_alloc( vg_mem.rtmemory, 2*w*h*sizeof(float) ); + world_global.sfd.w = w; + world_global.sfd.h = h; + world_global.sfd.buffer = + vg_linear_alloc( vg_mem.rtmemory, 2*w*h*sizeof(float) ); for( int i=0; i