mirror of
https://github.com/Cesarus85/ringfall-mjolnir-vr.git
synced 2026-10-18 13:00:25 +02:00
217 lines
4.4 KiB
C
217 lines
4.4 KiB
C
/*
|
|
MOTION_SENSOR.C
|
|
|
|
symbols in this file:
|
|
000CA160 00b0:
|
|
_code_000ca160 (0000)
|
|
000CA210 0050:
|
|
_code_000ca210 (0000)
|
|
000CA260 0160:
|
|
_code_000ca260 (0000)
|
|
000CA3C0 0060:
|
|
_code_000ca3c0 (0000)
|
|
000CA420 0010:
|
|
_code_000ca420 (0000)
|
|
000CA430 0040:
|
|
_code_000ca430 (0000)
|
|
000CA470 0050:
|
|
_motion_sensor_initialize (0000)
|
|
000CA4C0 0010:
|
|
_motion_sensor_dispose (0000)
|
|
000CA4D0 0060:
|
|
_motion_sensor_initialize_for_new_map (0000)
|
|
000CA530 0010:
|
|
_motion_sensor_dispose_from_old_map (0000)
|
|
000CA540 0020:
|
|
_code_000ca540 (0000)
|
|
000CA560 0070:
|
|
_code_000ca560 (0000)
|
|
000CA5D0 00e0:
|
|
_code_000ca5d0 (0000)
|
|
000CA6B0 0190:
|
|
_code_000ca6b0 (0000)
|
|
000CA840 0490:
|
|
_code_000ca840 (0000)
|
|
000CACD0 0360:
|
|
_code_000cacd0 (0000)
|
|
000CB030 0300:
|
|
_code_000cb030 (0000)
|
|
000CB330 0050:
|
|
_motion_sensor_draw_screen (0000)
|
|
000CB380 0070:
|
|
_motion_sensor_tick (0000)
|
|
002703E0 0054:
|
|
_blip_colors (0000)
|
|
00270434 003e:
|
|
??_C@_0DO@GOKNGPMD@fabs?$CIposition?9?$DOy?$CJ?5?$DM?5hud_globals?9@ (0000)
|
|
00270474 003e:
|
|
??_C@_0DO@HNEGEKG@fabs?$CIposition?9?$DOx?$CJ?5?$DM?5hud_globals?9@ (0000)
|
|
002704B4 0029:
|
|
??_C@_0CJ@LFAICIPE@c?3?2halo?2SOURCE?2interface?2motion_@ (0000)
|
|
002704E0 0004:
|
|
__real@3c010204 (0000)
|
|
002704E4 000b:
|
|
??_C@_0L@KEKONIMN@c_dropship?$AA@ (0000)
|
|
002704F0 0016:
|
|
??_C@_0BG@PHBPOBKD@motion_sensor_globals?$AA@ (0000)
|
|
00270508 0016:
|
|
??_C@_0BG@KNHDKBCC@motion?5sensor?5?$CIradar?$CJ?$AA@ (0000)
|
|
00270520 000c:
|
|
??_C@_0M@EFNLDGJP@sensor?5data?$AA@ (0000)
|
|
0027052C 000a:
|
|
??_C@_09KJONPCOF@reference?$AA@ (0000)
|
|
00270538 0008:
|
|
__real@3fd5555555555555 (0000)
|
|
00270540 0004:
|
|
__real@3dd6774d (0000)
|
|
00270544 0004:
|
|
__real@3c800000 (0000)
|
|
00270548 001d:
|
|
??_C@_0BN@LEDPOOMI@_blip_type_none?5?$CB?$DN?5blip_type?$AA@ (0000)
|
|
00270568 001c:
|
|
??_C@_0BM@FMFNPKOG@blip_index?$DMMAX_CUSTOM_BLIPS?$AA@ (0000)
|
|
00270588 0008:
|
|
__real@401c000000000000 (0000)
|
|
00270590 0008:
|
|
__real@400c000000000000 (0000)
|
|
00270598 0003:
|
|
??_C@_02BPBMPCEP@pt?$AA@ (0000)
|
|
0027059C 0004:
|
|
__real@40026666 (0000)
|
|
002705A0 0008:
|
|
__real@4000ccccc0000000 (0000)
|
|
002E4C6C 0018:
|
|
_scale (0000)
|
|
00453AC8 000d:
|
|
_next_vertex_index (0000)
|
|
_debug_motion_sensor_draw_all_units (000c)
|
|
*/
|
|
|
|
/* ---------- headers */
|
|
|
|
#include "cseries.h"
|
|
#include "real_math.h"
|
|
#include "motion_sensor.h"
|
|
#include "game_state.h"
|
|
|
|
/* ---------- constants */
|
|
|
|
/* ---------- macros */
|
|
|
|
/* ---------- structures */
|
|
|
|
struct motion_sensor_blip
|
|
{
|
|
byte type;
|
|
byte pad[3];
|
|
};
|
|
|
|
struct motion_sensor_blip_row
|
|
{
|
|
struct motion_sensor_blip blips[16];
|
|
byte pad[0x44];
|
|
};
|
|
|
|
struct motion_sensor_player
|
|
{
|
|
short unknown;
|
|
struct motion_sensor_blip_row rows[10];
|
|
byte pad[0x3E];
|
|
};
|
|
|
|
struct motion_sensor_globals_definition
|
|
{
|
|
struct motion_sensor_player players[4];
|
|
byte pad[8];
|
|
};
|
|
|
|
typedef char motion_sensor_blip_size_assert[
|
|
sizeof(struct motion_sensor_blip) == 4 ? 1 : -1];
|
|
typedef char motion_sensor_blip_row_size_assert[
|
|
sizeof(struct motion_sensor_blip_row) == 0x84 ? 1 : -1];
|
|
typedef char motion_sensor_player_size_assert[
|
|
sizeof(struct motion_sensor_player) == 0x568 ? 1 : -1];
|
|
typedef char motion_sensor_globals_size_assert[
|
|
sizeof(struct motion_sensor_globals_definition) == 0x15A8 ? 1 : -1];
|
|
|
|
/* ---------- prototypes */
|
|
|
|
/* ---------- globals */
|
|
|
|
const real_rgb_color blip_colors[] =
|
|
{
|
|
{ 1.f, .5f, 0.f },
|
|
{ 1.f, 1.f, 0.f },
|
|
{ 1.f, 0.f, 0.f },
|
|
{ 1.f, 1.f, 0.f },
|
|
{ 1.f, 0.f, 0.f },
|
|
{ .5f, .5f, 1.f },
|
|
{ 0.f, 0.f, 0.f }
|
|
};
|
|
|
|
real scale = 1.f;
|
|
|
|
static struct motion_sensor_globals_definition *motion_sensor_globals;
|
|
|
|
/* ---------- public code */
|
|
|
|
void motion_sensor_initialize(
|
|
void)
|
|
{
|
|
motion_sensor_globals = (struct motion_sensor_globals_definition *)game_state_malloc("motion sensor (radar)", "sensor data", 5544);
|
|
match_assert("c:\\halo\\SOURCE\\interface\\motion_sensor.c", 298, motion_sensor_globals);
|
|
|
|
return;
|
|
}
|
|
|
|
void motion_sensor_dispose(
|
|
void)
|
|
{
|
|
return;
|
|
}
|
|
|
|
void motion_sensor_dispose_from_old_map(
|
|
void)
|
|
{
|
|
return;
|
|
}
|
|
|
|
void
|
|
motion_sensor_initialize_for_new_map(
|
|
void)
|
|
{
|
|
struct motion_sensor_player *player;
|
|
long player_count;
|
|
|
|
csmemset(motion_sensor_globals, 0, sizeof(*motion_sensor_globals));
|
|
player = motion_sensor_globals->players;
|
|
player_count = NUMBEROF(motion_sensor_globals->players);
|
|
|
|
do
|
|
{
|
|
struct motion_sensor_blip_row *row = player->rows;
|
|
long row_count = NUMBEROF(player->rows);
|
|
|
|
do
|
|
{
|
|
struct motion_sensor_blip *blip = row->blips;
|
|
long blip_count = NUMBEROF(row->blips);
|
|
|
|
do
|
|
{
|
|
blip->type = 6;
|
|
blip++;
|
|
}
|
|
while (--blip_count);
|
|
|
|
row++;
|
|
}
|
|
while (--row_count);
|
|
|
|
player++;
|
|
}
|
|
while (--player_count);
|
|
|
|
return;
|
|
}
|