2014-06-01 17:55:23 +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-01 17:55:23 +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
|
|
|
/*
|
|
|
|
*
|
|
|
|
* took out functions declarations from include/3d.h
|
|
|
|
* which are implemented in 3d/interp.c
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2015-01-29 04:27:36 +00:00
|
|
|
#pragma once
|
2006-03-20 17:12:09 +00:00
|
|
|
|
2012-07-01 02:54:33 +00:00
|
|
|
#include "maths.h"
|
2006-03-20 17:12:09 +00:00
|
|
|
#include "3d.h"
|
|
|
|
|
2012-11-11 22:12:51 +00:00
|
|
|
#ifdef __cplusplus
|
2013-12-18 00:07:46 +00:00
|
|
|
#include "dxxsconf.h"
|
2016-03-19 19:08:10 +00:00
|
|
|
#include "dsx-ns.h"
|
2020-05-02 21:18:42 +00:00
|
|
|
#include <array>
|
2013-12-18 00:07:46 +00:00
|
|
|
|
2015-12-13 18:00:49 +00:00
|
|
|
namespace dcx {
|
2015-02-14 22:48:28 +00:00
|
|
|
class submodel_angles;
|
|
|
|
|
2017-10-14 17:10:30 +00:00
|
|
|
constexpr std::integral_constant<std::size_t, 1000> MAX_POLYGON_VECS{};
|
2020-05-02 21:18:42 +00:00
|
|
|
struct polygon_model_points : std::array<g3s_point, MAX_POLYGON_VECS> {};
|
2015-12-13 18:00:48 +00:00
|
|
|
}
|
2015-02-05 03:03:50 +00:00
|
|
|
|
2016-01-09 16:38:15 +00:00
|
|
|
#ifdef dsx
|
2015-12-13 18:00:49 +00:00
|
|
|
namespace dsx {
|
2013-12-18 00:07:46 +00:00
|
|
|
#if defined(DXX_BUILD_DESCENT_I)
|
2017-10-14 17:10:30 +00:00
|
|
|
#define glow_array_size 1
|
2013-12-18 00:07:46 +00:00
|
|
|
#elif defined(DXX_BUILD_DESCENT_II)
|
2017-10-14 17:10:30 +00:00
|
|
|
#define glow_array_size 2
|
2013-12-18 00:07:46 +00:00
|
|
|
#endif
|
2020-05-02 21:18:42 +00:00
|
|
|
struct glow_values_t : public std::array<fix, glow_array_size> {};
|
2017-10-14 17:10:30 +00:00
|
|
|
#undef glow_array_size
|
2012-11-11 22:12:51 +00:00
|
|
|
|
2006-03-20 17:12:09 +00:00
|
|
|
//Object functions:
|
|
|
|
|
|
|
|
//calls the object interpreter to render an object. The object renderer
|
|
|
|
//is really a seperate pipeline. returns true if drew
|
2017-02-11 21:42:40 +00:00
|
|
|
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);
|
2006-03-20 17:12:09 +00:00
|
|
|
|
|
|
|
//init code for bitmap models
|
2019-03-06 05:03:48 +00:00
|
|
|
int16_t g3_init_polygon_model(uint8_t *model_ptr, std::size_t model_size);
|
2019-03-20 03:57:15 +00:00
|
|
|
#if defined(DXX_BUILD_DESCENT_I)
|
|
|
|
void g3_validate_polygon_model(uint8_t *model_ptr, std::size_t model_size);
|
|
|
|
#endif
|
2015-12-13 18:00:48 +00:00
|
|
|
}
|
|
|
|
#endif
|
2006-03-20 17:12:09 +00:00
|
|
|
|
2016-01-09 16:38:15 +00:00
|
|
|
#ifdef dsx
|
2015-12-13 18:00:49 +00:00
|
|
|
namespace dsx {
|
2006-03-20 17:12:09 +00:00
|
|
|
//alternate interpreter for morphing object
|
2017-03-11 19:56:27 +00:00
|
|
|
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);
|
2006-03-20 17:12:09 +00:00
|
|
|
|
2011-04-07 20:32:51 +00:00
|
|
|
// check a polymodel for it's color and return it
|
2015-02-28 22:34:05 +00:00
|
|
|
int g3_poly_get_color(const uint8_t *model_ptr);
|
2015-12-13 18:00:48 +00:00
|
|
|
}
|
|
|
|
#endif
|
2011-04-07 20:32:51 +00:00
|
|
|
|
2015-12-13 18:00:49 +00:00
|
|
|
namespace dcx {
|
2016-09-30 01:49:57 +00:00
|
|
|
#if DXX_WORDS_BIGENDIAN
|
2006-03-20 17:12:09 +00:00
|
|
|
// routine to convert little to big endian in polygon model data
|
|
|
|
void swap_polygon_model_data(ubyte *data);
|
2015-06-13 22:42:21 +00:00
|
|
|
#else
|
|
|
|
static inline void swap_polygon_model_data(uint8_t *) {}
|
2006-03-20 17:12:09 +00:00
|
|
|
#endif
|
2015-12-13 18:00:48 +00:00
|
|
|
}
|
2006-03-20 17:12:09 +00:00
|
|
|
|
2012-11-11 22:12:51 +00:00
|
|
|
#endif
|