| 1 |
/* |
| 2 |
* Portions of this file are copyright Rebirth contributors and licensed as |
| 3 |
* described in COPYING.txt. |
| 4 |
* Portions of this file are copyright Parallax Software and licensed |
| 5 |
* according to the Parallax license below. |
| 6 |
* See COPYING.txt for license details. |
| 7 |
|
| 8 |
THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX |
| 9 |
SOFTWARE CORPORATION ("PARALLAX"). PARALLAX, IN DISTRIBUTING THE CODE TO |
| 10 |
END-USERS, AND SUBJECT TO ALL OF THE TERMS AND CONDITIONS HEREIN, GRANTS A |
| 11 |
ROYALTY-FREE, PERPETUAL LICENSE TO SUCH END-USERS FOR USE BY SUCH END-USERS |
| 12 |
IN USING, DISPLAYING, AND CREATING DERIVATIVE WORKS THEREOF, SO LONG AS |
| 13 |
SUCH USE, DISPLAY OR CREATION IS FOR NON-COMMERCIAL, ROYALTY OR REVENUE |
| 14 |
FREE PURPOSES. IN NO EVENT SHALL THE END-USER USE THE COMPUTER CODE |
| 15 |
CONTAINED HEREIN FOR REVENUE-BEARING PURPOSES. THE END-USER UNDERSTANDS |
| 16 |
AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE. |
| 17 |
COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. |
| 18 |
*/ |
| 19 |
|
| 20 |
/* |
| 21 |
* |
| 22 |
* Stuff for video clips. |
| 23 |
* |
| 24 |
*/ |
| 25 |
|
| 26 |
#pragma once |
| 27 |
|
| 28 |
#include "piggy.h" |
| 29 |
|
| 30 |
#ifdef __cplusplus |
| 31 |
#include "dxxsconf.h" |
| 32 |
#include "fwd-valptridx.h" |
| 33 |
#include "fwd-vclip.h" |
| 34 |
#include "fwd-weapon.h" |
| 35 |
|
| 36 |
#ifdef DXX_BUILD_DESCENT |
| 37 |
namespace dcx { |
| 38 |
|
| 39 |
enum class vclip_index : uint8_t |
| 40 |
{ |
| 41 |
player_hit = 1, |
| 42 |
volatile_wall_hit = 5, |
| 43 |
small_explosion = 2, |
| 44 |
morphing_robot = 10, |
| 45 |
big_player_explosion = 58, |
| 46 |
player_appearance = 61, |
| 47 |
powerup_disappearance = 62, |
| 48 |
/* if DXX_BUILD_DESCENT == 2 */ |
| 49 |
water_hit = 84, |
| 50 |
afterburner_blob = 95, |
| 51 |
monitor_static = 99, |
| 52 |
/* endif */ |
| 53 |
None = UINT8_MAX |
| 54 |
}; |
| 55 |
|
| 56 |
// vclip flags |
| 57 |
#define VF_ROD 1 // draw as a rod, not a blob |
| 58 |
|
| 59 |
struct vclip : public prohibit_void_ptr<vclip> |
| 60 |
{ |
| 61 |
fix play_time; // total time (in seconds) of clip |
| 62 |
unsigned num_frames; |
| 63 |
fix frame_time; // time (in seconds) of each frame |
| 64 |
uint8_t flags; |
| 65 |
sound_effect sound_num; |
| 66 |
std::array<bitmap_index, 30> frames; |
| 67 |
fix light_value; |
| 68 |
}; |
| 69 |
|
| 70 |
} |
| 71 |
|
| 72 |
namespace dsx { |
| 73 |
// draw an object which renders as a vclip. |
| 74 |
void draw_vclip_object(grs_canvas &, vcobjptridx_t obj, fix timeleft, const vclip &); |
| 75 |
void draw_weapon_vclip(const d_vclip_array &Vclip, const weapon_info_array &Weapon_info, grs_canvas &, vcobjptridx_t obj); |
| 76 |
} |
| 77 |
|
| 78 |
namespace dcx { |
| 79 |
/* |
| 80 |
* reads n vclip structs from a PHYSFS_File |
| 81 |
*/ |
| 82 |
void vclip_read(NamedPHYSFS_File fp, vclip &vc); |
| 83 |
#if 0 |
| 84 |
void vclip_write(PHYSFS_File *fp, const vclip &vc); |
| 85 |
#endif |
| 86 |
} |
| 87 |
|
| 88 |
/* Defer expansion to source file so that serial.h not needed here */ |
| 89 |
#define DEFINE_VCLIP_SERIAL_UDT() \ |
| 90 |
/* DEFINE_SERIAL_UDT_TO_MESSAGE(bitmap_index, bi, (bi.index)); */ \ |
| 91 |
DEFINE_SERIAL_UDT_TO_MESSAGE(vclip, vc, (vc.play_time, vc.num_frames, vc.frame_time, vc.flags, serial::pad<3>(), vc.sound_num, serial::pad<1>(), vc.frames, vc.light_value)); \ |
| 92 |
ASSERT_SERIAL_UDT_MESSAGE_SIZE(vclip, 82); |
| 93 |
#endif |
| 94 |
|
| 95 |
#endif |