mirror of
https://github.com/Cesarus85/ringfall-mjolnir-vr.git
synced 2026-10-17 16:00:26 +02:00
Import only independently reviewed production changes. Preserve canonical physics and virtual-keyboard repairs; keep B3 and all unresolved holds out. Record exactly four approved canary debits (6987 meaningful bytes), six Halo admissions and two revocations. Keep vendor ioinit/storage work separate. Full build, 8252-row sweep, 1318 tests, park/admission/fake audits and 621-object binding pass within approved debit bounds. Do not publish donor research dumps or private assets. README and unrelated user research remain untouched. See frontier_publication_reconciliation_20260927.md for complete evidence limits and accounting.
89 lines
1.8 KiB
C
89 lines
1.8 KiB
C
/*
|
|
OBJECT_SHADOWS.C
|
|
|
|
symbols in this file:
|
|
0012B870 0010:
|
|
_code_0012b870 (0000)
|
|
0012B880 0050:
|
|
_code_0012b880 (0000)
|
|
0012B8D0 0080:
|
|
_object_build_shadow (0000)
|
|
*/
|
|
|
|
/* ---------- headers */
|
|
|
|
#include "cseries.h"
|
|
#include "objects/objects.h"
|
|
|
|
/* ---------- constants */
|
|
|
|
/* ---------- macros */
|
|
|
|
/* ---------- structures */
|
|
|
|
struct object_shadow
|
|
{
|
|
real object_bounding_radius;
|
|
real_rectangle3d bounds;
|
|
short count;
|
|
short unknown1;
|
|
};
|
|
|
|
/* ---------- prototypes */
|
|
|
|
/* ---------- globals */
|
|
|
|
/* ---------- public code */
|
|
|
|
static void *object_shadow_get_object(
|
|
long object_index)
|
|
{
|
|
return object_get_and_verify_type(object_index, _object_mask_all);
|
|
}
|
|
|
|
static void object_build_shadow_recursive(
|
|
long object_index,
|
|
void const *context,
|
|
struct object_shadow *shadow)
|
|
{
|
|
while (object_index != NONE)
|
|
{
|
|
struct object_datum *object = object_get(object_index);
|
|
|
|
object_shadow_get_object(object_index);
|
|
object_build_shadow_recursive(object->object.first_child_object_index, context, shadow);
|
|
object_index = object->object.next_object_index;
|
|
}
|
|
}
|
|
|
|
boolean object_build_shadow(
|
|
long object_index,
|
|
void const *context,
|
|
struct object_shadow *shadow)
|
|
{
|
|
struct object_datum *object = object_get(object_index);
|
|
struct object_definition *definition = object_definition_get(object->definition_index);
|
|
boolean result = FALSE;
|
|
|
|
shadow->object_bounding_radius = definition->object.bounding_radius;
|
|
shadow->bounds.x0 = REAL_MAX;
|
|
shadow->bounds.x1 = -REAL_MAX;
|
|
shadow->bounds.y0 = REAL_MAX;
|
|
shadow->bounds.y1 = -REAL_MAX;
|
|
shadow->bounds.z0 = REAL_MAX;
|
|
shadow->bounds.z1 = -REAL_MAX;
|
|
shadow->count = 0;
|
|
shadow->unknown1 = 0;
|
|
|
|
object_shadow_get_object(object_index);
|
|
object_build_shadow_recursive(object->object.first_child_object_index, context, shadow);
|
|
if (shadow->count > 0)
|
|
{
|
|
result = TRUE;
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
/* ---------- private code */
|