Subversion Repositories Games.Descent

Rev

Blame | Last modification | View Log | Download | RSS feed

  1. /*
  2.  * This file is part of the DXX-Rebirth project <https://www.dxx-rebirth.com/>.
  3.  * It is copyright by its individual contributors, as recorded in the
  4.  * project's Git history.  See COPYING.txt at the top level for license
  5.  * terms and a link to the Git history.
  6.  */
  7. /*
  8.  *
  9.  * Header for clipper.c
  10.  *
  11.  */
  12.  
  13. #pragma once
  14.  
  15. #ifdef __cplusplus
  16. #include "dxxsconf.h"
  17. #include <cstdint>
  18.  
  19. struct g3s_codes;
  20. struct g3s_point;
  21.  
  22. #if !DXX_USE_OGL
  23. #include "dsx-ns.h"
  24. #include "3d.h"
  25. #include "globvars.h"
  26. #include <array>
  27.  
  28. namespace dcx {
  29.  
  30. struct polygon_clip_points : std::array<g3s_point *, MAX_POINTS_IN_POLY> {};
  31. struct temporary_points_t
  32. {
  33.         uint_fast32_t free_point_num;
  34.         std::array<g3s_point, MAX_POINTS_IN_POLY> temp_points;
  35.         std::array<g3s_point *, MAX_POINTS_IN_POLY> free_points;
  36.         temporary_points_t();
  37.         void free_temp_point(g3s_point *cp);
  38. };
  39.  
  40. const polygon_clip_points &clip_polygon(polygon_clip_points &src,polygon_clip_points &dest,int *nv,g3s_codes *cc,temporary_points_t &);
  41. void clip_line(g3s_point *&p0,g3s_point *&p1,uint_fast8_t codes_or,temporary_points_t &);
  42.  
  43. }
  44. #endif
  45.  
  46. #endif
  47.