Example #1
0
// ---------------------------------------------------------------------------------------
// Select previous segment.
//	If there is a connection on the side opposite to the current side, then choose that segment.
// If there is no connecting segment on the opposite face, try any segment.
__attribute_warn_unused_result
static std::pair<vsegptridx_t, uint_fast32_t> get_previous_segment_side(const vsegptridx_t curseg_num, const uint_fast32_t curside)
{
    const auto &newseg_num = get_previous_segment(curseg_num, curside);
    // Now make Curside point at the segment we just left (unless we couldn't leave it).
    return {newseg_num, newseg_num == curseg_num ? curside : find_connect_side(curseg_num, newseg_num)};
}
Example #2
0
// -------------------------------------------------------------------------------------
int SelectCurrentSegBackward()
{
	int	newseg_num,newside;

	get_previous_segment(Cursegp-Segments,Curside,&newseg_num,&newside);

	Cursegp = &Segments[newseg_num];
	Curside = newside;

	if (Lock_view_to_cursegp)
		set_view_target_from_segment(Cursegp);
	Update_flags |= UF_ED_STATE_CHANGED;
	mine_changed = 1;
	med_create_new_segment_from_cursegp();

	return 1;
}