dxx-rebirth/common/3d/clipper.h
Kp f3d4dff941 Use enum class for clipping_code
Adjust code_window_point to use the same masks as clipping_code.
Previously, it had top and bottom swapped.  However, since its output
was only ever compared for equality to 0, this transposition should not
affect the observable behavior.
2022-10-02 19:51:35 +00:00

47 lines
1.1 KiB
C++

/*
* This file is part of the DXX-Rebirth project <https://www.dxx-rebirth.com/>.
* It is copyright by its individual contributors, as recorded in the
* project's Git history. See COPYING.txt at the top level for license
* terms and a link to the Git history.
*/
/*
*
* Header for clipper.c
*
*/
#pragma once
#ifdef __cplusplus
#include "dxxsconf.h"
#include <cstdint>
struct g3s_codes;
struct g3s_point;
#if !DXX_USE_OGL
#include "dsx-ns.h"
#include "3d.h"
#include "globvars.h"
#include <array>
namespace dcx {
struct polygon_clip_points : std::array<g3s_point *, MAX_POINTS_IN_POLY> {};
struct temporary_points_t
{
uint_fast32_t free_point_num;
std::array<g3s_point, MAX_POINTS_IN_POLY> temp_points;
std::array<g3s_point *, MAX_POINTS_IN_POLY> free_points;
temporary_points_t();
void free_temp_point(g3s_point &cp);
};
const polygon_clip_points &clip_polygon(polygon_clip_points &src,polygon_clip_points &dest,int *nv,g3s_codes *cc,temporary_points_t &);
void clip_line(g3s_point *&p0, g3s_point *&p1, clipping_code codes_or, temporary_points_t &);
}
#endif
#endif