#include "shaders/model_font.h"
#include "shaders/scene_font.h"
#include "world_render.h"
+#include "depth_compare.h"
enum efont_SRglyph{
k_SRglyph_end = 0x00, /* control characters */
k_SRglyph_kbm_space = 0xa1,
k_SRglyph_kbm_return = 0xa2,
k_SRglyph_kbm_escape = 0xa3,
- k_SRglyph_kbm_mousemove = 0xa4
+ k_SRglyph_kbm_mousemove = 0xa4,
+ k_SRglyph_vg_ret = 0xa5,
+ k_SRglyph_vg_link = 0xa6,
+ k_SRglyph_vg_square = 0xa7,
+ k_SRglyph_vg_triangle = 0xa8,
+ k_SRglyph_vg_circle = 0xa9
};
typedef struct font3d font3d;
vg_linear_clear( vg_mem.scratch );
mdl_array_ptr fonts;
- mdl_load_array( &font->mdl, &fonts, "ent_font", vg_mem.scratch );
+ MDL_LOAD_ARRAY( &font->mdl, &fonts, ent_font, vg_mem.scratch );
font->info = *((ent_font *)mdl_arritm(&fonts,0));
- mdl_load_array( &font->mdl, &font->font_variants, "ent_font_variant", alloc);
- mdl_load_array( &font->mdl, &font->glyphs, "ent_glyph", alloc );
+ MDL_LOAD_ARRAY( &font->mdl, &font->font_variants, ent_font_variant, alloc);
+ MDL_LOAD_ARRAY( &font->mdl, &font->glyphs, ent_glyph, alloc );
vg_linear_clear( vg_mem.scratch );
void *data = vg_linear_alloc( vg_mem.scratch, tex0->file.pack_size );
mdl_fread_pack_file( &font->mdl, &tex0->file, data );
- mdl_async_load_glmesh( &font->mdl, &font->mesh );
+ mdl_async_load_glmesh( &font->mdl, &font->mesh, NULL );
vg_tex2d_load_qoi_async( data, tex0->file.pack_size,
VG_TEX2D_LINEAR|VG_TEX2D_CLAMP,
&font->texture );
shader_model_font_uDepthCompare( depth_compare );
if( depth_compare ){
- /* TODO: Compress with code in player_render.c */
- shader_model_font_uTexSceneDepth( 2 );
- render_fb_bind_texture( gpipeline.fb_main, 2, 2 );
- v3f inverse;
- render_fb_inverse_ratio( gpipeline.fb_main, inverse );
- inverse[2] = skaterift.cam.farz-skaterift.cam.nearz;
-
- shader_model_font_uInverseRatioDepth( inverse );
- render_fb_inverse_ratio( NULL, inverse );
- inverse[2] = cam->farz-cam->nearz;
- shader_model_font_uInverseRatioMain( inverse );
+ depth_compare_bind(
+ shader_model_font_uTexSceneDepth,
+ shader_model_font_uInverseRatioDepth,
+ shader_model_font_uInverseRatioMain, cam );
}
shader_model_font_uPv( cam->mtx.pv );
shader_scene_font_uPv( skaterift.cam.mtx.pv );
shader_scene_font_uTime( vg.time );
- /* TODO: Code dupe... */
- world_link_lighting_ub( world, _shader_scene_font.id );
- world_bind_position_texture( world, _shader_scene_font.id,
- _uniform_scene_font_g_world_depth, 2 );
- world_bind_light_array( world, _shader_scene_font.id,
- _uniform_scene_font_uLightsArray, 3 );
- world_bind_light_index( world, _shader_scene_font.id,
- _uniform_scene_font_uLightsIndex, 4 );
+ WORLD_BIND_LIGHT_BUFFERS_UB0_TEX234( world, scene_font );
bind_terrain_noise();
shader_scene_font_uCamera( skaterift.cam.transform[3] );