medfall

A super great game engine
Log | Files | Refs

commit eb9495167c070c333a59b3719b23496812599d90
parent f4d4ad18701612f2975984a8f97001ea371d4884
Author: Michael Savage <mikejsavage@gmail.com>
Date:   Sun Sep  3 22:49:09 +0300

UNIFORM -> UNIFORMS

Diffstat:
bsp.cc | 4++--
hm.cc | 10+++++-----
renderer.h | 12++++++------
shadow_map.cc | 10+++++-----
skybox.cc | 4++--
terrain_manager.cc | 4++--
text_renderer.cc | 2+-
7 files changed, 23 insertions(+), 23 deletions(-)
diff --git a/bsp.cc b/bsp.cc @@ -293,7 +293,7 @@ GAME_FRAME( game_frame ) { { RenderState render_state; render_state.shader = get_shader( SHADER_FLAT_VERTEX_COLOURS ); - render_state.uniforms[ UNIFORM_VIEW ] = view_uniforms; + render_state.uniforms[ UNIFORMS_VIEW ] = view_uniforms; bspr_render( &game->bspr, game->pos, render_state ); } @@ -317,7 +317,7 @@ GAME_FRAME( game_frame ) { RenderState immediate_render_state; immediate_render_state.shader = get_shader( SHADER_FLAT_VERTEX_COLOURS ); - immediate_render_state.uniforms[ UNIFORM_VIEW ] = view_uniforms; + immediate_render_state.uniforms[ UNIFORMS_VIEW ] = view_uniforms; immediate_render( &imm, immediate_render_state ); char buf[ 256 ]; diff --git a/hm.cc b/hm.cc @@ -345,8 +345,8 @@ GAME_FRAME( game_frame ) { { RenderState render_state; render_state.shader = get_shader( SHADER_TREE ); - render_state.uniforms[ UNIFORM_VIEW ] = view_uniforms; - render_state.uniforms[ UNIFORM_SUN ] = renderer_uniforms( sun_dir ); + render_state.uniforms[ UNIFORMS_VIEW ] = view_uniforms; + render_state.uniforms[ UNIFORMS_SUN ] = renderer_uniforms( sun_dir ); render_state.cull_face = CULLFACE_FRONT; renderer_draw_instances( tree_mesh, render_state, num_trees, instance_data ); @@ -394,7 +394,7 @@ GAME_FRAME( game_frame ) { RenderState fireball_render_state; fireball_render_state.shader = get_shader( SHADER_FLAT_VERTEX_COLOURS ); - fireball_render_state.uniforms[ UNIFORM_VIEW ] = view_uniforms; + fireball_render_state.uniforms[ UNIFORMS_VIEW ] = view_uniforms; immediate_render( &imm, fireball_render_state ); immediate_init( &imm, asdf, ARRAY_COUNT( asdf ) ); @@ -413,7 +413,7 @@ GAME_FRAME( game_frame ) { RenderState explosion_render_state; explosion_render_state.shader = get_shader( SHADER_FLAT_VERTEX_COLOURS ); - explosion_render_state.uniforms[ UNIFORM_VIEW ] = view_uniforms; + explosion_render_state.uniforms[ UNIFORMS_VIEW ] = view_uniforms; immediate_render( &imm, explosion_render_state ); } @@ -518,7 +518,7 @@ GAME_FRAME( game_frame ) { RenderState impact_render_state; impact_render_state.shader = get_shader( SHADER_FLAT_VERTEX_COLOURS ); - impact_render_state.uniforms[ UNIFORM_VIEW ] = view_uniforms; + impact_render_state.uniforms[ UNIFORMS_VIEW ] = view_uniforms; immediate_render( &imm, impact_render_state ); } diff --git a/renderer.h b/renderer.h @@ -15,12 +15,12 @@ typedef u32 Texture; typedef u32 TextureBufferObject; typedef u32 FramebufferObject; -const u32 UNIFORM_VIEW = 0; -const u32 UNIFORM_MODEL = 1; -const u32 UNIFORM_LIGHT_VIEW = 2; -const u32 UNIFORM_WINDOW = 3; -const u32 UNIFORM_SUN = 4; -const u32 UNIFORM_SKY = 5; +const u32 UNIFORMS_VIEW = 0; +const u32 UNIFORMS_MODEL = 1; +const u32 UNIFORMS_LIGHT_VIEW = 2; +const u32 UNIFORMS_WINDOW = 3; +const u32 UNIFORMS_SUN = 4; +const u32 UNIFORMS_SKY = 5; #define RENDERER_MAX_TEXTURES 4 #define RENDERER_MAX_TEXTURE_BUFFERS 4 diff --git a/shadow_map.cc b/shadow_map.cc @@ -25,7 +25,7 @@ static void draw_scene( RenderState render_state, bool draw_light = false ) { immediate_init( &imm, triangles, ARRAY_COUNT( triangles ) ); m4 I = m4_identity(); - render_state.uniforms[ UNIFORM_MODEL ] = renderer_uniforms( I ); + render_state.uniforms[ UNIFORMS_MODEL ] = renderer_uniforms( I ); immediate_sphere( &imm, v3( 0, 0, 2 ), 2, v4( 1, 0, 0, 1 ) ); immediate_sphere( &imm, v3( -3, 7, 2 ), 2, v4( 0, 1, 0, 1 ) ); @@ -50,7 +50,7 @@ static void draw_scene( RenderState render_state, bool draw_light = false ) { immediate_render( &imm, render_state ); m4 M = m4_translation( v3( -7, -2, 0 ) ) * m4_rotx( deg_to_rad( 90 ) ); - render_state.uniforms[ UNIFORM_MODEL ] = renderer_uniforms( M ); + render_state.uniforms[ UNIFORMS_MODEL ] = renderer_uniforms( M ); render_state.cull_face = CULLFACE_FRONT; renderer_draw_mesh( tree_mesh, render_state ); } @@ -138,7 +138,7 @@ GAME_FRAME( game_frame ) { RenderState render_state; render_state.shader = get_shader( SHADER_WRITE_SHADOW_MAP ); - render_state.uniforms[ UNIFORM_LIGHT_VIEW ] = light_view_uniforms; + render_state.uniforms[ UNIFORMS_LIGHT_VIEW ] = light_view_uniforms; draw_scene( render_state ); @@ -159,8 +159,8 @@ GAME_FRAME( game_frame ) { { RenderState render_state; render_state.shader = get_shader( SHADER_SHADOWED_VERTEX_COLOURS ); - render_state.uniforms[ UNIFORM_VIEW ] = renderer_uniforms( V, P, game->pos ); - render_state.uniforms[ UNIFORM_LIGHT_VIEW ] = light_view_uniforms; + render_state.uniforms[ UNIFORMS_VIEW ] = renderer_uniforms( V, P, game->pos ); + render_state.uniforms[ UNIFORMS_LIGHT_VIEW ] = light_view_uniforms; render_state.textures[ 0 ] = shadow_fb.texture; render_state.textures[ 1 ] = renderer_blue_noise(); diff --git a/skybox.cc b/skybox.cc @@ -136,8 +136,8 @@ void skybox_render( const Skybox * skybox, const m4 & Vsky, const m4 & P, float render_state.shader = get_shader( SHADER_SKYBOX ); render_state.cull_face = CULLFACE_FRONT; render_state.disable_depth_writes = true; - render_state.uniforms[ UNIFORM_VIEW ] = renderer_uniforms( Vsky, P ); - render_state.uniforms[ UNIFORM_SKY ] = renderer_uniforms( hosek.A, hosek.B, hosek.C, hosek.D, hosek.E, hosek.F, hosek.G, hosek.H, hosek.I, hosek.Z, sun_dir ); + render_state.uniforms[ UNIFORMS_VIEW ] = renderer_uniforms( Vsky, P ); + render_state.uniforms[ UNIFORMS_SKY ] = renderer_uniforms( hosek.A, hosek.B, hosek.C, hosek.D, hosek.E, hosek.F, hosek.G, hosek.H, hosek.I, hosek.Z, sun_dir ); render_state.textures[ 0 ] = renderer_blue_noise(); renderer_draw_mesh( skybox->mesh, render_state ); diff --git a/terrain_manager.cc b/terrain_manager.cc @@ -352,8 +352,8 @@ void terrain_render( TerrainManager * tm, const m4 & V, const m4 & P, float sun_ RenderState render_state; render_state.shader = get_shader( SHADER_TERRAIN ); render_state.textures[ 2 ] = renderer_blue_noise(); - render_state.uniforms[ UNIFORM_VIEW ] = renderer_uniforms( V, P ); - render_state.uniforms[ UNIFORM_SUN ] = renderer_uniforms( sun_dir, sun_angle ); + render_state.uniforms[ UNIFORMS_VIEW ] = renderer_uniforms( V, P ); + render_state.uniforms[ UNIFORMS_SUN ] = renderer_uniforms( sun_dir, sun_angle ); render_state.tbs[ 0 ] = tm->point_light_origins; render_state.tbs[ 1 ] = tm->point_light_colours; diff --git a/text_renderer.cc b/text_renderer.cc @@ -118,7 +118,7 @@ void draw_text( const char * str, int x, int y, float pixel_size ) { RenderState render_state; render_state.shader = get_shader( SHADER_TEXT ); render_state.textures[ 0 ] = sizes[ size_idx ].atlas; - render_state.uniforms[ UNIFORM_WINDOW ] = renderer_uniforms( get_window_size() ); + render_state.uniforms[ UNIFORMS_WINDOW ] = renderer_uniforms( get_window_size() ); render_state.depth_func = DEPTHFUNC_DISABLED; render_state.enable_alpha_blending = true; // render_state.disable_depth_writes = true;