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.  * took out functions declarations from include/3d.h
  10.  * which are implemented in 3d/interp.c
  11.  *
  12.  */
  13.  
  14. #pragma once
  15.  
  16. #include "maths.h"
  17. #include "3d.h"
  18.  
  19. #ifdef __cplusplus
  20. #include "dxxsconf.h"
  21. #include "dsx-ns.h"
  22. #include <array>
  23.  
  24. namespace dcx {
  25. class submodel_angles;
  26.  
  27. constexpr std::integral_constant<std::size_t, 1000> MAX_POLYGON_VECS{};
  28. struct polygon_model_points : std::array<g3s_point, MAX_POLYGON_VECS> {};
  29. }
  30.  
  31. #ifdef dsx
  32. namespace dsx {
  33. #if defined(DXX_BUILD_DESCENT_I)
  34. #define glow_array_size 1
  35. #elif defined(DXX_BUILD_DESCENT_II)
  36. #define glow_array_size 2
  37. #endif
  38. struct glow_values_t : public std::array<fix, glow_array_size> {};
  39. #undef glow_array_size
  40.  
  41. //Object functions:
  42.  
  43. //calls the object interpreter to render an object.  The object renderer
  44. //is really a seperate pipeline. returns true if drew
  45. void g3_draw_polygon_model(grs_bitmap *const *model_bitmaps, polygon_model_points &Interp_point_list, grs_canvas &, submodel_angles anim_angles, g3s_lrgb model_light, const glow_values_t *glow_values, const uint8_t *p);
  46.  
  47. //init code for bitmap models
  48. int16_t g3_init_polygon_model(uint8_t *model_ptr, std::size_t model_size);
  49. #if defined(DXX_BUILD_DESCENT_I)
  50. void g3_validate_polygon_model(uint8_t *model_ptr, std::size_t model_size);
  51. #endif
  52. }
  53. #endif
  54.  
  55. #ifdef dsx
  56. namespace dsx {
  57. //alternate interpreter for morphing object
  58. void g3_draw_morphing_model(grs_canvas &, const uint8_t *model_ptr, grs_bitmap *const *model_bitmaps, submodel_angles anim_angles, g3s_lrgb light, const vms_vector *new_points, polygon_model_points &Interp_point_list);
  59.  
  60. // check a polymodel for it's color and return it
  61. int g3_poly_get_color(const uint8_t *model_ptr);
  62. }
  63. #endif
  64.  
  65. namespace dcx {
  66. #if DXX_WORDS_BIGENDIAN
  67. // routine to convert little to big endian in polygon model data
  68. void swap_polygon_model_data(ubyte *data);
  69. #else
  70. static inline void swap_polygon_model_data(uint8_t *) {}
  71. #endif
  72. }
  73.  
  74. #endif
  75.