dxx-rebirth/common/main/vclip.h

98 lines
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.
*/
/*
*
* Stuff for video clips.
*
*/
2015-01-29 04:27:36 +00:00
#pragma once
2006-03-20 17:12:09 +00:00
#include "piggy.h"
#ifdef __cplusplus
2014-01-18 18:02:02 +00:00
#include "dxxsconf.h"
#include "fwd-valptridx.h"
2018-10-21 00:24:07 +00:00
#include "fwd-vclip.h"
2018-10-21 00:24:07 +00:00
#include "fwd-weapon.h"
2014-01-18 18:02:02 +00:00
2006-03-20 17:12:09 +00:00
#define VCLIP_SMALL_EXPLOSION 2
#define VCLIP_PLAYER_HIT 1
#define VCLIP_MORPHING_ROBOT 10
#define VCLIP_PLAYER_APPEARANCE 61
#define VCLIP_POWERUP_DISAPPEARANCE 62
#define VCLIP_VOLATILE_WALL_HIT 5
2016-01-09 16:38:15 +00:00
#ifdef dsx
namespace dsx {
#if defined(DXX_BUILD_DESCENT_I)
#elif defined(DXX_BUILD_DESCENT_II)
2006-03-20 17:12:09 +00:00
#define VCLIP_WATER_HIT 84
#define VCLIP_AFTERBURNER_BLOB 95
#define VCLIP_MONITOR_STATIC 99
#endif
}
namespace dcx {
2006-03-20 17:12:09 +00:00
#define VCLIP_MAX_FRAMES 30
// vclip flags
#define VF_ROD 1 // draw as a rod, not a blob
struct vclip : public prohibit_void_ptr<vclip>
2014-01-12 23:00:43 +00:00
{
2006-03-20 17:12:09 +00:00
fix play_time; // total time (in seconds) of clip
unsigned num_frames;
2006-03-20 17:12:09 +00:00
fix frame_time; // time (in seconds) of each frame
uint8_t flags;
2006-03-20 17:12:09 +00:00
short sound_num;
2020-05-02 21:18:42 +00:00
std::array<bitmap_index, VCLIP_MAX_FRAMES> frames;
2006-03-20 17:12:09 +00:00
fix light_value;
2014-01-12 23:00:43 +00:00
};
2006-03-20 17:12:09 +00:00
constexpr std::integral_constant<int, -1> vclip_none{};
2014-10-04 15:04:44 +00:00
}
namespace dsx {
2006-03-20 17:12:09 +00:00
// draw an object which renders as a vclip.
void draw_vclip_object(grs_canvas &, vcobjptridx_t obj, fix timeleft, const vclip &);
2018-10-21 00:24:07 +00:00
void draw_weapon_vclip(const d_vclip_array &Vclip, const weapon_info_array &Weapon_info, grs_canvas &, vcobjptridx_t obj);
}
2006-03-20 17:12:09 +00:00
namespace dcx {
2006-03-20 17:12:09 +00:00
/*
* reads n vclip structs from a PHYSFS_File
2006-03-20 17:12:09 +00:00
*/
void vclip_read(PHYSFS_File *fp, vclip &vc);
2015-12-04 03:36:31 +00:00
#if 0
void vclip_write(PHYSFS_File *fp, const vclip &vc);
2015-12-04 03:36:31 +00:00
#endif
}
2014-01-12 23:00:43 +00:00
/* Defer expansion to source file so that serial.h not needed here */
#define DEFINE_VCLIP_SERIAL_UDT() \
2022-12-31 16:21:47 +00:00
/* DEFINE_SERIAL_UDT_TO_MESSAGE(bitmap_index, bi, (bi.index)); */ \
DEFINE_SERIAL_UDT_TO_MESSAGE(vclip, vc, (vc.play_time, vc.num_frames, vc.frame_time, vc.flags, serial::pad<3>(), vc.sound_num, vc.frames, vc.light_value)); \
2014-01-12 23:00:43 +00:00
ASSERT_SERIAL_UDT_MESSAGE_SIZE(vclip, 82);
#endif
2006-03-20 17:12:09 +00:00
#endif