dxx-rebirth/common/main/morph.h

73 lines
2.2 KiB
C
Raw Normal View History

2006-03-20 17:12:09 +00:00
/*
2014-06-01 17:55:23 +00:00
* Portions of this file are copyright Rebirth contributors and licensed as
* described in COPYING.txt.
* Portions of this file are copyright Parallax Software and licensed
* according to the Parallax license below.
* See COPYING.txt for license details.
2006-03-20 17:12:09 +00:00
THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX
SOFTWARE CORPORATION ("PARALLAX"). PARALLAX, IN DISTRIBUTING THE CODE TO
END-USERS, AND SUBJECT TO ALL OF THE TERMS AND CONDITIONS HEREIN, GRANTS A
ROYALTY-FREE, PERPETUAL LICENSE TO SUCH END-USERS FOR USE BY SUCH END-USERS
IN USING, DISPLAYING, AND CREATING DERIVATIVE WORKS THEREOF, SO LONG AS
SUCH USE, DISPLAY OR CREATION IS FOR NON-COMMERCIAL, ROYALTY OR REVENUE
FREE PURPOSES. IN NO EVENT SHALL THE END-USER USE THE COMPUTER CODE
CONTAINED HEREIN FOR REVENUE-BEARING PURPOSES. THE END-USER UNDERSTANDS
AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE.
COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED.
*/
/*
*
* Header for morph.c
*
*/
2015-07-25 23:10:45 +00:00
#pragma once
2006-03-20 17:12:09 +00:00
2013-10-09 03:12:09 +00:00
#ifdef __cplusplus
2015-07-25 23:10:45 +00:00
#include <cstdint>
2015-04-02 02:36:52 +00:00
#include "dxxsconf.h"
2015-07-25 23:10:45 +00:00
#include "vecmat.h"
#include "pack.h"
#include "polyobj.h"
#include "dsx-ns.h"
2015-04-02 02:36:52 +00:00
#include "compiler-array.h"
2013-10-09 03:12:09 +00:00
#define MAX_VECS 5000
2006-03-20 17:12:09 +00:00
#ifdef dsx
#include "object.h"
2015-07-25 23:10:45 +00:00
struct morph_data : prohibit_void_ptr<morph_data>
{
2006-03-20 17:12:09 +00:00
object *obj; // object which is morphing
int n_submodels_active;
2015-07-25 23:10:45 +00:00
uint8_t morph_save_control_type;
uint8_t morph_save_movement_type;
2006-03-20 17:12:09 +00:00
physics_info morph_save_phys_info;
2015-03-22 18:49:21 +00:00
object_signature_t Morph_sig;
2015-04-02 02:36:52 +00:00
array<vms_vector, MAX_VECS> morph_vecs, morph_deltas;
array<fix, MAX_VECS> morph_times;
array<int, MAX_SUBMODELS> submodel_active, // which submodels are active
n_morphing_points, // how many active points in each part
submodel_startpoints; // first point for each submodel
};
2006-03-20 17:12:09 +00:00
constexpr std::integral_constant<unsigned, 5> MAX_MORPH_OBJECTS{};
2015-04-02 02:36:52 +00:00
extern array<morph_data, MAX_MORPH_OBJECTS> morph_objects;
2006-03-20 17:12:09 +00:00
void morph_start(vmobjptr_t obj);
void draw_morph_object(grs_canvas &, vmobjptridx_t obj);
2006-03-20 17:12:09 +00:00
//process the morphing object for one frame
void do_morph_frame(object &obj);
2006-03-20 17:12:09 +00:00
//called at the start of a level
void init_morphs();
morph_data *find_morph_data(object &obj);
#endif
2006-03-20 17:12:09 +00:00
2013-10-09 03:12:09 +00:00
#endif