Return get_side_verts by value

This commit is contained in:
Kp 2014-12-14 05:23:00 +00:00
parent 2af91c9a3a
commit 51b6fb1c95
4 changed files with 11 additions and 10 deletions

View file

@ -67,6 +67,11 @@ struct side_vertnum_list_t : array<int, 4> {};
// Fill in array with four absolute point numbers for a given side
void get_side_verts(side_vertnum_list_t &vertlist,vcsegptr_t segnum,int sidenum);
static inline side_vertnum_list_t get_side_verts(vcsegptr_t segnum,int sidenum)
{
side_vertnum_list_t r;
return get_side_verts(r, segnum, sidenum), r;
}
struct vertex_array_list_t : array<int, 6> {};

View file

@ -1319,8 +1319,7 @@ static void add_segment_edges(automap *am, const vcsegptridx_t seg)
color = am->wall_revealed_color;
Here:
#endif
side_vertnum_list_t vertex_list;
get_side_verts(vertex_list,segnum,sn);
const auto vertex_list = get_side_verts(segnum,sn);
add_one_edge( am, vertex_list[0], vertex_list[1], color, sn, segnum, hidden_flag, 0, no_fade );
add_one_edge( am, vertex_list[1], vertex_list[2], color, sn, segnum, hidden_flag, 0, no_fade );
add_one_edge( am, vertex_list[2], vertex_list[3], color, sn, segnum, hidden_flag, 0, no_fade );
@ -1344,8 +1343,7 @@ static void add_unknown_segment_edges(automap *am, const vcsegptridx_t seg)
for (sn=0;sn<MAX_SIDES_PER_SEGMENT;sn++) {
// Only add edges that have no children
if (seg->children[sn] == segment_none) {
side_vertnum_list_t vertex_list;
get_side_verts(vertex_list,segnum,sn);
const auto vertex_list = get_side_verts(segnum,sn);
add_one_unknown_edge( am, vertex_list[0], vertex_list[1] );
add_one_unknown_edge( am, vertex_list[1], vertex_list[2] );

View file

@ -1318,8 +1318,7 @@ void do_exploding_wall_frame()
//calc expl position
side_vertnum_list_t vertnum_list;
get_side_verts(vertnum_list,seg,sidenum);
const auto vertnum_list = get_side_verts(seg,sidenum);
const auto &v0 = Vertices[vertnum_list[0]];
const auto &v1 = Vertices[vertnum_list[1]];

View file

@ -427,7 +427,7 @@ static inline void check_render_face(index_sequence<N...>, segnum_t segnum, int
}
template <std::size_t N0, std::size_t N1, std::size_t N2, std::size_t N3>
static inline void check_render_face(index_sequence<N0, N1, N2, N3> is, segnum_t segnum, int sidenum, unsigned facenum, array<int, 4> &vp, int tmap1, int tmap2, const array<uvl, 4> &uvlp, WALL_IS_DOORWAY_result_t wid_flags)
static inline void check_render_face(index_sequence<N0, N1, N2, N3> is, segnum_t segnum, int sidenum, unsigned facenum, const array<int, 4> &vp, int tmap1, int tmap2, const array<uvl, 4> &uvlp, WALL_IS_DOORWAY_result_t wid_flags)
{
check_render_face(is, segnum, sidenum, facenum, vp, tmap1, tmap2, uvlp, wid_flags, 4);
}
@ -436,7 +436,7 @@ static inline void check_render_face(index_sequence<N0, N1, N2, N3> is, segnum_t
* are default constructed, gcc zero initializes all members.
*/
template <std::size_t N0, std::size_t N1, std::size_t N2>
static inline void check_render_face(index_sequence<N0, N1, N2> is, segnum_t segnum, int sidenum, unsigned facenum, array<int, 4> &vp, int tmap1, int tmap2, const array<uvl, 4> &uvlp, WALL_IS_DOORWAY_result_t wid_flags)
static inline void check_render_face(index_sequence<N0, N1, N2> is, segnum_t segnum, int sidenum, unsigned facenum, const array<int, 4> &vp, int tmap1, int tmap2, const array<uvl, 4> &uvlp, WALL_IS_DOORWAY_result_t wid_flags)
{
check_render_face(index_sequence<N0, N1, N2, 3>(), segnum, sidenum, facenum, vp, tmap1, tmap2, uvlp, wid_flags, 3);
}
@ -460,8 +460,7 @@ static void render_side(const vcsegptridx_t segp, int sidenum)
normals[0] = segp->sides[sidenum].normals[0];
normals[1] = segp->sides[sidenum].normals[1];
side_vertnum_list_t vertnum_list;
get_side_verts(vertnum_list,segp,sidenum);
const auto vertnum_list = get_side_verts(segp,sidenum);
// Regardless of whether this side is comprised of a single quad, or two triangles, we need to know one normal, so
// deal with it, get the dot product.