commit 5b97f0b772be8a17980f25ba323d36f2d82d4776
parent e2fb4d86ff3579d48ec7564a367148aeb8a95e83
Author: Michael Savage <mikejsavage@gmail.com>
Date: Tue, 21 Nov 2017 00:39:34 +0200
DynamicArray::append -> add
Diffstat:
3 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/array.h b/array.h
@@ -298,7 +298,7 @@ public:
free( elems );
}
- void append( const T & x ) {
+ void add( const T & x ) {
size_t idx = extend( 1 );
elems[ idx ] = x;
}
diff --git a/immediate.cc b/immediate.cc
@@ -22,7 +22,7 @@ void immediate_triangle( v3 p1, v3 p2, v3 p3, v4 colour ) {
triangle.vertices[ 1 ] = { p2, normal, colour, uv };
triangle.vertices[ 2 ] = { p3, normal, colour, uv };
- triangles.append( triangle );
+ triangles.add( triangle );
}
void immediate_triangle( ImmediateVertex v1, ImmediateVertex v2, ImmediateVertex v3 ) {
@@ -31,7 +31,7 @@ void immediate_triangle( ImmediateVertex v1, ImmediateVertex v2, ImmediateVertex
triangle.vertices[ 1 ] = v2;
triangle.vertices[ 2 ] = v3;
- triangles.append( triangle );
+ triangles.add( triangle );
}
void immediate_sphere( v3 centre, float radius, v4 colour, u32 subdivisions ) {
diff --git a/renderer.cc b/renderer.cc
@@ -398,7 +398,7 @@ void renderer_end_pass() {
in_pass = false;
current_render_pass.one_past_end = draw_calls.size();
- render_passes.append( current_render_pass );
+ render_passes.add( current_render_pass );
}
u32 renderer_num_draw_calls() {
@@ -1013,7 +1013,7 @@ void renderer_delete_mesh( const Mesh & mesh ) {
DeleteCommand command;
command.type = DELETE_MESH;
command.mesh = mesh;
- deletes.append( command );
+ deletes.add( command );
}
void renderer_draw_mesh( const Mesh & mesh, const RenderState & render_state ) {
@@ -1024,7 +1024,7 @@ void renderer_draw_mesh( const Mesh & mesh, const RenderState & render_state ) {
dc.render_state = render_state;
dc.num_instances = 0;
dc.instance_data = 0;
- draw_calls.append( dc );
+ draw_calls.add( dc );
draw_calls_this_frame++;
vertices_this_frame += mesh.num_vertices;
@@ -1042,7 +1042,7 @@ void renderer_draw_instances( const Mesh & mesh, const RenderState & render_stat
dc.render_state = render_state;
dc.num_instances = num_instances;
dc.instance_data = instance_data;
- draw_calls.append( dc );
+ draw_calls.add( dc );
draw_calls_this_frame++;
vertices_this_frame += mesh.num_vertices * num_instances;