| 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 SHIPPAGE_H |
| 20 | #define SHIPPAGE_Hcxx . . $ `manage/shippage.h:20:9`! |
| 21 | |
| 22 | #include "manage.h"cxx . . $ `<file>/lib/manage.h`/ |
| 23 | #include "ship.h"cxx . . $ `<file>/Descent3/ship.h`/ |
| 24 | #include "cfile.h"cxx . . $ `<file>/cfile/cfile.h`/ |
| 25 | #include "pstypes.h"cxx . . $ `<file>/lib/pstypes.h`/ |
| 26 | |
| 27 | struct mngs_ship_pagecxx . . $ mngs_ship_page# { |
| 28 | shipcxx . . $ ship# ship_structcxx . . $ mngs_ship_page#ship_struct.; |
| 29 | char image_namecxx . . $ mngs_ship_page#image_name.[PAGENAME_LENcxx . . $ `lib/manage_external.h:49:9`!]; |
| 30 | char dying_image_namecxx . . $ mngs_ship_page#dying_image_name.[PAGENAME_LENcxx . . $ `lib/manage_external.h:49:9`!]; |
| 31 | char weapon_namecxx . . $ mngs_ship_page#weapon_name.[MAX_PLAYER_WEAPONScxx . . $ `Descent3/player_external_struct.h:91:9`!][MAX_WB_GUNPOINTScxx . . $ `lib/robotfirestruct_external.h:22:9`!][PAGENAME_LENcxx . . $ `lib/manage_external.h:49:9`!]; |
| 32 | char fire_sound_namecxx . . $ mngs_ship_page#fire_sound_name.[MAX_PLAYER_WEAPONScxx . . $ `Descent3/player_external_struct.h:91:9`!][MAX_WB_FIRING_MASKScxx . . $ `lib/robotfirestruct_external.h:23:9`!][PAGENAME_LENcxx . . $ `lib/manage_external.h:49:9`!]; |
| 33 | char med_image_namecxx . . $ mngs_ship_page#med_image_name.[PAGENAME_LENcxx . . $ `lib/manage_external.h:49:9`!]; |
| 34 | char lo_image_namecxx . . $ mngs_ship_page#lo_image_name.[PAGENAME_LENcxx . . $ `lib/manage_external.h:49:9`!]; |
| 35 | char firing_sound_namecxx . . $ mngs_ship_page#firing_sound_name.[MAX_PLAYER_WEAPONScxx . . $ `Descent3/player_external_struct.h:91:9`!][PAGENAME_LENcxx . . $ `lib/manage_external.h:49:9`!]; |
| 36 | char release_sound_namecxx . . $ mngs_ship_page#release_sound_name.[MAX_PLAYER_WEAPONScxx . . $ `Descent3/player_external_struct.h:91:9`!][PAGENAME_LENcxx . . $ `lib/manage_external.h:49:9`!]; |
| 37 | char spew_powerup_namecxx . . $ mngs_ship_page#spew_powerup_name.[MAX_PLAYER_WEAPONScxx . . $ `Descent3/player_external_struct.h:91:9`!][PAGENAME_LENcxx . . $ `lib/manage_external.h:49:9`!]; |
| 38 | }; |
| 39 | |
| 40 | // Ship page functions |
| 41 | //--------------------------------------------------------------- |
| 42 | |
| 43 | // Given an open file pointer and a ship_page struct, writes that shippage out |
| 44 | void mng_WriteShipPagecxx . . $ mng_WriteShipPage(d82cdf4b89141491).(CFILEcxx . . $ CFILE# *outfile, mngs_ship_pagecxx . . $ mngs_ship_page# *shippage); |
| 45 | |
| 46 | // Reads a ship page from an open file. Returns 0 on error. |
| 47 | int mng_ReadShipPagecxx . . $ mng_ReadShipPage(ec0053c10eec018b).(CFILEcxx . . $ CFILE# *infile, mngs_ship_pagecxx . . $ mngs_ship_page# *shippage); |
| 48 | |
| 49 | // Given an open file pointer and a ship_page struct, writes that shippage out |
| 50 | void mng_WriteNewShipPagecxx . . $ mng_WriteNewShipPage(d82cdf4b89141491).(CFILEcxx . . $ CFILE# *outfile, mngs_ship_pagecxx . . $ mngs_ship_page# *shippage); |
| 51 | |
| 52 | // Reads a ship page from an open file. Returns 0 on error. |
| 53 | int mng_ReadNewShipPagecxx . . $ mng_ReadNewShipPage(ec0053c10eec018b).(CFILEcxx . . $ CFILE# *infile, mngs_ship_pagecxx . . $ mngs_ship_page# *shippage); |
| 54 | |
| 55 | // Reads in the shippage named "name" into shippage struct |
| 56 | // Returns 0 on error or couldn't find, else 1 if all is good |
| 57 | int mng_FindSpecificShipPagecxx . . $ mng_FindSpecificShipPage(e928a488c1cbedd4).(char *name, mngs_ship_pagecxx . . $ mngs_ship_page# *shippage, int offset = 0); |
| 58 | |
| 59 | // Given a ship page, allocs a ship and calls AssignShipPageToShip to actually |
| 60 | // load model and values. Rturns ship handle on success, -1 if fail |
| 61 | int mng_SetAndLoadShipcxx . . $ mng_SetAndLoadShip(7b471d26e5a265f8).(mngs_ship_pagecxx . . $ mngs_ship_page# *shippage, CFILEcxx . . $ CFILE# *infile); |
| 62 | |
| 63 | // Given a shippage and a ship handle, attempts to make ship n correspond to |
| 64 | // to the shippage. |
| 65 | // Returns 1 on success, 0 otherwise |
| 66 | int mng_AssignShipPageToShipcxx . . $ mng_AssignShipPageToShip(9d5a2a40285cb110).(mngs_ship_pagecxx . . $ mngs_ship_page# *shippage, int n, CFILEcxx . . $ CFILE# *infile = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!); |
| 67 | |
| 68 | // Copies values from a Ship into a ship_page |
| 69 | void mng_AssignShipToShipPagecxx . . $ mng_AssignShipToShipPage(6c9ae2d5ec570cce).(int n, mngs_ship_pagecxx . . $ mngs_ship_page# *shippage); |
| 70 | |
| 71 | // Reads in a ship page from the local table file, superseding any ship |
| 72 | // already in RAM with that same name |
| 73 | void mng_LoadLocalShipPagecxx . . $ mng_LoadLocalShipPage(3639e799710acb68).(CFILEcxx . . $ CFILE# *); |
| 74 | |
| 75 | // Reads in a page off the net |
| 76 | void mng_LoadNetShipPagecxx . . $ mng_LoadNetShipPage(5a5441f2f69caf20).(CFILEcxx . . $ CFILE# *, bool overlay = false); |
| 77 | |
| 78 | #endif |