| 1 | /* |
| 2 | * Descent 3 |
| 3 | * Copyright (C) 2024 Parallax Software |
| 4 | * |
| 5 | * This program is free software: you can redistribute it and/or modify |
| 6 | * it under the terms of the GNU General Public License as published by |
| 7 | * the Free Software Foundation, either version 3 of the License, or |
| 8 | * (at your option) any later version. |
| 9 | * |
| 10 | * This program is distributed in the hope that it will be useful, |
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 | * GNU General Public License for more details. |
| 14 | * |
| 15 | * You should have received a copy of the GNU General Public License |
| 16 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 17 | */ |
| 18 | |
| 19 | #ifndef VCLIP_H |
| 20 | |
| 21 | #define VCLIP_Hcxx . . $ `Descent3/vclip.h:21:9`! |
| 22 | |
| 23 | #include <filesystem> |
| 24 | |
| 25 | #include "fix.h"cxx . . $ `<file>/fix/fix.h`/ |
| 26 | #include "manage.h"cxx . . $ `<file>/lib/manage.h`/ |
| 27 | |
| 28 | #define MAX_VCLIPScxx . . $ `Descent3/vclip.h:28:9`! 200 |
| 29 | #define VCLIP_MAX_FRAMEScxx . . $ `Descent3/vclip.h:29:9`! 50 |
| 30 | |
| 31 | #define VCF_NOT_RESIDENTcxx . . $ `Descent3/vclip.h:31:9`! 1 |
| 32 | #define VCF_WANTS_MIPPEDcxx . . $ `Descent3/vclip.h:32:9`! 2 |
| 33 | |
| 34 | struct vclipcxx . . $ vclip# { |
| 35 | char namecxx . . $ vclip#name.[PAGENAME_LENcxx . . $ `lib/manage_external.h:49:9`!]; |
| 36 | int16_t num_framescxx . . $ vclip#num_frames.; |
| 37 | int16_t *framescxx . . $ vclip#frames.; // bitmap indices |
| 38 | float frame_timecxx . . $ vclip#frame_time.; // time (in seconds) of each frame |
| 39 | int flagscxx . . $ vclip#flags.; |
| 40 | uint8_tcxx . . $ uint8_t# target_sizecxx . . $ vclip#target_size.; // what size this vclip should use (texture wise) |
| 41 | uint8_tcxx . . $ uint8_t# usedcxx . . $ vclip#used.; // Is this vclip in use? |
| 42 | }; |
| 43 | |
| 44 | extern vclipcxx . . $ vclip# GameVClipscxx . . $ GameVClips.[MAX_VCLIPScxx . . $ `Descent3/vclip.h:28:9`!]; |
| 45 | extern int Num_vclipscxx . . $ Num_vclips.; |
| 46 | |
| 47 | // Simply sets all vclips to unused |
| 48 | void InitVClipscxx . . $ InitVClips(49f6e7a06ebc5aa8).(); |
| 49 | |
| 50 | // Allocs a vclip for use |
| 51 | // Returns -1 on error |
| 52 | int AllocVClipcxx . . $ AllocVClip(b126dc7c1de90089).(); |
| 53 | |
| 54 | // Frees a vclip |
| 55 | void FreeVClipcxx . . $ FreeVClip(d4f767463ce0a6b3).(int num); |
| 56 | |
| 57 | // Saves a given video clip to a file |
| 58 | // Returns 1 if everything ok, 0 otherwise |
| 59 | // "num" is index into GameVClip array |
| 60 | int SaveVClipcxx . . $ SaveVClip(220e687f58daa9be).(const stdcxx . . $ std/::filesystemcxx . . $ std/filesystem/::pathcxx . . $ std/filesystem/__cxx11/path#& filename, int num); |
| 61 | |
| 62 | // Allocs and loads a vclip from the file named "filename" |
| 63 | // Returns -1 on error, index into GameVClip array on success |
| 64 | // Argument texture means that this vclip is an animated texture and |
| 65 | // needs to have an 8bit version |
| 66 | int AllocLoadVClipcxx . . $ AllocLoadVClip(cf529e05df08c24).(const char *filename, int texture_size, int mipped, int pageable = 0, int format = 0); |
| 67 | |
| 68 | // Allocs and loads a vclip from a 3DS ILS file |
| 69 | // Returns -1 on error, else index into GameVClips on success |
| 70 | // Argument texture means that this vclip is an animated texture and |
| 71 | // needs to have an 8bit version |
| 72 | int AllocLoadIFLVClipcxx . . $ AllocLoadIFLVClip(c0ca7c05705093b).(const char *filename, int texture_size, int mipped, int format = 0); |
| 73 | |
| 74 | // gets the filename from a path, plus appends our .oaf extension |
| 75 | void ChangeVClipNamecxx . . $ ChangeVClipName(611124a97efc52dd).(const char *src, char *dest); |
| 76 | |
| 77 | // Searches thru all vclips for a specific name, returns -1 if not found |
| 78 | // or index of vclip with name |
| 79 | int FindVClipNamecxx . . $ FindVClipName(5c4306d8553b3696).(const char *name); |
| 80 | |
| 81 | // Pages in a vclip if it needs to be |
| 82 | void PageInVClipcxx . . $ PageInVClip(d4f767463ce0a6b3).(int vcnum); |
| 83 | |
| 84 | #endif |