Files
Cesarus85--ringfall-mjolnir-vr/source/structures/structure_visibility.c
T

160 lines
4.1 KiB
C

/*
STRUCTURE_VISIBILITY.C
symbols in this file:
00185E20 0020:
_debug_pvs (0000)
00185E40 00c0:
_structure_visibility_find_camera (0000)
00185F00 01a0:
_code_00185f00 (0000)
001860A0 0210:
_code_001860a0 (0000)
001862B0 00b0:
_code_001862b0 (0000)
00186360 0180:
_code_00186360 (0000)
001864E0 00d0:
_structure_visibility_find_objects (0000)
001865B0 00b0:
_code_001865b0 (0000)
00186660 00a0:
_code_00186660 (0000)
00186700 0120:
_dequantize_byte_to_real_rectangle3d (0000)
00186820 0160:
_code_00186820 (0000)
00186980 01e0:
_code_00186980 (0000)
00186B60 01e0:
_code_00186b60 (0000)
00186D40 0080:
_code_00186d40 (0000)
00186DC0 0070:
_code_00186dc0 (0000)
00186E30 02c0:
_structure_visibility_find_mirror (0000)
001870F0 0260:
_code_001870f0 (0000)
00187350 0390:
_code_00187350 (0000)
001876E0 01e0:
_structure_visibility_build_surfaces (0000)
001878C0 0110:
_code_001878c0 (0000)
001879D0 0240:
_structure_visibility_compute (0000)
002A1AF4 0010:
_rdata_002a1af4 (0000)
002A1B04 002e:
??_C@_0CO@GHPNGJCB@render_structure_visibility_surf@ (0000)
002A1B34 0031:
??_C@_0DB@DIILMMGG@render_structure_visibility_subc@ (0000)
002A1B68 002d:
??_C@_0CN@MLHMCLEC@render_structure_visibility_port@ (0000)
002A1B98 005f:
??_C@_0FP@IPNIKPHC@surface_index_buffer?9?$CIlong?5?$CK?$CJ?5cl@ (0000)
002A1BF8 0031:
??_C@_0DB@MPCJDDJE@c?3?2halo?2SOURCE?2structures?2struct@ (0000)
002A1C2C 0018:
??_C@_0BI@CMHFMAEP@valid_portal_hull?$CIhull?$CJ?$AA@ (0000)
002A1C44 000a:
??_C@_09KEGCCCGI@rectangle?$AA@ (0000)
002A1C50 0048:
??_C@_0EI@NFFPBLL@leaf?9?$DOcluster_index?$DO?$DN0?5?$CG?$CG?5leaf?9?$DO@ (0000)
002A1C98 000c:
??_C@_0M@ONJFEIPI@cull_bounds?$AA@ (0000)
002A1CA4 0013:
??_C@_0BD@FKHEAHGO@cull_sphere_center?$AA@ (0000)
002A1CB8 000e:
??_C@_0O@FEFHBCMC@parent_bounds?$AA@ (0000)
002A1CC8 000d:
??_C@_0N@JIFGGPLM@intersection?$AA@ (0000)
002A1CD8 0008:
??_C@_07KLBPNJKH@ooz?$DO0?4f?$AA@ (0000)
002A1CE0 001b:
??_C@_0BL@FCCKLIAE@result?9?$DOvertex_count?$CB?$DNNONE?$AA@ (0000)
002A1CFC 002a:
??_C@_0CK@MFEAOING@two?5mirrors?5visible?5with?5differe@ (0000)
002A1D28 001c:
??_C@_0BM@EAJICMMM@portal?5intersection?5failed?4?$AA@ (0000)
002A1D44 002f:
??_C@_0CP@KGOLAMLM@rendered_cluster?9?$DOcluster_index?$DN@ (0000)
002A1D74 0020:
??_C@_0CA@HGGGAHMD@raise?5MAXIMUM_RENDERED_CLUSTERS?$AA@ (0000)
002A1D94 0022:
??_C@_0CC@IDJIEBBJ@valid_portal_hull?$CIvisible_region@ (0000)
002A1DB8 002d:
??_C@_0CN@EHONMIFE@?$CBbounding_surface_count?5?$HM?$HM?5bound@ (0000)
002A1DE8 0017:
??_C@_0BH@ODLPNGPJ@bounding_sphere_center?$AA@ (0000)
002A1E00 0053:
??_C@_0FD@MFIJDILG@?$CD?$CD?$CD?5WARNING?3?5this?5structure_bsp?5@ (0000)
00313AF0 11ec:
_data_00313af0 (0000)
_structure_sphere_threshold (11e8)
004C0CF0 040c:
_bss_004c0cf0 (0000)
*/
/* ---------- headers */
#include "cseries.h"
#define dequantize_byte_to_real structure_visibility_dequantize_byte_to_real_external
#include "math/real_math.h"
#undef dequantize_byte_to_real
/* ---------- constants */
/* ---------- macros */
/* ---------- structures */
/* ---------- prototypes */
/* ---------- globals */
extern boolean debug_portals;
extern boolean structures_use_pvs_for_vs;
/* ---------- public code */
void debug_pvs(
boolean on)
{
debug_portals = on;
structures_use_pvs_for_vs = on;
return;
}
/* ---------- private code */
static __inline real dequantize_byte_to_real(
real min,
real max,
byte value)
{
if (value == UNSIGNED_CHAR_MAX)
{
return max;
}
return (max - min) * ((real)value / 255.f) + min;
}
real_rectangle3d *dequantize_byte_to_real_rectangle3d(
real_rectangle3d const *parent,
byte_rectangle3d const *compressed_rectangle,
real_rectangle3d *result)
{
result->x0 = dequantize_byte_to_real(parent->x0, parent->x1, compressed_rectangle->x0);
result->x1 = dequantize_byte_to_real(parent->x0, parent->x1, compressed_rectangle->x1);
result->y0 = dequantize_byte_to_real(parent->y0, parent->y1, compressed_rectangle->y0);
result->y1 = dequantize_byte_to_real(parent->y0, parent->y1, compressed_rectangle->y1);
result->z0 = dequantize_byte_to_real(parent->z0, parent->z1, compressed_rectangle->z0);
result->z1 = dequantize_byte_to_real(parent->z0, parent->z1, compressed_rectangle->z1);
return result;
}