| 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 | --- HISTORICAL COMMENTS FOLLOW --- |
| 19 | |
| 20 | * $Logfile: /DescentIII/Main/lightmap_info.h $ |
| 21 | * $Revision: 25 $ |
| 22 | * $Date: 3/20/00 12:12p $ |
| 23 | * $Author: Matt $ |
| 24 | * |
| 25 | * |
| 26 | * |
| 27 | * $Log: /DescentIII/Main/lightmap_info.h $ |
| 28 | * |
| 29 | * 25 3/20/00 12:12p Matt |
| 30 | * Merge of Duane's post-1.3 changes. |
| 31 | * Lower MAX_LIGHT_INFOS for Mac (Mac only) |
| 32 | * |
| 33 | * 24 10/21/99 6:42p Matt |
| 34 | * Mac merge |
| 35 | * |
| 36 | */ |
| 37 | |
| 38 | #ifndef LIGHTMAP_INFO_H |
| 39 | #define LIGHTMAP_INFO_Hcxx . . $ `Descent3/lightmap_info.h:39:9`! |
| 40 | // Lightmap info header |
| 41 | |
| 42 | #include "pstypes.h"cxx . . $ `<file>/lib/pstypes.h`/ |
| 43 | #include "pserror.h"cxx . . $ `<file>/misc/pserror.h`/ |
| 44 | #include "vecmat.h"cxx . . $ `<file>/lib/vecmat.h`/ |
| 45 | |
| 46 | #define BAD_LMI_INDEXcxx . . $ `Descent3/lightmap_info.h:46:9`! 65535 |
| 47 | |
| 48 | // What this lightmap is used for: |
| 49 | #define LMI_ROOMcxx . . $ `Descent3/lightmap_info.h:49:9`! 0 |
| 50 | #define LMI_ROOM_OBJECTcxx . . $ `Descent3/lightmap_info.h:50:9`! 1 |
| 51 | #define LMI_TERRAINcxx . . $ `Descent3/lightmap_info.h:51:9`! 2 |
| 52 | #define LMI_TERRAIN_OBJECTcxx . . $ `Descent3/lightmap_info.h:52:9`! 3 |
| 53 | #define LMI_DYNAMICcxx . . $ `Descent3/lightmap_info.h:53:9`! 4 |
| 54 | #define LMI_EXTERNAL_ROOMcxx . . $ `Descent3/lightmap_info.h:54:9`! 5 |
| 55 | #define LMI_EXTERNAL_ROOM_OBJECTcxx . . $ `Descent3/lightmap_info.h:55:9`! 6 |
| 56 | |
| 57 | struct lightmap_infocxx . . $ lightmap_info# { |
| 58 | uint8_tcxx . . $ uint8_t# xspacingcxx . . $ lightmap_info#xspacing., yspacingcxx . . $ lightmap_info#yspacing.; |
| 59 | uint16_tcxx . . $ uint16_t# lm_handlecxx . . $ lightmap_info#lm_handle.; |
| 60 | vectorcxx . . $ vector# upper_leftcxx . . $ lightmap_info#upper_left., normalcxx . . $ lightmap_info#normal.; |
| 61 | uint8_tcxx . . $ uint8_t# widthcxx . . $ lightmap_info#width., heightcxx . . $ lightmap_info#height., x1cxx . . $ lightmap_info#x1., y1cxx . . $ lightmap_info#y1.; |
| 62 | uint8_tcxx . . $ uint8_t# usedcxx . . $ lightmap_info#used.; |
| 63 | |
| 64 | uint16_tcxx . . $ uint16_t# dynamiccxx . . $ lightmap_info#dynamic.; |
| 65 | int16_t spec_mapcxx . . $ lightmap_info#spec_map.; |
| 66 | |
| 67 | uint8_tcxx . . $ uint8_t# typecxx . . $ lightmap_info#type.; // see LMI_types above |
| 68 | }; |
| 69 | |
| 70 | extern lightmap_infocxx . . $ lightmap_info# *LightmapInfocxx . . $ LightmapInfo.; |
| 71 | extern int Num_of_lightmap_infocxx . . $ Num_of_lightmap_info.; |
| 72 | extern int Num_lightmap_infos_readcxx . . $ Num_lightmap_infos_read.; |
| 73 | |
| 74 | #define MAX_LIGHTMAP_INFOScxx . . $ `Descent3/lightmap_info.h:74:9`! (65534) |
| 75 | |
| 76 | // Sets all the lightmaps to unused |
| 77 | void InitLightmapInfocxx . . $ InitLightmapInfo(d4f767463ce0a6b3).(int nummaps = 0); |
| 78 | |
| 79 | // Allocs a lightmap of w x h size |
| 80 | // Returns lightmap handle if successful, -1 if otherwise |
| 81 | int AllocLightmapInfocxx . . $ AllocLightmapInfo(b2eaad3020ba259e).(int w, int h, int type, bool alloc_lightmap = true); |
| 82 | |
| 83 | // Given a handle, frees the lightmap memory and flags this lightmap as unused |
| 84 | void FreeLightmapInfocxx . . $ FreeLightmapInfo(d4f767463ce0a6b3).(int handle); |
| 85 | |
| 86 | // Gets the width of this lightmap_info handle |
| 87 | int lmi_wcxx . . $ lmi_w(7864480464b09eea).(int handle); |
| 88 | |
| 89 | // Gets the height of this lightmap_info handle |
| 90 | int lmi_hcxx . . $ lmi_h(7864480464b09eea).(int handle); |
| 91 | |
| 92 | void CloseLightmapInfoscxx . . $ CloseLightmapInfos(49f6e7a06ebc5aa8).(); |
| 93 | |
| 94 | // Softens the edges of lightmaps so there are fewer artifaces |
| 95 | void ShadeLightmapInfoEdgescxx . . $ ShadeLightmapInfoEdges(d4f767463ce0a6b3).(int type); |
| 96 | void BlurLightmapInfoscxx . . $ BlurLightmapInfos(d4f767463ce0a6b3).(int type); |
| 97 | |
| 98 | #endif |