Make rotate_list result anonymous

This commit is contained in:
Kp 2015-10-18 21:01:18 +00:00
parent d767f7cd5e
commit faf698703e
3 changed files with 27 additions and 40 deletions

View file

@ -109,9 +109,8 @@ static void draw_segment(const vcsegptr_t seg)
return;
auto &svp = seg->verts;
g3s_codes cc=rotate_list(svp);
if (! cc.uand) { //all off screen?
if (!rotate_list(svp).uand)
{ //all off screen?
int i;
for (i=0;i<4;i++) draw_line(svp[i],svp[i+4]);
@ -125,16 +124,14 @@ static void draw_segment(const vcsegptr_t seg)
draw_line(svp[0+4],svp[3+4]);
}
}
//for looking for segment under a mouse click
static void check_segment(const vsegptridx_t seg)
{
auto &svp = seg->verts;
g3s_codes cc=rotate_list(svp);
if (! cc.uand) { //all off screen?
if (!rotate_list(svp).uand)
{ //all off screen?
gr_setcolor(0);
#ifdef OGL
g3_end_frame();
@ -170,9 +167,8 @@ static void check_segment(const vsegptridx_t seg)
static void draw_seg_side(const vcsegptr_t seg,int side)
{
auto &svp = seg->verts;
g3s_codes cc=rotate_list(svp);
if (! cc.uand) { //all off screen?
if (!rotate_list(svp).uand)
{ //all off screen?
int i;
for (i=0;i<3;i++)
@ -186,9 +182,7 @@ static void draw_seg_side(const vcsegptr_t seg,int side)
static void draw_side_edge(const vcsegptr_t seg,int side,int edge)
{
auto &svp = seg->verts;
g3s_codes cc=rotate_list(svp);
if (! cc.uand) //on screen?
if (!rotate_list(svp).uand) //on screen?
draw_line(svp[Side_to_verts[side][edge]],svp[Side_to_verts[side][(edge+1)%4]]);
}
@ -364,9 +358,8 @@ static void add_edge(int v0,int v1,ubyte type)
static void add_edges(const vcsegptridx_t seg)
{
auto &svp = seg->verts;
g3s_codes cc=rotate_list(svp);
if (! cc.uand) { //all off screen?
if (!rotate_list(svp).uand)
{ //all off screen?
int i,sn,fn,vn;
int flag;
ubyte edge_flags[N_EDGES_PER_SEGMENT];
@ -423,9 +416,8 @@ static void add_edges(const vcsegptridx_t seg)
static void draw_trigger_side(const vcsegptr_t seg,int side)
{
auto &svp = seg->verts;
g3s_codes cc=rotate_list(svp);
if (! cc.uand) { //all off screen?
if (!rotate_list(svp).uand)
{ //all off screen?
// Draw diagonals
draw_line(svp[Side_to_verts[side][0]],svp[Side_to_verts[side][2]]);
}
@ -435,13 +427,11 @@ static void draw_trigger_side(const vcsegptr_t seg,int side)
static void draw_wall_side(const vcsegptr_t seg,int side)
{
auto &svp = seg->verts;
g3s_codes cc=rotate_list(svp);
if (! cc.uand) { //all off screen?
if (!rotate_list(svp).uand)
{ //all off screen?
// Draw diagonals
draw_line(svp[Side_to_verts[side][0]],svp[Side_to_verts[side][2]]);
draw_line(svp[Side_to_verts[side][1]],svp[Side_to_verts[side][3]]);
}
}

View file

@ -1011,13 +1011,13 @@ void draw_all_edges(automap *am)
if ( (!(e->flags&EF_SECRET))&&(e->color==am->wall_normal_color))
continue; // If a line isn't secret and is normal color, then don't draw it
}
g3s_codes cc=rotate_list(e->verts);
distance = Segment_points[e->verts[1]].p3_z;
if (min_distance>distance )
min_distance = distance;
if (!cc.uand) { //all off screen?
if (!rotate_list(e->verts).uand)
{ //all off screen?
nfacing = nnfacing = 0;
auto &tv1 = Vertices[e->verts[0]];
j = 0;

View file

@ -741,8 +741,8 @@ static void render_segment(const vcsegptridx_t seg)
{
int sn;
g3s_codes cc=rotate_list(seg->verts);
if (! cc.uand) { //all off screen?
if (!rotate_list(seg->verts).uand)
{ //all off screen?
#if defined(DXX_BUILD_DESCENT_II)
if (Viewer->type!=OBJ_ROBOT)
@ -808,9 +808,8 @@ const fix CROSS_HEIGHT = i2f(8);
//draw outline for curside
static void outline_seg_side(const vcsegptr_t seg,int _side,int edge,int vert)
{
g3s_codes cc=rotate_list(seg->verts);
if (! cc.uand) { //all off screen?
if (!rotate_list(seg->verts).uand)
{ //all off screen?
g3s_point *pnt;
//render curedge of curside of curseg in green
@ -1359,7 +1358,7 @@ static void build_segment_list(render_state_t &rstate, visited_twobit_array_t &v
processed = true;
auto seg = vsegptridx(segnum);
const auto r = rotate_list(seg->verts);
const auto uor = rotate_list(seg->verts).uor & CC_BEHIND;
//look at all sides of this segment.
//tricky code to look at sides in correct order follows
@ -1370,12 +1369,12 @@ static void build_segment_list(render_state_t &rstate, visited_twobit_array_t &v
auto wid = WALL_IS_DOORWAY(seg, c);
if (wid & WID_RENDPAST_FLAG)
{
ubyte codes_and = r.uor;
if (codes_and & CC_BEHIND)
if (auto codes_and = uor)
{
range_for (const auto i, Side_to_verts[c])
codes_and &= Segment_points[seg->verts[i]].p3_codes;
if (codes_and & CC_BEHIND) continue;
if (codes_and)
continue;
}
child_list[n_children++] = c;
}
@ -1689,9 +1688,8 @@ void render_mine(segnum_t start_seg_num,fix eye_offset, window_rendered_data &wi
const auto &&seg = vcsegptridx(segnum);
int sn;
Assert(segnum!=segment_none && segnum<=Highest_segment_index);
g3s_codes cc=rotate_list(seg->verts);
if (! cc.uand) { //all off screen?
if (!rotate_list(seg->verts).uand)
{ //all off screen?
if (Viewer->type!=OBJ_ROBOT)
Automap_visited[segnum]=1;
@ -1786,9 +1784,8 @@ void render_mine(segnum_t start_seg_num,fix eye_offset, window_rendered_data &wi
const auto &&seg = vcsegptridx(segnum);
int sn;
Assert(segnum!=segment_none && segnum<=Highest_segment_index);
g3s_codes cc=rotate_list(seg->verts);
if (! cc.uand) { //all off screen?
if (!rotate_list(seg->verts).uand)
{ //all off screen?
for (sn=0; sn<MAX_SIDES_PER_SEGMENT; sn++)
{
auto wid = WALL_IS_DOORWAY(seg, sn);