| 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 __HARDWARE_INTERNAL_H__ |
| 20 | #define __HARDWARE_INTERNAL_H__cxx . . $ `renderer/HardwareInternal.h:20:9`! |
| 21 | |
| 22 | #include "pserror.h"cxx . . $ `<file>/misc/pserror.h`/ |
| 23 | |
| 24 | #define MAX_POINTS_IN_POLYcxx . . $ `renderer/HardwareInternal.h:24:9`! 100 |
| 25 | |
| 26 | // These structs are for drawing with vertex arrays |
| 27 | // Useful for fast indexing |
| 28 | struct color_arraycxx . . $ color_array# { |
| 29 | float rcxx . . $ color_array#r., gcxx . . $ color_array#g., bcxx . . $ color_array#b., acxx . . $ color_array#a.; |
| 30 | }; |
| 31 | |
| 32 | struct tex_arraycxx . . $ tex_array# { |
| 33 | float scxx . . $ tex_array#s., tcxx . . $ tex_array#t., rcxx . . $ tex_array#r., wcxx . . $ tex_array#w.; |
| 34 | }; |
| 35 | |
| 36 | struct PosColorUVVertexcxx . . $ PosColorUVVertex# { |
| 37 | vectorcxx . . $ vector# poscxx . . $ PosColorUVVertex#pos.; |
| 38 | color_arraycxx . . $ color_array# colorcxx . . $ PosColorUVVertex#color.; |
| 39 | tex_arraycxx . . $ tex_array# uvcxx . . $ PosColorUVVertex#uv.; |
| 40 | }; |
| 41 | |
| 42 | struct PosColorUV2Vertexcxx . . $ PosColorUV2Vertex# { |
| 43 | vectorcxx . . $ vector# poscxx . . $ PosColorUV2Vertex#pos.; |
| 44 | color_arraycxx . . $ color_array# colorcxx . . $ PosColorUV2Vertex#color.; |
| 45 | tex_arraycxx . . $ tex_array# uv0cxx . . $ PosColorUV2Vertex#uv0.; |
| 46 | tex_arraycxx . . $ tex_array# uv1cxx . . $ PosColorUV2Vertex#uv1.; |
| 47 | }; |
| 48 | |
| 49 | void FreeTempPointcxx . . $ FreeTempPoint(4c7ad40c64d4fb9c).(g3Pointcxx . . $ g3Point# *p); |
| 50 | void InitFreePointscxx . . $ InitFreePoints(49f6e7a06ebc5aa8).(void); |
| 51 | void ClipLinecxx . . $ ClipLine(c1cfda758dd1a0e3).(g3Pointcxx . . $ g3Point# **p0, g3Pointcxx . . $ g3Point# **p1, uint8_tcxx . . $ uint8_t# codes_or); |
| 52 | |
| 53 | // Verify that all the temp points are free, and free them it they are not. |
| 54 | #ifdef _DEBUGcxx . . $ `<built-in>:480:9`! |
| 55 | void CheckTempPointscxx . . $ CheckTempPoints(49f6e7a06ebc5aa8).(); |
| 56 | #else |
| 57 | #define CheckTempPoints() |
| 58 | #endif |
| 59 | |
| 60 | extern int Window_widthcxx . . $ Window_width., Window_heightcxx . . $ Window_height.; // the actual integer width & height |
| 61 | extern float Window_w2cxx . . $ Window_w2., Window_h2cxx . . $ Window_h2.; // width,height/2 |
| 62 | extern float View_zoomcxx . . $ View_zoom.; |
| 63 | extern vectorcxx . . $ vector# View_positioncxx . . $ View_position., Matrix_scalecxx . . $ Matrix_scale.; |
| 64 | extern matrixcxx . . $ matrix# View_matrixcxx . . $ View_matrix., Unscaled_matrixcxx . . $ Unscaled_matrix.; |
| 65 | extern float Far_clip_zcxx . . $ Far_clip_z.; |
| 66 | |
| 67 | // For custom clipping plane |
| 68 | extern uint8_tcxx . . $ uint8_t# Clip_customcxx . . $ Clip_custom.; |
| 69 | extern float Clip_plane_distancecxx . . $ Clip_plane_distance.; |
| 70 | extern vectorcxx . . $ vector# Clip_planecxx . . $ Clip_plane.; |
| 71 | |
| 72 | extern float gTransformViewPortcxx . . $ gTransformViewPort.[4][4]; |
| 73 | extern float gTransformProjectioncxx . . $ gTransformProjection.[4][4]; |
| 74 | extern float gTransformModelViewcxx . . $ gTransformModelView.[4][4]; |
| 75 | extern float gTransformFullcxx . . $ gTransformFull.[4][4]; |
| 76 | void g3_UpdateFullTransformcxx . . $ g3_UpdateFullTransform(49f6e7a06ebc5aa8).(); |
| 77 | void g3_ForceTransformRefreshcxx . . $ g3_ForceTransformRefresh(49f6e7a06ebc5aa8).(void); |
| 78 | |
| 79 | void rend_TransformSetToPassthrucxx . . $ rend_TransformSetToPassthru(49f6e7a06ebc5aa8).(void); |
| 80 | void rend_TransformSetViewportcxx . . $ rend_TransformSetViewport(748afa4755bc9595).(int lx, int ty, int width, int height); |
| 81 | void rend_TransformSetProjectioncxx . . $ rend_TransformSetProjection(9fb3ef344050b01e).(float trans[4][4]); |
| 82 | void rend_TransformSetModelViewcxx . . $ rend_TransformSetModelView(9fb3ef344050b01e).(float trans[4][4]); |
| 83 | |
| 84 | int rend_ReInitcxx . . $ rend_ReInit(b126dc7c1de90089).(); |
| 85 | float rend_GetAlphaMultipliercxx . . $ rend_GetAlphaMultiplier(9b8c9e39889c762c).(); |
| 86 | |
| 87 | void gpu_SetMultitextureBlendModecxx . . $ gpu_SetMultitextureBlendMode(b45ddcbc8423892c).(bool state); |
| 88 | void gpu_BindTexturecxx . . $ gpu_BindTexture(b1146eedae1e1d0b).(int handle, int map_type, int slot); |
| 89 | void gpu_RenderPolygoncxx . . $ gpu_RenderPolygon(1c3023f92cf1bc74).(PosColorUVVertexcxx . . $ PosColorUVVertex# *vData, uint32_tcxx . . $ uint32_t# nv); |
| 90 | void gpu_RenderPolygonUV2cxx . . $ gpu_RenderPolygonUV2(e7931de23695a417).(PosColorUV2Vertexcxx . . $ PosColorUV2Vertex# *vData, uint32_tcxx . . $ uint32_t# nv); |
| 91 | void gpu_DrawFlatPolygon3Dcxx . . $ gpu_DrawFlatPolygon3D(3ae387dc3696f211).(g3Pointcxx . . $ g3Point# **p, int nv); |
| 92 | void rend_DrawMultitexturePolygon3Dcxx . . $ rend_DrawMultitexturePolygon3D(3928f75259b907be).(int handle, g3Pointcxx . . $ g3Point# **p, int nv, int map_type); |
| 93 | |
| 94 | #endif |