dxx-rebirth/common/main/morph.h

88 lines
2.3 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
#ifdef dsx
#include "object.h"
2015-07-25 23:10:45 +00:00
namespace dsx {
struct morph_data : prohibit_void_ptr<morph_data>
{
2020-02-01 22:33:31 +00:00
enum
{
MAX_VECS = 5000,
};
enum class submodel_state : uint8_t
{
invisible,
animating,
visible,
};
object *obj = nullptr; // object which is morphing
uint8_t n_submodels_active;
2015-07-25 23:10:45 +00:00
uint8_t morph_save_control_type;
uint8_t morph_save_movement_type;
2015-03-22 18:49:21 +00:00
object_signature_t Morph_sig;
physics_info morph_save_phys_info;
array<submodel_state, MAX_SUBMODELS> submodel_active; // which submodels are active
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>
2015-04-02 02:36:52 +00:00
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
struct d_level_unique_morph_object_state
{
array<morph_data, 5> morph_objects;
};
extern d_level_unique_morph_object_state LevelUniqueMorphObjectState;
}
2006-03-20 17:12:09 +00:00
void morph_start(vmobjptr_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