| 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 MEGACELL_H |
| 20 | #define MEGACELL_Hcxx . . $ `lib/megacell.h:20:9`! |
| 21 | |
| 22 | #include "pstypes.h"cxx . . $ `<file>/lib/pstypes.h`/ |
| 23 | #include "manage.h"cxx . . $ `<file>/lib/manage.h`/ |
| 24 | #include "gametexture.h"cxx . . $ `<file>/Descent3/gametexture.h`/ |
| 25 | |
| 26 | #define MAX_MEGACELLScxx . . $ `lib/megacell.h:26:9`! 100 |
| 27 | |
| 28 | #define DEFAULT_MEGACELL_WIDTHcxx . . $ `lib/megacell.h:28:9`! 8 |
| 29 | #define DEFAULT_MEGACELL_HEIGHTcxx . . $ `lib/megacell.h:29:9`! 8 |
| 30 | |
| 31 | #define MAX_MEGACELL_WIDTHcxx . . $ `lib/megacell.h:31:9`! 8 |
| 32 | #define MAX_MEGACELL_HEIGHTcxx . . $ `lib/megacell.h:32:9`! 8 |
| 33 | |
| 34 | struct megacellcxx . . $ megacell# { |
| 35 | char namecxx . . $ megacell#name.[PAGENAME_LENcxx . . $ `lib/manage_external.h:49:9`!]; |
| 36 | int8_t widthcxx . . $ megacell#width.; |
| 37 | int8_t heightcxx . . $ megacell#height.; |
| 38 | |
| 39 | int16_t texture_handlescxx . . $ megacell#texture_handles.[MAX_MEGACELL_WIDTHcxx . . $ `lib/megacell.h:31:9`! * MAX_MEGACELL_HEIGHTcxx . . $ `lib/megacell.h:32:9`!]; |
| 40 | int flagscxx . . $ megacell#flags.; |
| 41 | uint8_tcxx . . $ uint8_t# usedcxx . . $ megacell#used.; |
| 42 | }; |
| 43 | |
| 44 | extern int Num_megacellscxx . . $ Num_megacells.; |
| 45 | extern megacellcxx . . $ megacell# Megacellscxx . . $ Megacells.[MAX_MEGACELLScxx . . $ `lib/megacell.h:26:9`!]; |
| 46 | |
| 47 | // Sets all MEGACELLs to unused |
| 48 | void InitMegacellscxx . . $ InitMegacells(49f6e7a06ebc5aa8).(); |
| 49 | |
| 50 | // Allocs a MEGACELL for use, returns -1 if error, else index on success |
| 51 | int AllocMegacellcxx . . $ AllocMegacell(b126dc7c1de90089).(); |
| 52 | |
| 53 | // Frees MEGACELL index n |
| 54 | void FreeMegacellcxx . . $ FreeMegacell(d4f767463ce0a6b3).(int n); |
| 55 | |
| 56 | // Gets next MEGACELL from n that has actually been alloced |
| 57 | int GetNextMegacellcxx . . $ GetNextMegacell(7864480464b09eea).(int n); |
| 58 | |
| 59 | // Gets previous MEGACELL from n that has actually been alloced |
| 60 | int GetPrevMegacellcxx . . $ GetPrevMegacell(7864480464b09eea).(int n); |
| 61 | |
| 62 | // Searches thru all MEGACELLs for a specific name, returns -1 if not found |
| 63 | // or index of MEGACELL with name |
| 64 | int FindMegacellNamecxx . . $ FindMegacellName(1ef8e6ec083aabb9).(char *name); |
| 65 | |
| 66 | #endif |