Details | Last modification | View Log | RSS feed
| Rev | Author | Line No. | Line |
|---|---|---|---|
| 1 | pmbaty | 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 | |||
| 37 | #define VCLIP_SMALL_EXPLOSION 2 |
||
| 38 | #define VCLIP_PLAYER_HIT 1 |
||
| 39 | #define VCLIP_MORPHING_ROBOT 10 |
||
| 40 | #define VCLIP_PLAYER_APPEARANCE 61 |
||
| 41 | #define VCLIP_POWERUP_DISAPPEARANCE 62 |
||
| 42 | #define VCLIP_VOLATILE_WALL_HIT 5 |
||
| 43 | #ifdef dsx |
||
| 44 | namespace dsx { |
||
| 45 | #if defined(DXX_BUILD_DESCENT_I) |
||
| 46 | #elif defined(DXX_BUILD_DESCENT_II) |
||
| 47 | #define VCLIP_WATER_HIT 84 |
||
| 48 | #define VCLIP_AFTERBURNER_BLOB 95 |
||
| 49 | #define VCLIP_MONITOR_STATIC 99 |
||
| 50 | #endif |
||
| 51 | } |
||
| 52 | |||
| 53 | namespace dcx { |
||
| 54 | #define VCLIP_MAX_FRAMES 30 |
||
| 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 | short sound_num; |
||
| 66 | std::array<bitmap_index, VCLIP_MAX_FRAMES> frames; |
||
| 67 | fix light_value; |
||
| 68 | }; |
||
| 69 | |||
| 70 | constexpr std::integral_constant<int, -1> vclip_none{}; |
||
| 71 | |||
| 72 | } |
||
| 73 | |||
| 74 | namespace dsx { |
||
| 75 | // draw an object which renders as a vclip. |
||
| 76 | void draw_vclip_object(grs_canvas &, vcobjptridx_t obj, fix timeleft, const vclip &); |
||
| 77 | void draw_weapon_vclip(const d_vclip_array &Vclip, const weapon_info_array &Weapon_info, grs_canvas &, vcobjptridx_t obj); |
||
| 78 | } |
||
| 79 | |||
| 80 | namespace dcx { |
||
| 81 | /* |
||
| 82 | * reads n vclip structs from a PHYSFS_File |
||
| 83 | */ |
||
| 84 | void vclip_read(PHYSFS_File *fp, vclip &vc); |
||
| 85 | #if 0 |
||
| 86 | void vclip_write(PHYSFS_File *fp, const vclip &vc); |
||
| 87 | #endif |
||
| 88 | } |
||
| 89 | |||
| 90 | /* Defer expansion to source file so that serial.h not needed here */ |
||
| 91 | #define DEFINE_VCLIP_SERIAL_UDT() \ |
||
| 92 | DEFINE_SERIAL_UDT_TO_MESSAGE(bitmap_index, bi, (bi.index)); \ |
||
| 93 | 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)); \ |
||
| 94 | ASSERT_SERIAL_UDT_MESSAGE_SIZE(vclip, 82); |
||
| 95 | #endif |
||
| 96 | |||
| 97 | #endif |