commit d6087966335a407c480ef0ab710f0aef6f8da470 parent 5a169f4740c2cb981408124747df74b9124c7344 Author: Michael Savage <mikejsavage@gmail.com> Date: Sat Sep 19 21:29:13 +0100 Change init_* to first_* in BSP Diffstat:
bsp.cc | | | 4 | ++-- |
bsp.h | | | 10 | +++++----- |
bsp_renderer.cc | | | 6 | +++--- |
diff --git a/bsp.cc b/bsp.cc @@ -125,7 +125,7 @@ bool BSP::trace_seg_brush( const BSP_Brush & brush, const glm::vec3 start, const bool starts_inside = true; for( u32 i = 0; i < brush.num_sides; i++ ) { - const BSP_BrushSide & side = brush_sides[ i + brush.init_side ]; + const BSP_BrushSide & side = brush_sides[ i + brush.first_side ]; const BSP_Plane & plane = planes[ side.plane ]; const float start_dist = point_plane_distance( start, plane.n, plane.d ); @@ -186,7 +186,7 @@ void BSP::trace_seg_leaf( const u32 leaf_idx, const glm::vec3 start, const glm:: const BSP_Leaf & leaf = leaves[ leaf_idx ]; for( u32 i = 0; i < leaf.num_brushes; i++ ) { - const BSP_Brush & brush = brushes[ leaf_brushes[ i + leaf.init_brush ] ]; + const BSP_Brush & brush = brushes[ leaf_brushes[ i + leaf.first_brush ] ]; const BSP_Texture & texture = textures[ brush.texture ]; // TODO: magic number diff --git a/bsp.h b/bsp.h @@ -71,10 +71,10 @@ struct BSP_Leaf { s32 mins[ 3 ]; s32 maxs[ 3 ]; - u32 init_face; + u32 first_face; u32 num_faces; - u32 init_brush; + u32 first_brush; u32 num_brushes; }; @@ -84,7 +84,7 @@ typedef u32 BSP_LeafBrush; // LUMP_MODELS struct BSP_Brush { - u32 init_side; + u32 first_side; u32 num_sides; s32 texture; @@ -111,9 +111,9 @@ struct BSP_Face { s32 effect; s32 type; - s32 init_vert; + s32 first_vert; s32 num_verts; - s32 init_mesh_vert; + s32 first_mesh_vert; s32 num_mesh_verts; s32 lightmap; diff --git a/bsp_renderer.cc b/bsp_renderer.cc @@ -93,12 +93,12 @@ void bspr_init( BSPRenderer * const bspr, MemoryArena * const arena, const BSP * for( u32 f = 0; f < leaf.num_faces; f++ ) { const u32 offset = pos_scratch_used; - const BSP_LeafFace & leaf_face = bsp->leaf_faces[ f + leaf.init_face ]; + const BSP_LeafFace & leaf_face = bsp->leaf_faces[ f + leaf.first_face ]; const BSP_Face & face = bsp->faces[ leaf_face ]; const glm::vec3 colour = bspr_face_colour( bsp, face ); - const BSP_Vertex * const vertices = &bsp->vertices[ face.init_vert ]; - const s32 * const indices = &bsp->mesh_verts[ face.init_mesh_vert ]; + const BSP_Vertex * const vertices = &bsp->vertices[ face.first_vert ]; + const s32 * const indices = &bsp->mesh_verts[ face.first_mesh_vert ]; for( s32 v = 0; v < face.num_verts; v++ ) { const glm::vec3 & pos = vertices[ v ].pos;