2006-03-20 17:12:09 +00:00
|
|
|
/*
|
2018-09-02 00:57:29 +00:00
|
|
|
* This file is part of the DXX-Rebirth project <https://www.dxx-rebirth.com/>.
|
2014-06-12 08:41:03 +00:00
|
|
|
* 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.
|
|
|
|
*/
|
2006-03-20 17:12:09 +00:00
|
|
|
/*
|
|
|
|
*
|
|
|
|
* Header for clipper.c
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2014-12-14 05:23:00 +00:00
|
|
|
#pragma once
|
2013-10-26 03:40:50 +00:00
|
|
|
|
2012-11-11 22:12:51 +00:00
|
|
|
#ifdef __cplusplus
|
2016-12-05 00:26:11 +00:00
|
|
|
#include "dxxsconf.h"
|
2014-12-14 05:23:00 +00:00
|
|
|
#include <cstdint>
|
2012-11-11 22:12:51 +00:00
|
|
|
|
2013-10-26 03:40:50 +00:00
|
|
|
struct g3s_codes;
|
|
|
|
struct g3s_point;
|
|
|
|
|
2016-09-24 18:06:11 +00:00
|
|
|
#if !DXX_USE_OGL
|
2016-12-05 00:26:11 +00:00
|
|
|
#include "dsx-ns.h"
|
2015-10-09 02:46:09 +00:00
|
|
|
#include "3d.h"
|
2014-12-14 05:23:00 +00:00
|
|
|
#include "globvars.h"
|
2020-05-02 21:18:42 +00:00
|
|
|
#include <array>
|
2014-12-14 05:23:00 +00:00
|
|
|
|
2015-12-13 18:00:49 +00:00
|
|
|
namespace dcx {
|
2015-12-05 22:57:24 +00:00
|
|
|
|
2020-05-02 21:18:42 +00:00
|
|
|
struct polygon_clip_points : std::array<g3s_point *, MAX_POINTS_IN_POLY> {};
|
2014-11-16 19:14:51 +00:00
|
|
|
struct temporary_points_t
|
|
|
|
{
|
|
|
|
uint_fast32_t free_point_num;
|
2020-05-02 21:18:42 +00:00
|
|
|
std::array<g3s_point, MAX_POINTS_IN_POLY> temp_points;
|
|
|
|
std::array<g3s_point *, MAX_POINTS_IN_POLY> free_points;
|
2014-11-16 19:14:51 +00:00
|
|
|
temporary_points_t();
|
2022-10-02 19:51:35 +00:00
|
|
|
void free_temp_point(g3s_point &cp);
|
2014-11-16 19:14:51 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
const polygon_clip_points &clip_polygon(polygon_clip_points &src,polygon_clip_points &dest,int *nv,g3s_codes *cc,temporary_points_t &);
|
2022-10-02 19:51:35 +00:00
|
|
|
void clip_line(g3s_point *&p0, g3s_point *&p1, clipping_code codes_or, temporary_points_t &);
|
2015-12-05 22:57:24 +00:00
|
|
|
|
|
|
|
}
|
2012-11-11 22:12:51 +00:00
|
|
|
#endif
|
|
|
|
|
2006-03-20 17:12:09 +00:00
|
|
|
#endif
|