medfall

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

commit b30be0ce210961955243b456a7f98c1b598ccfcb
parent 67c0aefd707f950c1a50b1c1db43fcc7d9cb5bd7
Author: Michael Savage <mikejsavage@gmail.com>
Date:   Sat Nov  5 16:58:36 +0200

GLchar -> char, const madness

Diffstat:
bsp.cc | 8++++----
btt.h | 2+-
heightmap.cc | 6+++---
heightmap.h | 2+-
hm.cc | 16++++++++--------
main.cc | 6+++---
mod_btt.cc | 8++++----
shadow_map.cc | 8++++----
skybox.cc | 4++--
terrain_manager.cc | 4++--
10 files changed, 32 insertions(+), 32 deletions(-)
diff --git a/bsp.cc b/bsp.cc @@ -17,7 +17,7 @@ static bool fix = false; static glm::vec3 fix_start; static glm::vec3 fix_end; -static const GLchar * const vert_src = GLSL( +static const char * vert_src = GLSL( in vec3 position; in vec3 colour; @@ -33,7 +33,7 @@ static const GLchar * const vert_src = GLSL( } ); -static const GLchar * frag_src = GLSL( +static const char * frag_src = GLSL( in vec3 frag_colour; out vec4 screen_colour; @@ -43,7 +43,7 @@ static const GLchar * frag_src = GLSL( } ); -static const GLchar * const textured_vert_src = GLSL( +static const char * textured_vert_src = GLSL( in vec3 position; in vec4 colour; in vec2 tex_coord0; @@ -58,7 +58,7 @@ static const GLchar * const textured_vert_src = GLSL( } ); -static const GLchar * textured_frag_src = GLSL( +static const char * textured_frag_src = GLSL( in vec4 frag_colour; in vec2 frag_uv; diff --git a/btt.h b/btt.h @@ -20,6 +20,6 @@ struct BTTs { BTT * right_root; }; -BTTs btt_from_heightmap( const Heightmap * const hm, MemoryArena * const arena ); +BTTs btt_from_heightmap( const Heightmap * hm, MemoryArena * arena ); #endif // _BTT_H_ diff --git a/heightmap.cc b/heightmap.cc @@ -8,7 +8,7 @@ const float SLOPE = 0.3; -static float lerp( const float a, const float b, const float t ) { +static float lerp( float a, float b, float t ) { return a * ( 1 - t ) + b * t; } @@ -35,7 +35,7 @@ void heightmap_init( Heightmap * hm, u8 * pixels, u32 width, u32 height ) { hm->height = height; } -void heightmap_destroy( Heightmap * const hm ) { +void heightmap_destroy( Heightmap * hm ) { if( hm->pixels != NULL ) { free( hm->pixels ); } @@ -45,7 +45,7 @@ glm::vec3 Heightmap::point( u32 x, u32 y ) const { return glm::vec3( x, y, pixels[ y * width + x ] ); } -float Heightmap::bilerp_height( const float x, const float y ) const { +float Heightmap::bilerp_height( float x, float y ) const { const float ix = floorf( x ); const float iy = floorf( y ); diff --git a/heightmap.h b/heightmap.h @@ -13,7 +13,7 @@ public: glm::vec3 point( u32 x, u32 y ) const; - float bilerp_height( const float x, const float y ) const; + float bilerp_height( float x, float y ) const; }; struct OffsetHeightmap { diff --git a/hm.cc b/hm.cc @@ -15,7 +15,7 @@ #include "work_queue.h" #include "stb_truetype.h" -static const GLchar * const vert_src = GLSL( +static const char * vert_src = GLSL( in vec3 position; in vec4 colour; @@ -27,7 +27,7 @@ static const GLchar * const vert_src = GLSL( } ); -static const GLchar * frag_src = GLSL( +static const char * frag_src = GLSL( in vec4 frag_colour; out vec4 screen_colour; @@ -37,7 +37,7 @@ static const GLchar * frag_src = GLSL( } ); -static const GLchar * const textured_vert_src = GLSL( +static const char * textured_vert_src = GLSL( in vec3 position; in vec4 colour; in vec2 uv; @@ -52,7 +52,7 @@ static const GLchar * const textured_vert_src = GLSL( } ); -static const GLchar * textured_frag_src = GLSL( +static const char * textured_frag_src = GLSL( in vec4 frag_colour; in vec2 frag_uv; @@ -65,7 +65,7 @@ static const GLchar * textured_frag_src = GLSL( } ); -static const GLchar * const font_vert_src = GLSL( +static const char * font_vert_src = GLSL( in vec3 position; in vec4 colour; in vec2 uv; @@ -80,7 +80,7 @@ static const GLchar * const font_vert_src = GLSL( } ); -static const GLchar * font_frag_src = GLSL( +static const char * font_frag_src = GLSL( in vec4 frag_colour; in vec2 frag_uv; @@ -170,9 +170,9 @@ extern "C" GAME_INIT( game_init ) { glClearColor( 0, 0.5, 0.7, 1 ); // TODO - u8 * const arial = file_get_contents( "Arial.ttf" ); + u8 * arial = file_get_contents( "Arial.ttf" ); - u8 * const font_memory = memarena_push_size( &mem->persistent_arena, 512 * 256 ); + u8 * font_memory = memarena_push_size( &mem->persistent_arena, 512 * 256 ); const int offset = stbtt_GetFontOffsetForIndex( arial, 0 ); const int ok = stbtt_BakeFontBitmap( arial, offset, 48, font_memory, 512, 512, ' ', 127 - ' ', game->test_chars ); assert( ok > 0 ); diff --git a/main.cc b/main.cc @@ -24,7 +24,7 @@ struct Game { time_t lib_write_time; }; -static time_t file_last_write_time( const char * const path ) { +static time_t file_last_write_time( const char * path ) { struct stat buf; if( stat( path, &buf ) == -1 ) { return 0; @@ -33,7 +33,7 @@ static time_t file_last_write_time( const char * const path ) { return buf.st_mtime; } -static Game load_game( const char * const path ) { +static Game load_game( const char * path ) { Game game = { }; game.lib = library_open( path ); @@ -68,7 +68,7 @@ static void unload_game( Game * game ) { game->frame = NULL; } -static bool should_reload_game( const char * const path, const time_t lib_write_time ) { +static bool should_reload_game( const char * path, time_t lib_write_time ) { return file_last_write_time( path ) > lib_write_time; } diff --git a/mod_btt.cc b/mod_btt.cc @@ -14,7 +14,7 @@ static ImmediateTriangle triangles[ 512000 ]; static ImmediateContext imm; -static const GLchar * vert_src = GLSL( +static const char * vert_src = GLSL( in vec3 position; out vec3 smooth_position; @@ -31,7 +31,7 @@ static const GLchar * vert_src = GLSL( } ); -static const GLchar * frag_src = GLSL( +static const char * frag_src = GLSL( in vec3 smooth_position; in float depth; @@ -71,7 +71,7 @@ static const GLchar * frag_src = GLSL( } ); -static const GLchar * vert_outline_src = GLSL( +static const char * vert_outline_src = GLSL( in vec3 position; in vec3 colour; @@ -85,7 +85,7 @@ static const GLchar * vert_outline_src = GLSL( } ); -static const GLchar * frag_outline_src = GLSL( +static const char * frag_outline_src = GLSL( in vec3 frag_colour; out vec4 screen_colour; diff --git a/shadow_map.cc b/shadow_map.cc @@ -25,7 +25,7 @@ static GLint depth_un_tex; static GLuint fbo; static GLuint tex_depth; -static const GLchar * const vert_src = GLSL( +static const char * vert_src = GLSL( in vec3 position; in vec3 colour; @@ -39,7 +39,7 @@ static const GLchar * const vert_src = GLSL( } ); -static const GLchar * frag_src = GLSL( +static const char * frag_src = GLSL( in vec3 frag_colour; out vec4 screen_colour; @@ -49,7 +49,7 @@ static const GLchar * frag_src = GLSL( } ); -static const GLchar * const depth_vert_src = GLSL( +static const char * depth_vert_src = GLSL( in vec2 position; out vec2 smooth_position; @@ -60,7 +60,7 @@ static const GLchar * const depth_vert_src = GLSL( } ); -static const GLchar * depth_frag_src = GLSL( +static const char * depth_frag_src = GLSL( in vec2 smooth_position; out vec4 screen_colour; diff --git a/skybox.cc b/skybox.cc @@ -17,7 +17,7 @@ * `6------7 */ -static const GLchar * const vert_src = GLSL( +static const char * vert_src = GLSL( in vec3 position; out vec3 pos; @@ -31,7 +31,7 @@ static const GLchar * const vert_src = GLSL( } ); -static const GLchar * frag_src = GLSL( +static const char * frag_src = GLSL( in vec3 pos; out vec4 screen_colour; diff --git a/terrain_manager.cc b/terrain_manager.cc @@ -16,7 +16,7 @@ #include "lz4.h" -static const GLchar * const vert_src = GLSL( +static const char * vert_src = GLSL( in vec3 position; out vec4 vpos; @@ -34,7 +34,7 @@ static const GLchar * const vert_src = GLSL( } ); -static const GLchar * frag_src = GLSL( +static const char * frag_src = GLSL( in vec4 vpos; in vec3 smooth_position;