medfall

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

commit d170bd2763ae3837f648406a88b27d90a1531424
parent 0d0282cc8d4f3d676d0c4eded4beb0664a05e9e6
Author: Michael Savage <mikejsavage@gmail.com>
Date:   Sun Jan 24 18:48:02 +0000

Less const noise

Diffstat:
immediate.cc | 46+++++++++++++++++++++++-----------------------
immediate.h | 26+++++++++++++-------------
2 files changed, 36 insertions(+), 36 deletions(-)
diff --git a/immediate.cc b/immediate.cc @@ -4,21 +4,21 @@ #include "intrinsics.h" #include "immediate.h" -void immediate_init( ImmediateContext * const ctx, ImmediateTriangle * const memory, const size_t max_triangles ) { +void immediate_init( ImmediateContext * ctx, ImmediateTriangle * memory, size_t max_triangles ) { ctx->triangles = memory; ctx->num_triangles = 0; ctx->max_triangles = max_triangles; } void immediate_triangle( - ImmediateContext * const ctx, - const glm::vec3 v1, const glm::vec3 v2, const glm::vec3 v3, - const glm::vec4 colour + ImmediateContext * ctx, + glm::vec3 v1, glm::vec3 v2, glm::vec3 v3, + glm::vec4 colour ) { assert( ctx->num_triangles < ctx->max_triangles - 1 ); - const glm::vec2 uv; - const ImmediateTriangle triangle = { { + glm::vec2 uv; + ImmediateTriangle triangle = { { { v1, colour, uv }, { v2, colour, uv }, { v3, colour, uv }, @@ -28,50 +28,50 @@ void immediate_triangle( } void immediate_triangle( - ImmediateContext * const ctx, - const ImmediateVertex v1, const ImmediateVertex v2, const ImmediateVertex v3 + ImmediateContext * ctx, + ImmediateVertex v1, ImmediateVertex v2, ImmediateVertex v3 ) { assert( ctx->num_triangles < ctx->max_triangles - 1 ); - const ImmediateTriangle triangle = { { v1, v2, v3 } }; + ImmediateTriangle triangle = { { v1, v2, v3 } }; ctx->triangles[ ctx->num_triangles++ ] = triangle; } void immediate_sphere( - ImmediateContext * const ctx, const glm::vec3 centre, const float radius, - const glm::vec4 colour, const u32 subdivisions + ImmediateContext * ctx, glm::vec3 centre, float radius, + glm::vec4 colour, u32 subdivisions ) { const float azimuth_max = 2.0f * M_PI; const float pitch_max = M_PI; for( u32 a = 0; a < subdivisions * 2; a++ ) { - const float azimuth0 = azimuth_max * ( float ) a / ( subdivisions * 2 ); - const float azimuth1 = azimuth_max * ( float ) ( a + 1 ) / ( subdivisions * 2 ); + float azimuth0 = azimuth_max * ( float ) a / ( subdivisions * 2 ); + float azimuth1 = azimuth_max * ( float ) ( a + 1 ) / ( subdivisions * 2 ); for( u32 p = 0; p < subdivisions; p++ ) { - const float pitch0 = pitch_max * ( float ) p / subdivisions; - const float pitch1 = pitch_max * ( float ) ( p + 1 ) / subdivisions; + float pitch0 = pitch_max * ( float ) p / subdivisions; + float pitch1 = pitch_max * ( float ) ( p + 1 ) / subdivisions; - const glm::vec3 top_left = centre + glm::vec3( + glm::vec3 top_left = centre + glm::vec3( radius * cosf( azimuth0 ) * sinf( pitch0 ), radius * sinf( azimuth0 ) * sinf( pitch0 ), radius * cosf( pitch0 ) ); - const glm::vec3 top_right = centre + glm::vec3( + glm::vec3 top_right = centre + glm::vec3( radius * cosf( azimuth1 ) * sinf( pitch0 ), radius * sinf( azimuth1 ) * sinf( pitch0 ), radius * cosf( pitch0 ) ); - const glm::vec3 bottom_left = centre + glm::vec3( + glm::vec3 bottom_left = centre + glm::vec3( radius * cosf( azimuth0 ) * sinf( pitch1 ), radius * sinf( azimuth0 ) * sinf( pitch1 ), radius * cosf( pitch1 ) ); - const glm::vec3 bottom_right = centre + glm::vec3( + glm::vec3 bottom_right = centre + glm::vec3( radius * cosf( azimuth1 ) * sinf( pitch1 ), radius * sinf( azimuth1 ) * sinf( pitch1 ), radius * cosf( pitch1 ) @@ -84,9 +84,9 @@ void immediate_sphere( } void immediate_render( - const ImmediateContext * const ctx, - const GLint at_position, const GLint at_colour, - const bool textured, const GLint at_uv, const GLint un_texture + const ImmediateContext * ctx, + GLint at_position, GLint at_colour, + bool textured, GLint at_uv, GLint un_texture ) { GLuint vao; glGenVertexArrays( 1, &vao ); @@ -125,6 +125,6 @@ void immediate_render( glDeleteVertexArrays( 1, &vao ); } -void immediate_clear( ImmediateContext * const ctx ) { +void immediate_clear( ImmediateContext * ctx ) { ctx->num_triangles = 0; } diff --git a/immediate.h b/immediate.h @@ -19,22 +19,22 @@ struct ImmediateContext { size_t max_triangles; }; -void immediate_init( ImmediateContext * const ctx, - ImmediateTriangle * const memory, const size_t max_triangles ); +void immediate_init( ImmediateContext * ctx, + ImmediateTriangle * memory, size_t max_triangles ); -void immediate_triangle( ImmediateContext * const ctx, - const glm::vec3 v1, const glm::vec3 v2, const glm::vec3 v3, const glm::vec4 colour ); -void immediate_triangle( ImmediateContext * const ctx, - const ImmediateVertex v1, const ImmediateVertex v2, const ImmediateVertex v3 ); +void immediate_triangle( ImmediateContext * ctx, + glm::vec3 v1, glm::vec3 v2, glm::vec3 v3, glm::vec4 colour ); +void immediate_triangle( ImmediateContext * ctx, + ImmediateVertex v1, ImmediateVertex v2, ImmediateVertex v3 ); -void immediate_render( const ImmediateContext * const ctx, - const GLint at_position, const GLint at_colour, - const bool textured = false, const GLint at_uv = 0, const GLint un_texture = 0 ); +void immediate_render( const ImmediateContext * ctx, + GLint at_position, GLint at_colour, + bool textured = false, GLint at_uv = 0, GLint un_texture = 0 ); -void immediate_sphere( ImmediateContext * const ctx, - const glm::vec3 centre, const float radius, const glm::vec4 colour, - const u32 subdivisions = 16 ); +void immediate_sphere( ImmediateContext * ctx, + glm::vec3 centre, float radius, glm::vec4 colour, + u32 subdivisions = 16 ); -void immediate_clear( ImmediateContext * const ctx ); +void immediate_clear( ImmediateContext * ctx ); #endif // _IMMEDIATE_H_