projects
/
carveJwlIkooP6JGAAIwe30JlM.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
timings
[carveJwlIkooP6JGAAIwe30JlM.git]
/
world_sfd.h
diff --git
a/world_sfd.h
b/world_sfd.h
index d7aeb552fb55b585131a33ec3327007b09f63f2a..88a86396e5fd700fdaef3fc0108dcf3301c94cb3 100644
(file)
--- a/
world_sfd.h
+++ b/
world_sfd.h
@@
-7,8
+7,11
@@
#include "world.h"
#include "world.h"
+#if 0
+#if 0
#include "shaders/scoretext.h"
#include "shaders/vblend.h"
#include "shaders/scoretext.h"
#include "shaders/vblend.h"
+#endif
vg_tex2d tex_scoretext = { .path = "textures/scoretext.qoi",
.flags = VG_TEXTURE_CLAMP|VG_TEXTURE_NEAREST };
vg_tex2d tex_scoretext = { .path = "textures/scoretext.qoi",
.flags = VG_TEXTURE_CLAMP|VG_TEXTURE_NEAREST };
@@
-56,22
+59,22
@@
float sfd_encode_glyph( char c )
VG_STATIC void sfd_encode( u32 row, const char *str )
{
int end=0;
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; i<world.sfd.w; i++ )
+ for( int i=0; i<world
_global
.sfd.w; i++ )
{
{
- u32 idx = (world.sfd.w*row_h + i) * 2;
+ u32 idx = (world
_global
.sfd.w*row_h + i) * 2;
if( end )
{
if( end )
{
- world.sfd.buffer[idx] = 0.0f;
+ world
_global
.sfd.buffer[idx] = 0.0f;
}
else
{
if( !str[i] )
end = 1;
}
else
{
if( !str[i] )
end = 1;
- world.sfd.buffer[idx] = sfd_encode_glyph( str[i] );
+ world
_global
.sfd.buffer[idx] = sfd_encode_glyph( str[i] );
}
}
}
}
}
}
@@
-82,10
+85,10
@@
VG_STATIC void sfd_init( u32 w, u32 h )
VG_STATIC void sfd_update(void)
{
VG_STATIC void sfd_update(void)
{
- for( int i=0; i<world
.sfd.w*world
.sfd.h; i++ )
+ for( int i=0; i<world
_global.sfd.w*world_global
.sfd.h; i++ )
{
{
- float *target = &world.sfd.buffer[i*2+0],
- *cur = &world.sfd.buffer[i*2+1];
+ float *target = &world
_global
.sfd.buffer[i*2+0],
+ *cur = &world
_global
.sfd.buffer[i*2+1];
float const rate = vg.time_delta * 15.2313131414f;
float d1 = *target-*cur;
float const rate = vg.time_delta * 15.2313131414f;
float d1 = *target-*cur;
@@
-104,8
+107,8
@@
VG_STATIC void sfd_update(void)
VG_STATIC void bind_terrain_noise(void);
VG_STATIC void sfd_render( camera *cam, m4x3f transform )
{
VG_STATIC void bind_terrain_noise(void);
VG_STATIC void sfd_render( camera *cam, m4x3f transform )
{
+#if 0
mesh_bind( &world.sfd.mesh_display );
mesh_bind( &world.sfd.mesh_display );
-
shader_scoretext_use();
shader_scoretext_uTexGarbage(0);
shader_scoretext_uTexGradients(1);
shader_scoretext_use();
shader_scoretext_uTexGarbage(0);
shader_scoretext_uTexGradients(1);
@@
-147,13
+150,14
@@
VG_STATIC void sfd_render( camera *cam, m4x3f transform )
mesh_bind( &world.sfd.mesh_base );
mesh_draw( &world.sfd.mesh_base );
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 )
{
}
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] );
}
sfd_encode( row, argv[1] );
}
@@
-163,7
+167,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" );
VG_STATIC void world_sfd_init(void)
{
vg_info( "world_sfd_init\n" );
+
+#if 0
shader_scoretext_register();
shader_scoretext_register();
+#endif
vg_function_push( (struct vg_cmd){
.name = "sfd",
vg_function_push( (struct vg_cmd){
.name = "sfd",
@@
-205,8
+212,8
@@
VG_STATIC void world_sfd_init(void)
vg_acquire_thread_sync();
{
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 );
}
vg_tex2d_init( (vg_tex2d *[]){ &tex_scoretext }, 1 );
}
@@
-215,12
+222,14
@@
VG_STATIC void world_sfd_init(void)
int w = 27,
h = 13;
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<w*h*2; i++ )
for( int i=0; i<w*h*2; i++ )
- world.sfd.buffer[i] = 0.0f;
+ world
_global
.sfd.buffer[i] = 0.0f;
}
}
+#endif
#endif /* SFD_H */
#endif /* SFD_H */