Debian Codegraph @

common/include/interp.h

raw
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 <span>
17 #include "maths.h"
18 #include "3d.h"
19
20 #include "dxxsconf.h"
21 #include "dsx-ns.h"
22 #include <array>
23
24 namespace dcx {
25 class submodel_angles;
26
27 struct polygon_model_points : std::array<g3s_point, 1000> {};
28 }
29
30 #ifdef DXX_BUILD_DESCENT
31 namespace dsx {
32 #if DXX_BUILD_DESCENT == 1
33 #define glow_array_size 1
34 #elif DXX_BUILD_DESCENT == 2
35 #define glow_array_size 2
36 #endif
37 struct glow_values_t : public std::array<fix, glow_array_size> {};
38 #undef glow_array_size
39
40 //Object functions:
41
42 //calls the object interpreter to render an object. The object renderer
43 //is really a seperate pipeline. returns true if drew
44 void g3_draw_polygon_model(grs_bitmap *const *model_bitmaps, polygon_model_points &Interp_point_list, grs_canvas &, tmap_drawer_type tmap_drawer_ptr, submodel_angles anim_angles, g3s_lrgb model_light, const glow_values_t *glow_values, const uint8_t *p);
45
46 //init code for bitmap models
47 int16_t g3_init_polygon_model(std::span<uint8_t> model);
48 #if DXX_BUILD_DESCENT == 1
49 void g3_validate_polygon_model(std::span<uint8_t> model);
50 #endif
51 }
52 #endif
53
54 #ifdef DXX_BUILD_DESCENT
55 namespace dsx {
56 //alternate interpreter for morphing object
57 void g3_draw_morphing_model(grs_canvas &, tmap_drawer_type tmap_drawer_ptr, 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);
58
59 // check a polymodel for it's color and return it
60 int g3_poly_get_color(const uint8_t *model_ptr);
61 }
62 #endif
63
64 namespace dcx {
65 // routine to convert little to big endian in polygon model data
66 void swap_polygon_model_data(uint8_t *data);
67 }