Merge bnunu/halo-1 main into testing, keeping OpenCE's code where both changed it and leaving out its matching tooling and logs

This commit is contained in:
MrBruh committed 2026-10-18 22:31:23 +13:00
commit 0110c16001
66 files changed
+257 -1522

No files matched your search

+53 -65
View File
@@ -204,7 +204,6 @@ symbols in this file:
/* ---------- headers */
#define REAL_MATH_EXTERNAL_POINT_FROM_LINE3D
#include "cseries/cseries.h"
#include "cseries/errors.h"
#define PATH_EXTERNAL_FLEE_ROUTINES
@@ -235,7 +234,6 @@ symbols in this file:
#include "objects/objects.h"
#include "physics/collision_model_definitions.h"
#undef PATH_EXTERNAL_FLEE_ROUTINES
#undef REAL_MATH_EXTERNAL_POINT_FROM_LINE3D
/* ---------- constants */
@@ -655,24 +653,10 @@ void actor_move_transform_avoidance_vector(
real_vector3d const *avoidance_vector,
real_vector3d *direction_vector)
{
real component;
*direction_vector = *global_zero_vector3d;
component = avoidance_vector->i;
direction_vector->i += component * avoidance_data->forward.i;
direction_vector->j += component * avoidance_data->forward.j;
direction_vector->k += component * avoidance_data->forward.k;
component = avoidance_vector->j;
direction_vector->i += component * avoidance_data->left.i;
direction_vector->j += component * avoidance_data->left.j;
direction_vector->k += component * avoidance_data->left.k;
component = avoidance_vector->k;
direction_vector->i += component * avoidance_data->up.i;
direction_vector->j += component * avoidance_data->up.j;
direction_vector->k += component * avoidance_data->up.k;
point_from_line3d((real_point3d *)direction_vector, &avoidance_data->forward, (avoidance_vector->i), (real_point3d *)direction_vector);
point_from_line3d((real_point3d *)direction_vector, &avoidance_data->left, (avoidance_vector->j), (real_point3d *)direction_vector);
point_from_line3d((real_point3d *)direction_vector, &avoidance_data->up, (avoidance_vector->k), (real_point3d *)direction_vector);
return;
}
@@ -832,10 +816,8 @@ static short actor_move_test_avoidance_vector(
real *collision_t,
byte *collision_timer)
{
struct collision_bsp_test_vector_result collision_result;
real_vector3d offset;
real_vector3d divergence;
real scale;
real_vector3d divergence_direction;
real_vector3d origin_offset;
short result = _actor_vector_avoidance_clear;
short object_index;
@@ -854,46 +836,51 @@ static short actor_move_test_avoidance_vector(
*collision_t = REAL_MAX;
actor_move_transform_avoidance_vector(avoidance_data, &avoidance_ray->offset, &offset);
actor_move_transform_avoidance_vector(avoidance_data, &avoidance_ray->divergence, &divergence);
origin_offset = *global_zero_vector3d;
point_from_line3d((real_point3d *)&origin_offset, &avoidance_data->forward, (avoidance_ray->offset.i), (real_point3d *)&origin_offset);
point_from_line3d((real_point3d *)&origin_offset, &avoidance_data->left, (avoidance_ray->offset.j), (real_point3d *)&origin_offset);
point_from_line3d((real_point3d *)&origin_offset, &avoidance_data->up, (avoidance_ray->offset.k), (real_point3d *)&origin_offset);
divergence_direction = *global_zero_vector3d;
point_from_line3d((real_point3d *)&divergence_direction, &avoidance_data->forward, (avoidance_ray->divergence.i), (real_point3d *)&divergence_direction);
point_from_line3d((real_point3d *)&divergence_direction, &avoidance_data->left, (avoidance_ray->divergence.j), (real_point3d *)&divergence_direction);
point_from_line3d((real_point3d *)&divergence_direction, &avoidance_data->up, (avoidance_ray->divergence.k), (real_point3d *)&divergence_direction);
ray_origin->x = offset.i*avoidance_data->avoid_width + avoidance_data->origin.x;
ray_origin->y = offset.j*avoidance_data->avoid_width + avoidance_data->origin.y;
ray_origin->z = offset.k*avoidance_data->avoid_width + avoidance_data->origin.z;
point_from_line3d(&avoidance_data->origin, &origin_offset, (avoidance_data->avoid_width), ray_origin);
scale_vector3d(&divergence_direction, avoidance_ray->length*avoidance_data->avoid_distance, ray_direction);
scale = avoidance_data->avoid_distance*avoidance_ray->length;
ray_direction->i = divergence.i*scale;
ray_direction->j = divergence.j*scale;
ray_direction->k = divergence.k*scale;
vector_from_points3d(&avoidance_data->origin, ray_origin, &offset);
if (collision_bsp_test_vector(
FLAG(_collision_test_front_facing_surfaces_bit) |
FLAG(_collision_test_back_facing_surfaces_bit),
avoidance_data->bsp,
0,
NULL,
&avoidance_data->origin,
&offset,
1.f,
&collision_result))
{
result = _actor_vector_avoidance_obstructed_structure;
*collision_t = 0.f;
}
else if (collision_bsp_test_vector(
FLAG(_collision_test_front_facing_surfaces_bit) |
FLAG(_collision_test_back_facing_surfaces_bit),
avoidance_data->bsp,
0,
NULL,
ray_origin,
ray_direction,
1.f,
&collision_result))
{
result = _actor_vector_avoidance_obstructed_structure;
*collision_t = collision_result.t;
real_vector3d vector_to_origin;
struct collision_bsp_test_vector_result collision_result;
vector_from_points3d(&avoidance_data->origin, ray_origin, &vector_to_origin);
if (collision_bsp_test_vector(
FLAG(_collision_test_front_facing_surfaces_bit) |
FLAG(_collision_test_back_facing_surfaces_bit),
avoidance_data->bsp,
0,
NULL,
&avoidance_data->origin,
&vector_to_origin,
1.f,
&collision_result))
{
result = _actor_vector_avoidance_obstructed_structure;
*collision_t = 0.f;
}
else if (collision_bsp_test_vector(
FLAG(_collision_test_front_facing_surfaces_bit) |
FLAG(_collision_test_back_facing_surfaces_bit),
avoidance_data->bsp,
0,
NULL,
ray_origin,
ray_direction,
1.f,
&collision_result))
{
result = _actor_vector_avoidance_obstructed_structure;
*collision_t = collision_result.t;
}
}
for (object_index = 0;
@@ -902,7 +889,8 @@ static short actor_move_test_avoidance_vector(
{
struct vehicle_avoidance_cylinder *cylinder =
&avoidance_data->avoidance_objects[object_index];
real object_t;
real_vector3d dummy_normal;
real intersect_t;
if (pill_test_vector3d(
&cylinder->base,
@@ -910,12 +898,12 @@ static short actor_move_test_avoidance_vector(
cylinder->width,
ray_origin,
ray_direction,
&object_t,
&offset) &&
object_t < *collision_t)
&intersect_t,
&dummy_normal) &&
intersect_t < *collision_t)
{
result = _actor_vector_avoidance_obstructed_object;
*collision_t = object_t;
*collision_t = intersect_t;
}
}
-23
View File
@@ -1,23 +0,0 @@
/*
ACTOR_TYPE_DEFINITIONS.H
file has inline function assertions.
*/
#ifndef __ACTOR_TYPE_DEFINITIONS_H
#define __ACTOR_TYPE_DEFINITIONS_H
#pragma once
/* ---------- constants */
/* ---------- macros */
/* ---------- structures */
/* ---------- prototypes/EXAMPLE.C */
/* ---------- globals */
/* ---------- public code */
#endif // __ACTOR_TYPE_DEFINITIONS_H
-23
View File
@@ -1,23 +0,0 @@
/*
AI_CONSTANTS.H
header included in hcex build.
*/
#ifndef __AI_CONSTANTS_H
#define __AI_CONSTANTS_H
#pragma once
/* ---------- constants */
/* ---------- macros */
/* ---------- structures */
/* ---------- prototypes/EXAMPLE.C */
/* ---------- globals */
/* ---------- public code */
#endif // __AI_CONSTANTS_H
-23
View File
@@ -1,23 +0,0 @@
/*
BITMAP_MACROS.H
header included in hcex build.
*/
#ifndef __BITMAP_MACROS_H
#define __BITMAP_MACROS_H
#pragma once
/* ---------- constants */
/* ---------- macros */
/* ---------- structures */
/* ---------- prototypes/EXAMPLE.C */
/* ---------- globals */
/* ---------- public code */
#endif // __BITMAP_MACROS_H
+20 -3
View File
@@ -655,7 +655,19 @@ void DecodeBlockRGB__single_pixel(
if (pblockSrc == NULL)
{
memset(colorDst, 0, sizeof(*colorDst));
/* BUG (original, preserved for exact matching): January clears S3TC_BLOCK_PIXELS colors here,
* 0x40 bytes (0x45fc30 +0x11 push 0x40, +0x15 call _csmemset), as the full-block decoder
* DecodeBlockRGB does, but colorDst addresses ONE color. In bitmap_2d_get_pixel, the only caller
* chain, that color is the four-byte local pixel, so the clear would overwrite 60 further bytes of
* that function's frame.
* The clear is not executed in January: bitmap_2d_get_pixel decodes only when
* bitmap->base_address is not NULL and halts (display_assert, then an unconditional system_exit)
* unless block_address >= bitmap->base_address; it passes block_address here for dxt1, and
* DecodeBlockAlpha4__single_pixel and DecodeBlockAlpha3__single_pixel pass &source->rgb
* (block_address + 8) for dxt3 and dxt5. No other function references this one.
* January's bytes give the length (0x40) only; its spelling here is inferred from DecodeBlockRGB,
* not recovered source. A corrected build clears sizeof(*colorDst). */
memset(colorDst, 0, S3TC_BLOCK_PIXELS * sizeof(struct s3tc_color));
return;
}
@@ -692,8 +704,13 @@ void DecodeBlockRGB__single_pixel(
colors[3].rgba[S3TC_ALPHA] = 0;
}
match_assert("c:\\halo\\SOURCE\\bitmaps\\s3tc\\s3tc.c", 773, u >= 0 && u < 4);
match_assert("c:\\halo\\SOURCE\\bitmaps\\s3tc\\s3tc.c", 774, v >= 0 && v < 4);
/* BUG (original, preserved for exact matching): both assertions admit 4 (0x45fc30 +0x17c cmp si,4 /
* +0x180 jle; +0x1aa cmp bx,4 / +0x1ae jle; the assertion strings are January's "u>=0 && u<=4" and
* "v>=0 && v<=4"), although a block has four columns and four rows, 0..3. With u or v equal to 4 the
* selector shift below can reach 32 or more. bitmap_2d_get_pixel masks both coordinates with 3 before
* every call, so neither value exceeds 3 in January. A corrected build asserts u<4 and v<4. */
match_assert("c:\\halo\\SOURCE\\bitmaps\\s3tc\\s3tc.c", 773, u>=0 && u<=4);
match_assert("c:\\halo\\SOURCE\\bitmaps\\s3tc\\s3tc.c", 774, v>=0 && v<=4);
*colorDst = colors[(pblockSrc->bitmap >> (2 * (4 * v + u))) & 3];
-23
View File
@@ -1,23 +0,0 @@
/*
MEMORY_MANAGER.H
header included in hcex build.
*/
#ifndef __MEMORY_MANAGER_H
#define __MEMORY_MANAGER_H
#pragma once
/* ---------- constants */
/* ---------- macros */
/* ---------- structures */
/* ---------- prototypes/EXAMPLE.C */
/* ---------- globals */
/* ---------- public code */
#endif // __MEMORY_MANAGER_H
+1 -1
View File
@@ -70,7 +70,7 @@ struct transport_address
/* ---------- prototypes */
short transport_initialize(
long transport_initialize(
void);
short transport_dispose(
void);
@@ -249,25 +249,27 @@ void transport_pop_key(
return;
}
short transport_initialize(
long transport_initialize(
void)
{
long result = _transport_error_none;
if (!transport_initialized)
{
WSADATA info = { 0 };
XNetStartupParams startup_params = { 0 };
DWORD link_status;
DWORD address_status;
unsigned long deadline;
FILE *bypass_file;
short wsa_error;
startup_params.cfgSizeOfStruct = sizeof(startup_params);
startup_params.cfgFlags = 0;
startup_params.cfgPrivatePoolSizeInPages = 24;
startup_params.cfgEnetReceiveQueueLength = 8;
startup_params.cfgIpFragMaxSimultaneous = 4;
startup_params.cfgIpFragMaxPacketDiv256 = 8;
startup_params.cfgSockMaxSockets = 128;
startup_params.cfgSockDefaultRecvBufsizeInK = 0;
startup_params.cfgSockDefaultSendBufsizeInK = 0;
startup_params.cfgKeyRegMax = 1;
startup_params.cfgSecRegMax = 32;
@@ -281,6 +283,9 @@ short transport_initialize(
(link_status & XNET_ETHERNET_LINK_FULL_DUPLEX) ? " in full-duplex mode" : "",
(link_status & XNET_ETHERNET_LINK_HALF_DUPLEX) ? " in half-duplex mode" : "");
/* January stores these two fields a second time here. */
startup_params.cfgSizeOfStruct = sizeof(startup_params);
startup_params.cfgFlags = 0;
bypass_file = fopen("d:\\bypass_security.txt", "r");
if (bypass_file)
{
@@ -290,35 +295,53 @@ short transport_initialize(
}
if (XNetStartup(&startup_params) != 0)
return _transport_error_not_initialized;
wsa_error = WSAStartup(MAKEWORD(2, 0), &info);
if (wsa_error != 0)
{
XNetCleanup();
winsock_error_to_string(wsa_error);
return _transport_error_not_initialized;
result = _transport_error_not_initialized;
}
deadline = system_milliseconds() + 10000;
do
else
{
address_status = XNetGetTitleXnAddr(&global_address);
if (system_milliseconds() > deadline ||
address_status == XNET_GET_XNADDR_NONE)
short wsa_error = WSAStartup(MAKEWORD(2, 0), &info);
if (wsa_error != 0)
{
WSACleanup();
XNetCleanup();
winsock_error_to_string(wsa_error);
return _transport_error_not_initialized;
}
}
while (address_status == XNET_GET_XNADDR_PENDING);
else
{
unsigned long deadline = system_milliseconds() + 10000;
DWORD address_status;
XNetRandom(global_nonce, sizeof(global_nonce));
transport_initialized = TRUE;
do
{
address_status = XNetGetTitleXnAddr(&global_address);
if (system_milliseconds() > deadline)
{
address_status = XNET_GET_XNADDR_NONE;
break;
}
}
while (address_status == XNET_GET_XNADDR_PENDING);
if (address_status == XNET_GET_XNADDR_NONE)
{
WSACleanup();
XNetCleanup();
result = _transport_error_not_initialized;
}
else
{
XNetRandom(global_nonce, sizeof(global_nonce));
result = _transport_error_none;
transport_initialized = TRUE;
}
}
}
}
return _transport_error_none;
return result;
}
void transport_client_stop(
@@ -468,18 +491,25 @@ static int __cdecl poll_ep_array_compare_proc(
void const *a,
void const *b)
{
struct transport_endpoint *endpoint_a = *(struct transport_endpoint *const *)a;
struct transport_endpoint *endpoint_b = *(struct transport_endpoint *const *)b;
int result;
if (!endpoint_a && endpoint_b)
a = *(struct transport_endpoint const *const *)a;
b = *(struct transport_endpoint const *const *)b;
if (!a && b)
{
return 1;
result = 1;
}
else if (endpoint_a && !endpoint_b)
else if (a && !b)
{
return -1;
result = -1;
}
return 0;
else
{
result = 0;
}
return result;
}
/* ---------- public code */
-23
View File
@@ -1,23 +0,0 @@
/*
CAMERA_TRACK_DEFINITIONS.H
header included in hcex build.
*/
#ifndef __CAMERA_TRACK_DEFINITIONS_H
#define __CAMERA_TRACK_DEFINITIONS_H
#pragma once
/* ---------- constants */
/* ---------- macros */
/* ---------- structures */
/* ---------- prototypes/EXAMPLE.C */
/* ---------- globals */
/* ---------- public code */
#endif // __CAMERA_TRACK_DEFINITIONS_H
-23
View File
@@ -1,23 +0,0 @@
/*
BUILD_NUMBER.H
header included in hcex build.
*/
#ifndef __BUILD_NUMBER_H
#define __BUILD_NUMBER_H
#pragma once
/* ---------- constants */
/* ---------- macros */
/* ---------- structures */
/* ---------- prototypes/EXAMPLE.C */
/* ---------- globals */
/* ---------- public code */
#endif // __BUILD_NUMBER_H
-23
View File
@@ -1,23 +0,0 @@
/*
HEADERS.H
header included in hcex build.
*/
#ifndef __HEADERS_H
#define __HEADERS_H
#pragma once
/* ---------- constants */
/* ---------- macros */
/* ---------- structures */
/* ---------- prototypes/EXAMPLE.C */
/* ---------- globals */
/* ---------- public code */
#endif // __HEADERS_H
-23
View File
@@ -1,23 +0,0 @@
/*
PLATFORM.H
header included in hcex build.
*/
#ifndef __PLATFORM_H
#define __PLATFORM_H
#pragma once
/* ---------- constants */
/* ---------- macros */
/* ---------- structures */
/* ---------- prototypes/EXAMPLE.C */
/* ---------- globals */
/* ---------- public code */
#endif // __PLATFORM_H
+6 -9
View File
@@ -431,7 +431,6 @@ void cinematic_render(
if (!ui_widgets_active())
{
real_argb_color text_color;
long shadow_alpha;
pixel32_to_real_argb_color(
title->foreground_color,
@@ -454,15 +453,13 @@ void cinematic_render(
title->text_flags,
&text_color);
shadow_alpha = PIN(
fast_ftol(
(real)(long)(byte)(title->shadow_color >> 24) *
fade_amount),
0,
255);
rasterizer_text_set_shadow_color(
((pixel32)shadow_alpha << 24) |
((pixel32)PIN(
fast_ftol(
(real)(long)(byte)(title->shadow_color >> 24) *
fade_amount),
0,
255) << 24) |
(title->shadow_color & 0x00FFFFFF));
{
-23
View File
@@ -1,23 +0,0 @@
/*
DIALOGS.H
header included in hcex build.
*/
#ifndef __DIALOGS_H
#define __DIALOGS_H
#pragma once
/* ---------- constants */
/* ---------- macros */
/* ---------- structures */
/* ---------- prototypes/EXAMPLE.C */
/* ---------- globals */
/* ---------- public code */
#endif // __DIALOGS_H
-23
View File
@@ -1,23 +0,0 @@
/*
PARTICLE_DEFINITIONS.H
header included in hcex build.
*/
#ifndef __PARTICLE_DEFINITIONS_H
#define __PARTICLE_DEFINITIONS_H
#pragma once
/* ---------- constants */
/* ---------- macros */
/* ---------- structures */
/* ---------- prototypes/EXAMPLE.C */
/* ---------- globals */
/* ---------- public code */
#endif // __PARTICLE_DEFINITIONS_H
+1 -1
View File
@@ -413,7 +413,7 @@ symbols in this file:
#include "ai/ai_script.h"
#include "hs/hs.h"
#include "hs/hs_library_internal.h"
#include "hs/hs_library_internal_compile.h"
/* Empty reconstructed header removed; no declarations to include. */
#include "hs/hs_scenario_definitions.h"
#include "interface/hud_definitions.h"
#include "interface/interface.h"
-23
View File
@@ -1,23 +0,0 @@
/*
HS_ENUM.H
header included in hcex build.
*/
#ifndef __HS_ENUM_H
#define __HS_ENUM_H
#pragma once
/* ---------- constants */
/* ---------- macros */
/* ---------- structures */
/* ---------- prototypes/EXAMPLE.C */
/* ---------- globals */
/* ---------- public code */
#endif // __HS_ENUM_H
-23
View File
@@ -1,23 +0,0 @@
/*
HS_FUNCTION.H
header included in hcex build.
*/
#ifndef __HS_FUNCTION_H
#define __HS_FUNCTION_H
#pragma once
/* ---------- constants */
/* ---------- macros */
/* ---------- structures */
/* ---------- prototypes/EXAMPLE.C */
/* ---------- globals */
/* ---------- public code */
#endif // __HS_FUNCTION_H
-23
View File
@@ -1,23 +0,0 @@
/*
HS_GLUE.H
header included in hcex build.
*/
#ifndef __HS_GLUE_H
#define __HS_GLUE_H
#pragma once
/* ---------- constants */
/* ---------- macros */
/* ---------- structures */
/* ---------- prototypes/EXAMPLE.C */
/* ---------- globals */
/* ---------- public code */
#endif // __HS_GLUE_H
-23
View File
@@ -1,23 +0,0 @@
/*
HS_LIBRARY_INTERNAL_COMPILE.H
file has inline function assertions.
*/
#ifndef __HS_LIBRARY_INTERNAL_COMPILE_H
#define __HS_LIBRARY_INTERNAL_COMPILE_H
#pragma once
/* ---------- constants */
/* ---------- macros */
/* ---------- structures */
/* ---------- prototypes/HS_COMPILE.C */
/* ---------- globals */
/* ---------- public code */
#endif // __HS_LIBRARY_INTERNAL_COMPILE_H
-23
View File
@@ -1,23 +0,0 @@
/*
HS_LIBRARY_INTERNAL_RUNTIME.H
file has inline function assertions.
*/
#ifndef __HS_LIBRARY_INTERNAL_RUNTIME_H
#define __HS_LIBRARY_INTERNAL_RUNTIME_H
#pragma once
/* ---------- constants */
/* ---------- macros */
/* ---------- structures */
/* ---------- prototypes/HS_RUNTIME.C */
/* ---------- globals */
/* ---------- public code */
#endif // __HS_LIBRARY_INTERNAL_RUNTIME_H
+1 -1
View File
@@ -266,7 +266,7 @@ symbols in this file:
#include "ai/ai_script.h"
#include "hs/hs.h"
#include "hs/hs_library_internal.h"
#include "hs/hs_library_internal_runtime.h"
/* Empty reconstructed header removed; no declarations to include. */
#include "hs/object_lists.h"
#include "hs/hs_scenario_definitions.h"
#include "math/real_math.h"
-23
View File
@@ -1,23 +0,0 @@
/*
INPUT_DEVICE_DEFAULTS.H
header included in hcex build.
*/
#ifndef __INPUT_DEVICE_DEFAULTS_H
#define __INPUT_DEVICE_DEFAULTS_H
#pragma once
/* ---------- constants */
/* ---------- macros */
/* ---------- structures */
/* ---------- prototypes/EXAMPLE.C */
/* ---------- globals */
/* ---------- public code */
#endif // __INPUT_DEVICE_DEFAULTS_H
-23
View File
@@ -1,23 +0,0 @@
/*
INPUT_WINDOWS.H
header included in hcex build.
*/
#ifndef __INPUT_WINDOWS_H
#define __INPUT_WINDOWS_H
#pragma once
/* ---------- constants */
/* ---------- macros */
/* ---------- structures */
/* ---------- prototypes/EXAMPLE.C */
/* ---------- globals */
/* ---------- public code */
#endif // __INPUT_WINDOWS_H
@@ -1,23 +0,0 @@
/*
HUD_MESSAGING_DEFINITIONS.H
header included in hcex build.
*/
#ifndef __HUD_MESSAGING_DEFINITIONS_H
#define __HUD_MESSAGING_DEFINITIONS_H
#pragma once
/* ---------- constants */
/* ---------- macros */
/* ---------- structures */
/* ---------- prototypes/EXAMPLE.C */
/* ---------- globals */
/* ---------- public code */
#endif // __HUD_MESSAGING_DEFINITIONS_H
+65 -155
View File
@@ -677,109 +677,67 @@ short hud_get_nav_point_render_type(
void custom_render_nav_point(
short local_player_index,
real_point3d const *position,
real_point3d const *position_pointer,
short nav_index,
short waypoint_type)
{
long return_eip = get_return_eip();
long stack_buffer[STACK_BUFFER_LENGTH];
struct hud_waypoint_arrow *arrow;
real_point3d view_point;
real_point3d position;
real distance;
real arrow_scale;
real scale;
real_point2d screen_position;
real horizontal_radius;
real vertical_radius;
real vertical_component;
real horizontal_component;
real radius_product;
real a, b, ab, bx, ay;
real theta;
csmemset(stack_buffer, 0x62, sizeof(stack_buffer));
arrow = TAG_BLOCK_GET_ELEMENT(
&hud_globals->waypoint.arrows,
nav_index,
struct hud_waypoint_arrow);
view_point = *position;
memset(stack_buffer, 0x62, sizeof(stack_buffer));
arrow = TAG_BLOCK_GET_ELEMENT(&hud_globals->waypoint.arrows, nav_index, struct hud_waypoint_arrow);
position = *position_pointer;
{
long unit_index = local_player_get_player_index(local_player_index)==NONE ?
NONE :
player_get(local_player_get_player_index(local_player_index))->unit_index;
real_point3d cam_pos;
real delta_x;
real delta_y;
real delta_z;
unit_get_camera_position(unit_index, &cam_pos);
delta_x = position->x-cam_pos.x;
delta_y = position->y-cam_pos.y;
delta_z = position->z-cam_pos.z;
distance = square_root(
delta_x*delta_x + (delta_y*delta_y + delta_z*delta_z));
unit_get_camera_position(local_player_get_player_index(local_player_index) == NONE ? NONE : player_get(local_player_get_player_index(local_player_index))->unit_index, &cam_pos);
distance = distance3d(&cam_pos, position_pointer);
}
if (distance>15.0f)
if (distance > 15.f)
{
arrow_scale = 0.5f;
scale = 0.5f;
}
else
{
arrow_scale = (real)pow(
1.0f-distance*(1.0f/15.0f),
0.7) + 0.5f;
scale = (real)pow(1.f - distance / 15.f, 0.7) + 0.5f;
}
matrix4x3_transform_point(
&render.frustum.world_to_view,
&view_point,
&view_point);
if (waypoint_type==_waypoint_off_screen ||
!render_camera_view_to_screen(
&render.camera,
&render.frustum,
&view_point,
&screen_position))
matrix4x3_transform_point(&render.frustum.world_to_view, &position, &position);
if (waypoint_type == _waypoint_off_screen || !render_camera_view_to_screen(&render.camera, &render.frustum, &position, &screen_position))
{
screen_position.x = view_point.x;
screen_position.y = -view_point.y;
screen_position.x = position.x;
screen_position.y = -position.y;
waypoint_type = _waypoint_off_screen;
}
else
{
screen_position.x -= (real)(
((render.camera.viewport_bounds.x1-render.camera.viewport_bounds.x0)/2) +
render.camera.viewport_bounds.x0);
screen_position.y -= (real)(
((render.camera.viewport_bounds.y1-render.camera.viewport_bounds.y0)/2) +
render.camera.viewport_bounds.y0);
screen_position.x -= render.camera.viewport_bounds.x0 + (render.camera.viewport_bounds.x1 - render.camera.viewport_bounds.x0) / 2;
screen_position.y -= render.camera.viewport_bounds.y0 + (render.camera.viewport_bounds.y1 - render.camera.viewport_bounds.y0) / 2;
}
horizontal_radius =
((real)(render.camera.window_bounds.x1-render.camera.window_bounds.x0) -
(hud_globals->waypoint.right_offset+hud_globals->waypoint.left_offset))*0.5f;
vertical_radius =
((real)(render.camera.window_bounds.y1-render.camera.window_bounds.y0) -
(hud_globals->waypoint.bottom_offset+hud_globals->waypoint.top_offset))*0.5f;
radius_product = vertical_radius*horizontal_radius;
vertical_component = vertical_radius*screen_position.x;
horizontal_component = horizontal_radius*screen_position.y;
theta = 0.0f;
a = ((render.camera.window_bounds.x1 - render.camera.window_bounds.x0) - (hud_globals->waypoint.right_offset + hud_globals->waypoint.left_offset)) / 2.f;
b = ((render.camera.window_bounds.y1 - render.camera.window_bounds.y0) - (hud_globals->waypoint.bottom_offset + hud_globals->waypoint.top_offset)) / 2.f;
ab = a * b;
bx = b * screen_position.x;
ay = a * screen_position.y;
theta = 0.f;
if (waypoint_type==_waypoint_off_screen ||
radius_product*radius_product <=
vertical_component*vertical_component + horizontal_component*horizontal_component)
if (waypoint_type == _waypoint_off_screen || ab * ab <= bx * bx + ay * ay)
{
real scale = square_root(
(radius_product*radius_product) /
(vertical_component*vertical_component + horizontal_component*horizontal_component));
real factor = square_root(ab * ab / (bx * bx + ay * ay));
screen_position.x *= factor;
screen_position.y *= factor;
waypoint_type = _waypoint_off_screen;
screen_position.x *= scale;
screen_position.y *= scale;
if (!TEST_FLAG(arrow->flags, _hud_waypoint_dont_rotate_offscreen_bit))
{
@@ -787,112 +745,64 @@ void custom_render_nav_point(
}
}
screen_position.x += (real)(
(render.camera.viewport_bounds.x1-render.camera.viewport_bounds.x0)/2);
screen_position.y += (real)(
(render.camera.viewport_bounds.y1-render.camera.viewport_bounds.y0)/2);
match_assert(
"c:\\halo\\SOURCE\\interface\\hud_nav_points.c",
615,
waypoint_type!=NONE);
screen_position.x += (render.camera.viewport_bounds.x1 - render.camera.viewport_bounds.x0) / 2;
screen_position.y += (render.camera.viewport_bounds.y1 - render.camera.viewport_bounds.y0) / 2;
match_assert("c:\\halo\\SOURCE\\interface\\hud_nav_points.c", 615, waypoint_type!=NONE);
{
long bitmap_group_index = hud_globals->waypoint.arrow_bitmap.index;
long bitmap_index = hud_globals->waypoint.arrow_bitmap.index;
struct bitmap_data const *bitmap = NULL;
real_rectangle2d const *clip = NULL;
hud_retrieve_bitmap_and_bounding_rect(
bitmap_group_index,
arrow->sequence_indices[waypoint_type],
0,
&bitmap,
&clip);
if (bitmap && _texture_cache_bitmap_get_hardware_format(
(struct bitmap_data *)bitmap, FALSE, TRUE))
hud_retrieve_bitmap_and_bounding_rect(bitmap_index, arrow->sequence_indices[waypoint_type], 0, &bitmap, &clip);
if (bitmap && _texture_cache_bitmap_get_hardware_format((struct bitmap_data *)bitmap, FALSE, TRUE))
{
point2d point;
real_rgb_color rgb_temp;
point2d corner;
byte alpha;
real fade;
real_rgb_color rgb_temp;
point.x = (short)(long)screen_position.x;
point.y = (short)(long)screen_position.y;
alpha = (byte)PIN(fast_ftol_C(arrow->opacity)*255, 0, 255);
corner.x = (short)screen_position.x;
corner.y = (short)screen_position.y;
alpha = PIN(255 * fast_ftol_C(arrow->opacity), 0, 255);
pixel32_to_real_rgb_color(arrow->color, &rgb_temp);
fade = 1.0f-arrow->fade;
rgb_temp.red *= PIN(fade, 0.0f, 1.0f);
rgb_temp.green *= PIN(fade, 0.0f, 1.0f);
rgb_temp.blue *= PIN(fade, 0.0f, 1.0f);
rgb_temp.red *= PIN(1.f - arrow->fade, 0.f, 1.f);
rgb_temp.green *= PIN(1.f - arrow->fade, 0.f, 1.f);
rgb_temp.blue *= PIN(1.f - arrow->fade, 0.f, 1.f);
hud_draw_bitmap_direct(bitmap, _hud_anchor_center, &corner, clip, scale, theta, ((pixel32)alpha << 24) | real_rgb_color_to_pixel32(&rgb_temp), FALSE);
hud_draw_bitmap_direct(
bitmap,
_hud_anchor_center,
&point,
clip,
arrow_scale,
theta,
((pixel32)alpha<<24) | real_rgb_color_to_pixel32(&rgb_temp),
FALSE);
if (waypoint_type!=_waypoint_off_screen)
if (waypoint_type != _waypoint_off_screen)
{
struct number_hud_element_definition numbers;
struct hud_absolute_placement_definition placement;
real decimal_modulus;
real bitmap_extent;
distance *= 3.0480001f;
csmemset(&placement, 0, sizeof(placement));
csmemset(&numbers, 0, sizeof(numbers));
struct number_hud_element_definition numbers;
real fractional_value;
distance *= 3.048f;
memset(&placement, 0, sizeof(struct hud_absolute_placement_definition));
memset(&numbers, 0, sizeof(struct number_hud_element_definition));
placement.corner = _hud_anchor_top_left;
numbers.colors.color =
((pixel32)alpha<<24) | real_rgb_color_to_pixel32(&rgb_temp);
numbers.colors.flash_color =
((pixel32)alpha<<24) | real_rgb_color_to_pixel32(&rgb_temp);
numbers.colors.color = ((pixel32)alpha << 24) | real_rgb_color_to_pixel32(&rgb_temp);
numbers.colors.flash_color = ((pixel32)alpha << 24) | real_rgb_color_to_pixel32(&rgb_temp);
numbers.digits = 3;
numbers.fractional_digits = 1;
numbers.number_flags =
FLAG(_hud_number_show_all_leading_zeros_bit) |
FLAG(_hud_number_show_trailing_m_bit);
numbers.number_flags = FLAG(_hud_number_show_all_leading_zeros_bit) | FLAG(_hud_number_show_trailing_m_bit);
bitmap_extent =
((clip->x1-clip->x0)*(real)bitmap->width)*0.5f;
numbers.placement.offset.x = (short)(long)(
bitmap_extent*arrow_scale*0.33000001f + (real)point.x);
bitmap_extent =
((clip->y1-clip->y0)*(real)bitmap->height)*0.5f;
numbers.placement.offset.y = (short)(long)(
bitmap_extent*arrow_scale*0.66000003f + (real)point.y);
numbers.placement.offset.x -= render.camera.window_bounds.x0;
numbers.placement.offset.x += render.camera.viewport_bounds.x0;
numbers.placement.offset.y -= render.camera.window_bounds.y0;
numbers.placement.offset.y += render.camera.viewport_bounds.y0;
numbers.placement.offset.x = corner.x + (bitmap->width * (clip->x1 - clip->x0) / 2.f) * scale * 0.33f;
numbers.placement.offset.y = corner.y + (bitmap->height * (clip->y1 - clip->y0) / 2.f) * scale * 0.66f;
numbers.placement.offset.x -= render.camera.window_bounds.x0 - render.camera.viewport_bounds.x0;
numbers.placement.offset.y -= render.camera.window_bounds.y0 - render.camera.viewport_bounds.y0;
decimal_modulus = (real)pow(10.0, 4.0);
{
short decimal_value = (short)fast_ftol(
(real)fmod(
fabs(decimal_modulus*distance),
decimal_modulus));
hud_draw_numbers(
local_player_index,
&placement,
&numbers,
(short)fast_ftol_C(distance),
decimal_value,
0,
0,
0.0f);
}
fractional_value = power(10.f, 4.f);
hud_draw_numbers(local_player_index, &placement, &numbers,
fast_ftol_C(distance), fast_ftol(fmod(fabs((real)(fractional_value * distance)), fractional_value)),
0, 0, 0.f);
}
}
}
match_assert_stack_frame("c:\\halo\\SOURCE\\interface\\hud_nav_points.c", 675);
{
short corrupt_index = check_stack_buffer(stack_buffer);
match_vassert("c:\\halo\\SOURCE\\interface\\hud_nav_points.c", 675, return_eip == get_return_eip(), "corrupt return address!");
match_vassert("c:\\halo\\SOURCE\\interface\\hud_nav_points.c", 675, corrupt_index == NONE, csprintf(temporary, "corrupt stack at %d!", corrupt_index));
}
return;
}
-23
View File
@@ -1,23 +0,0 @@
/*
INTERFACE_PANELS.H
header included in hcex build.
*/
#ifndef __INTERFACE_PANELS_H
#define __INTERFACE_PANELS_H
#pragma once
/* ---------- constants */
/* ---------- macros */
/* ---------- structures */
/* ---------- prototypes/EXAMPLE.C */
/* ---------- globals */
/* ---------- public code */
#endif // __INTERFACE_PANELS_H
-23
View File
@@ -1,23 +0,0 @@
/*
INVENTORY_DISPLAYS.H
header included in hcex build.
*/
#ifndef __INVENTORY_DISPLAYS_H
#define __INVENTORY_DISPLAYS_H
#pragma once
/* ---------- constants */
/* ---------- macros */
/* ---------- structures */
/* ---------- prototypes/EXAMPLE.C */
/* ---------- globals */
/* ---------- public code */
#endif // __INVENTORY_DISPLAYS_H
-23
View File
@@ -1,23 +0,0 @@
/*
METER_DEFINITIONS.H
header included in hcex build.
*/
#ifndef __METER_DEFINITIONS_H
#define __METER_DEFINITIONS_H
#pragma once
/* ---------- constants */
/* ---------- macros */
/* ---------- structures */
/* ---------- prototypes/EXAMPLE.C */
/* ---------- globals */
/* ---------- public code */
#endif // __METER_DEFINITIONS_H
-23
View File
@@ -1,23 +0,0 @@
/*
UI_WIDGET_GROUP.H
header included in hcex build.
*/
#ifndef __UI_WIDGET_GROUP_H
#define __UI_WIDGET_GROUP_H
#pragma once
/* ---------- constants */
/* ---------- macros */
/* ---------- structures */
/* ---------- prototypes/EXAMPLE.C */
/* ---------- globals */
/* ---------- public code */
#endif // __UI_WIDGET_GROUP_H
-23
View File
@@ -1,23 +0,0 @@
/*
GARBAGE_DEFINITIONS.H
header included in hcex build.
*/
#ifndef __GARBAGE_DEFINITIONS_H
#define __GARBAGE_DEFINITIONS_H
#pragma once
/* ---------- constants */
/* ---------- macros */
/* ---------- structures */
/* ---------- prototypes/EXAMPLE.C */
/* ---------- globals */
/* ---------- public code */
#endif // __GARBAGE_DEFINITIONS_H
+4 -5
View File
@@ -461,7 +461,6 @@ void item_accelerate(
{
real acceleration_magnitude = magnitude3d(acceleration);
real_vector3d rotation_axis;
double rotation_magnitude;
if (acceleration_magnitude < 0.0001f)
{
@@ -477,10 +476,10 @@ void item_accelerate(
&rotation_axis);
}
rotation_magnitude =
real_seed_random(get_global_random_seed_address()) *
acceleration_magnitude * 1.5707964f;
scale_vector3d(&rotation_axis, (real)rotation_magnitude, &rotation_axis);
scale_vector3d(
&rotation_axis,
real_seed_random(get_global_random_seed_address()) * 1.5707964f * acceleration_magnitude,
&rotation_axis);
add_vectors3d(
&item->object.angular_velocity,
&rotation_axis,
@@ -1,23 +0,0 @@
/*
WEAPON_INTERFACE_DEFINITIONS.H
header included in hcex build.
*/
#ifndef __WEAPON_INTERFACE_DEFINITIONS_H
#define __WEAPON_INTERFACE_DEFINITIONS_H
#pragma once
/* ---------- constants */
/* ---------- macros */
/* ---------- structures */
/* ---------- prototypes/EXAMPLE.C */
/* ---------- globals */
/* ---------- public code */
#endif // __WEAPON_INTERFACE_DEFINITIONS_H
+1 -1
View File
@@ -1556,7 +1556,7 @@ __inline real plane3d_distance_to_point(
real_plane3d const *plane,
real_point3d const *point)
{
return (dot_product3d((real_vector3d *)point, &plane->n) - plane->d);
return dot_product3d((real_vector3d *)point, &plane->n) - plane->d;
}
#endif
-23
View File
@@ -1,23 +0,0 @@
/*
VECTOR_TREE.H
header included in hcex build.
*/
#ifndef __VECTOR_TREE_H
#define __VECTOR_TREE_H
#pragma once
/* ---------- constants */
/* ---------- macros */
/* ---------- structures */
/* ---------- prototypes/EXAMPLE.C */
/* ---------- globals */
/* ---------- public code */
#endif // __VECTOR_TREE_H
-23
View File
@@ -1,23 +0,0 @@
/*
SL_LIST.H
header included in hcex build.
*/
#ifndef __SL_LIST_H
#define __SL_LIST_H
#pragma once
/* ---------- constants */
/* ---------- macros */
/* ---------- structures */
/* ---------- prototypes/EXAMPLE.C */
/* ---------- globals */
/* ---------- public code */
#endif // __SL_LIST_H
-23
View File
@@ -1,23 +0,0 @@
/*
INDEX_RESOLUTION.H
header included in hcex build.
*/
#ifndef __INDEX_RESOLUTION_H
#define __INDEX_RESOLUTION_H
#pragma once
/* ---------- constants */
/* ---------- macros */
/* ---------- structures */
/* ---------- prototypes/EXAMPLE.C */
/* ---------- globals */
/* ---------- public code */
#endif // __INDEX_RESOLUTION_H
-23
View File
@@ -1,23 +0,0 @@
/*
ALEPH.H
header included in hcex build.
*/
#ifndef __ALEPH_H
#define __ALEPH_H
#pragma once
/* ---------- constants */
/* ---------- macros */
/* ---------- structures */
/* ---------- prototypes/EXAMPLE.C */
/* ---------- globals */
/* ---------- public code */
#endif // __ALEPH_H
@@ -1,23 +0,0 @@
/*
ANTENNA_DEFINITIONS.H
header included in hcex build.
*/
#ifndef __ANTENNA_DEFINITIONS_H
#define __ANTENNA_DEFINITIONS_H
#pragma once
/* ---------- constants */
/* ---------- macros */
/* ---------- structures */
/* ---------- prototypes/EXAMPLE.C */
/* ---------- globals */
/* ---------- public code */
#endif // __ANTENNA_DEFINITIONS_H
@@ -1,23 +0,0 @@
/*
CELLULAR_AUTOMATA.H
header included in hcex build.
*/
#ifndef __CELLULAR_AUTOMATA_H
#define __CELLULAR_AUTOMATA_H
#pragma once
/* ---------- constants */
/* ---------- macros */
/* ---------- structures */
/* ---------- prototypes/EXAMPLE.C */
/* ---------- globals */
/* ---------- public code */
#endif // __CELLULAR_AUTOMATA_H
@@ -1,23 +0,0 @@
/*
CELLULAR_AUTOMATA2D.H
header included in hcex build.
*/
#ifndef __CELLULAR_AUTOMATA2D_H
#define __CELLULAR_AUTOMATA2D_H
#pragma once
/* ---------- constants */
/* ---------- macros */
/* ---------- structures */
/* ---------- prototypes/EXAMPLE.C */
/* ---------- globals */
/* ---------- public code */
#endif // __CELLULAR_AUTOMATA2D_H
-23
View File
@@ -1,23 +0,0 @@
/*
FLAG_DEFINITIONS.H
header included in hcex build.
*/
#ifndef __FLAG_DEFINITIONS_H
#define __FLAG_DEFINITIONS_H
#pragma once
/* ---------- constants */
/* ---------- macros */
/* ---------- structures */
/* ---------- prototypes/EXAMPLE.C */
/* ---------- globals */
/* ---------- public code */
#endif // __FLAG_DEFINITIONS_H
-23
View File
@@ -1,23 +0,0 @@
/*
GLOW_DEFINITIONS.H
header included in hcex build.
*/
#ifndef __GLOW_DEFINITIONS_H
#define __GLOW_DEFINITIONS_H
#pragma once
/* ---------- constants */
/* ---------- macros */
/* ---------- structures */
/* ---------- prototypes/EXAMPLE.C */
/* ---------- globals */
/* ---------- public code */
#endif // __GLOW_DEFINITIONS_H
@@ -1,23 +0,0 @@
/*
LIGHT_VOLUME_DEFINITIONS.H
header included in hcex build.
*/
#ifndef __LIGHT_VOLUME_DEFINITIONS_H
#define __LIGHT_VOLUME_DEFINITIONS_H
#pragma once
/* ---------- constants */
/* ---------- macros */
/* ---------- structures */
/* ---------- prototypes/EXAMPLE.C */
/* ---------- globals */
/* ---------- public code */
#endif // __LIGHT_VOLUME_DEFINITIONS_H
@@ -1,23 +0,0 @@
/*
LIGHTNING_DEFINITIONS.H
header included in hcex build.
*/
#ifndef __LIGHTNING_DEFINITIONS_H
#define __LIGHTNING_DEFINITIONS_H
#pragma once
/* ---------- constants */
/* ---------- macros */
/* ---------- structures */
/* ---------- prototypes/EXAMPLE.C */
/* ---------- globals */
/* ---------- public code */
#endif // __LIGHTNING_DEFINITIONS_H
-23
View File
@@ -1,23 +0,0 @@
/*
PHYSICS_CONSTANTS.H
header included in hcex build.
*/
#ifndef __PHYSICS_CONSTANTS_H
#define __PHYSICS_CONSTANTS_H
#pragma once
/* ---------- constants */
/* ---------- macros */
/* ---------- structures */
/* ---------- prototypes/EXAMPLE.C */
/* ---------- globals */
/* ---------- public code */
#endif // __PHYSICS_CONSTANTS_H
-23
View File
@@ -1,23 +0,0 @@
/*
TERRAIN_DEFINITIONS.H
header included in hcex build.
*/
#ifndef __TERRAIN_DEFINITIONS_H
#define __TERRAIN_DEFINITIONS_H
#pragma once
/* ---------- constants */
/* ---------- macros */
/* ---------- structures */
/* ---------- prototypes/EXAMPLE.C */
/* ---------- globals */
/* ---------- public code */
#endif // __TERRAIN_DEFINITIONS_H
@@ -1,23 +0,0 @@
/*
RASTERIZER_HARDWARE_FORMAT_UTILITIES.H
header included in hcex build.
*/
#ifndef __RASTERIZER_HARDWARE_FORMAT_UTILITIES_H
#define __RASTERIZER_HARDWARE_FORMAT_UTILITIES_H
#pragma once
/* ---------- constants */
/* ---------- macros */
/* ---------- structures */
/* ---------- prototypes/EXAMPLE.C */
/* ---------- globals */
/* ---------- public code */
#endif // __RASTERIZER_HARDWARE_FORMAT_UTILITIES_H
+1 -1
View File
@@ -8,7 +8,7 @@ RASTERIZER_MEMORY_POOL.C
#include "errors.h"
#include "real_math.h"
#include "rasterizer.h"
#include "rasterizer_memory_pool.h"
/* Empty reconstructed header removed; no declarations to include. */
/* ---------- globals */
@@ -1,11 +0,0 @@
/*
RASTERIZER_MEMORY_POOL.H
Narrow cross-translation-unit interface owned by RASTERIZER_MEMORY_POOL.C.
*/
#ifndef __RASTERIZER_MEMORY_POOL_H
#define __RASTERIZER_MEMORY_POOL_H
#pragma once
#endif /* __RASTERIZER_MEMORY_POOL_H */
@@ -155,7 +155,7 @@ symbols in this file:
#include "rasterizer/common/rasterizer_common.h"
#include "rasterizer/rasterizer_geometry.h"
#include "rasterizer/rasterizer_lights.h"
#include "rasterizer/rasterizer_memory_pool.h"
/* Empty reconstructed header removed; no declarations to include. */
#include "rasterizer/rasterizer_transparent_geometry.h"
#include "shaders/shader_definitions.h"
#include "shaders/shaders.h"
@@ -180,11 +180,6 @@ enum
MAXIMUM_ATMOSPHERE_DOMINANT_WARNINGS = 20,
};
enum
{
NUMBER_OF_PIXEL_SHADER_STAGES = 8,
};
enum
{
_fog_definition_atmosphere_dominant_bit = 1,
-23
View File
@@ -1,23 +0,0 @@
/*
SAVED_FILMS.H
header included in hcex build.
*/
#ifndef __SAVED_FILMS_H
#define __SAVED_FILMS_H
#pragma once
/* ---------- constants */
/* ---------- macros */
/* ---------- structures */
/* ---------- prototypes/EXAMPLE.C */
/* ---------- globals */
/* ---------- public code */
#endif // __SAVED_FILMS_H
-23
View File
@@ -1,23 +0,0 @@
/*
GAME_STATE_PROCS.H
header included in hcex build.
*/
#ifndef __GAME_STATE_PROCS_H
#define __GAME_STATE_PROCS_H
#pragma once
/* ---------- constants */
/* ---------- macros */
/* ---------- structures */
/* ---------- prototypes/EXAMPLE.C */
/* ---------- globals */
/* ---------- public code */
#endif // __GAME_STATE_PROCS_H
-23
View File
@@ -1,23 +0,0 @@
/*
SCENARIO_PLACEMENT.H
header included in hcex build.
*/
#ifndef __SCENARIO_PLACEMENT_H
#define __SCENARIO_PLACEMENT_H
#pragma once
/* ---------- constants */
/* ---------- macros */
/* ---------- structures */
/* ---------- prototypes/EXAMPLE.C */
/* ---------- globals */
/* ---------- public code */
#endif // __SCENARIO_PLACEMENT_H
-23
View File
@@ -1,23 +0,0 @@
/*
STRUCTURE_BSP_PROCS.H
header included in hcex build.
*/
#ifndef __STRUCTURE_BSP_PROCS_H
#define __STRUCTURE_BSP_PROCS_H
#pragma once
/* ---------- constants */
/* ---------- macros */
/* ---------- structures */
/* ---------- prototypes/EXAMPLE.C */
/* ---------- globals */
/* ---------- public code */
#endif // __STRUCTURE_BSP_PROCS_H
-23
View File
@@ -1,23 +0,0 @@
/*
SHELL_WINDOWS.H
header included in hcex build.
*/
#ifndef __SHELL_WINDOWS_H
#define __SHELL_WINDOWS_H
#pragma once
/* ---------- constants */
/* ---------- macros */
/* ---------- structures */
/* ---------- prototypes/EXAMPLE.C */
/* ---------- globals */
/* ---------- public code */
#endif // __SHELL_WINDOWS_H
-23
View File
@@ -1,23 +0,0 @@
/*
PLATFORM_SOUND.H
header included in hcex build.
*/
#ifndef __PLATFORM_SOUND_H
#define __PLATFORM_SOUND_H
#pragma once
/* ---------- constants */
/* ---------- macros */
/* ---------- structures */
/* ---------- prototypes/EXAMPLE.C */
/* ---------- globals */
/* ---------- public code */
#endif // __PLATFORM_SOUND_H
-23
View File
@@ -1,23 +0,0 @@
/*
RESOURCE.H
header included in hcex build.
*/
#ifndef __RESOURCE_H
#define __RESOURCE_H
#pragma once
/* ---------- constants */
/* ---------- macros */
/* ---------- structures */
/* ---------- prototypes/EXAMPLE.C */
/* ---------- globals */
/* ---------- public code */
#endif // __RESOURCE_H
@@ -1,23 +0,0 @@
/*
DETAIL_OBJECT_DEFINITIONS.H
header included in hcex build.
*/
#ifndef __DETAIL_OBJECT_DEFINITIONS_H
#define __DETAIL_OBJECT_DEFINITIONS_H
#pragma once
/* ---------- constants */
/* ---------- macros */
/* ---------- structures */
/* ---------- prototypes/EXAMPLE.C */
/* ---------- globals */
/* ---------- public code */
#endif // __DETAIL_OBJECT_DEFINITIONS_H
-23
View File
@@ -1,23 +0,0 @@
/*
RADIOSITY.H
header included in hcex build.
*/
#ifndef __RADIOSITY_H
#define __RADIOSITY_H
#pragma once
/* ---------- constants */
/* ---------- macros */
/* ---------- structures */
/* ---------- prototypes/EXAMPLE.C */
/* ---------- globals */
/* ---------- public code */
#endif // __RADIOSITY_H
@@ -1,23 +0,0 @@
/*
RADIOSITY_IO.H
header included in hcex build.
*/
#ifndef __RADIOSITY_IO_H
#define __RADIOSITY_IO_H
#pragma once
/* ---------- constants */
/* ---------- macros */
/* ---------- structures */
/* ---------- prototypes/EXAMPLE.C */
/* ---------- globals */
/* ---------- public code */
#endif // __RADIOSITY_IO_H
-23
View File
@@ -1,23 +0,0 @@
/*
DRAW_STRING_TYPES.H
header included in hcex build.
*/
#ifndef __DRAW_STRING_TYPES_H
#define __DRAW_STRING_TYPES_H
#pragma once
/* ---------- constants */
/* ---------- macros */
/* ---------- structures */
/* ---------- prototypes/EXAMPLE.C */
/* ---------- globals */
/* ---------- public code */
#endif // __DRAW_STRING_TYPES_H
+19 -35
View File
@@ -46,6 +46,8 @@ enum
/* ---------- macros */
#define CONNECTED_GEOMETRY_COPLANAR_EPSILON 0.01f
/* ---------- structures */
struct intermediate_geometry_triangle
@@ -446,13 +448,12 @@ long connected_geometry_add_triangle(
}
static boolean triangle_coplanar(
void *predicate_data,
void *data,
struct connected_geometry *geometry,
struct connected_geometry_triangle *triangle,
long group_index)
{
real_plane3d *plane = predicate_data;
real_point3d *point0 = dynamic_array_get_element(
real_point3d const *point0= dynamic_array_get_element(
&geometry->points,
((struct connected_geometry_edge *)dynamic_array_get_element(
&geometry->edges,
@@ -460,7 +461,7 @@ static boolean triangle_coplanar(
sizeof(struct connected_geometry_edge)))->point_indices[
(triangle->edge_designators[0] & LONG_MIN) != 0],
sizeof(real_point3d));
real_point3d *point1 = dynamic_array_get_element(
real_point3d const *point1= dynamic_array_get_element(
&geometry->points,
((struct connected_geometry_edge *)dynamic_array_get_element(
&geometry->edges,
@@ -468,48 +469,31 @@ static boolean triangle_coplanar(
sizeof(struct connected_geometry_edge)))->point_indices[
(triangle->edge_designators[1] & LONG_MIN) != 0],
sizeof(real_point3d));
real_point3d *point2 = dynamic_array_get_element(
real_point3d const *point2= dynamic_array_get_element(
&geometry->points,
((struct connected_geometry_edge *)dynamic_array_get_element(
&geometry->edges,
triangle->edge_designators[2] & LONG_MAX,
sizeof(struct connected_geometry_edge)))->point_indices[
(triangle->edge_designators[2] & LONG_MIN) != 0],
sizeof(real_point3d));
sizeof(real_point3d));
real_plane3d triangle_plane;
real point_distance;
real point_product;
real facing;
boolean coplanar;
if (fabs(
point0->y*plane->n.j +
point0->z*plane->n.k +
point0->x*plane->n.i -
plane->d) < 0.01f &&
fabs(
point1->y*plane->n.j +
point1->z*plane->n.k +
point1->x*plane->n.i -
plane->d) < 0.01f)
if (fabs(plane3d_distance_to_point((real_plane3d const *)data, point0))<CONNECTED_GEOMETRY_COPLANAR_EPSILON &&
fabs(plane3d_distance_to_point((real_plane3d const *)data, point1))<CONNECTED_GEOMETRY_COPLANAR_EPSILON &&
fabs(plane3d_distance_to_point((real_plane3d const *)data, point2))<CONNECTED_GEOMETRY_COPLANAR_EPSILON &&
plane3d_from_points(&triangle_plane, point0, point2, point1) &&
dot_product3d(&triangle_plane.n, &((real_plane3d const *)data)->n)>0.f)
{
point_distance = point2->y*plane->n.j;
point_distance += point2->z*plane->n.k;
point_product = point2->x*plane->n.i;
point_distance += point_product;
if (fabs(point_distance - plane->d) < 0.01f &&
plane3d_from_points(&triangle_plane, point0, point2, point1) != NULL)
{
facing = triangle_plane.n.i*plane->n.i;
facing += triangle_plane.n.k*plane->n.k;
facing += triangle_plane.n.j*plane->n.j;
if (facing > 0.0f)
{
return TRUE;
}
}
coplanar= TRUE;
}
else
{
coplanar= FALSE;
}
return FALSE;
return coplanar;
}
void connected_geometry_add_intermediate_triangle(
-23
View File
@@ -1,23 +0,0 @@
/*
INTERMEDIATE_GEOMETRY.H
header included in hcex build.
*/
#ifndef __INTERMEDIATE_GEOMETRY_H
#define __INTERMEDIATE_GEOMETRY_H
#pragma once
/* ---------- constants */
/* ---------- macros */
/* ---------- structures */
/* ---------- prototypes/EXAMPLE.C */
/* ---------- globals */
/* ---------- public code */
#endif // __INTERMEDIATE_GEOMETRY_H
+24 -48
View File
@@ -233,7 +233,6 @@ symbols in this file:
/* ---------- headers */
#define REAL_MATH_EXTERNAL_POINT_FROM_LINE3D
#define REAL_MATH_EXTERNAL_REAL_RANDOM_RANGE
#include "cseries.h"
#include "ai/ai_communication.h"
@@ -952,11 +951,7 @@ void biped_adjust_placement(
if (TEST_FLAG(flags, _biped_pill_centered_at_origin_bit) &&
!TEST_FLAG(flags, _biped_flying_bit))
{
real height_offset = definition->biped.collision_radius;
data->position.x += data->up.i*height_offset;
data->position.y += data->up.j*height_offset;
data->position.z += data->up.k*height_offset;
point_from_line3d(&data->position, &data->up, (definition->biped.collision_radius), &data->position);
}
return;
@@ -1025,20 +1020,8 @@ void biped_get_sight_position(
left.j = desired_facing->i;
left.k = 0.f;
{
real forward_distance = desired_gun_offset->i;
sight_position->x += desired_facing->i*forward_distance;
sight_position->y += desired_facing->j*forward_distance;
sight_position->z += desired_facing->k*forward_distance;
{
real sideways_distance = desired_gun_offset->j;
sight_position->x += left.i*sideways_distance;
sight_position->y += left.j*sideways_distance;
sight_position->z += left.k*sideways_distance;
}
}
point_from_line3d(sight_position, desired_facing, (desired_gun_offset->i), sight_position);
point_from_line3d(sight_position, &left, (desired_gun_offset->j), sight_position);
sight_position->z += desired_gun_offset->k;
}
else
@@ -1487,10 +1470,7 @@ static long biped_find_ground_surface(
global_current_collision_users[global_current_collision_user_depth++] = _collision_user_bipeds;
object_get_origin(object_index, &origin);
/* Preserve January's inline schedule without owning point_from_line3d here. */
origin.x = global_up3d->i*0.4f + origin.x;
origin.y = global_up3d->j*0.4f + origin.y;
origin.z = global_up3d->k*0.4f + origin.z;
point_from_line3d(&origin, global_up3d, 0.4f, &origin);
scale_vector3d(direction, distance, &vector);
if (collision_bsp_test_vector(
@@ -1505,15 +1485,7 @@ static long biped_find_ground_surface(
{
surface_index = result.surface_index;
if (point)
{
real_point3d const *line_point = &origin;
real_vector3d const *line_vector = &vector;
real line_t = result.t;
point->x = line_vector->i*line_t + line_point->x;
point->y = line_vector->j*line_t + line_point->y;
point->z = line_vector->k*line_t + line_point->z;
}
point_from_line3d(&origin, &vector, result.t, point);
if (normal)
*normal = result.plane->n;
}
@@ -1900,11 +1872,11 @@ static boolean biped_jump(
if (upward_velocity<jump_magnitude)
{
real velocity_delta = jump_magnitude-upward_velocity;
jump_velocity.i += biped->object.up.i*velocity_delta;
jump_velocity.j += biped->object.up.j*velocity_delta;
jump_velocity.k += biped->object.up.k*velocity_delta;
point_from_line3d(
(real_point3d *)&jump_velocity,
&biped->object.up,
jump_magnitude-upward_velocity,
(real_point3d *)&jump_velocity);
}
}
@@ -2247,6 +2219,11 @@ static void biped_update_jumping(
if (cheat.jetpack && biped->unit.player_index != NONE)
{
struct player_datum *player = player_get(biped->unit.player_index);
/* inferred, descriptive names (not recovered Bungie identifiers): no PDB records the locals of this block */
const real minimum_acceleration = 0.01f;
const real maximum_acceleration = 0.05f;
const real maximum_velocity = 1.4f;
const real damping = 0.8f;
boolean impulse = FALSE;
if (TEST_FLAG(biped->unit.control_flags, _unit_control_weapon_primary_trigger_bit) &&
@@ -2257,7 +2234,7 @@ static void biped_update_jumping(
dot_product3d(
&biped->object.translational_velocity,
&biped->unit.aiming_vector));
real acceleration_scale = PIN(forward_velocity * 0.71428573f, 0.f, 1.f);
real acceleration_scale = PIN(forward_velocity / maximum_velocity, 0.f, 1.f);
real_vector3d lateral_velocity;
point_from_line3d(
@@ -2268,25 +2245,24 @@ static void biped_update_jumping(
point_from_line3d(
(real_point3d *)&biped->object.translational_velocity,
&lateral_velocity,
0.8f - 1.f,
damping - 1.f,
(real_point3d *)&biped->object.translational_velocity);
point_from_line3d(
(real_point3d *)&biped->object.translational_velocity,
&biped->unit.aiming_vector,
acceleration_scale * 0.04f -
acceleration_scale * acceleration_scale * 0.05f + 0.01f,
acceleration_scale * (maximum_acceleration - minimum_acceleration) -
acceleration_scale * acceleration_scale * maximum_acceleration + minimum_acceleration,
(real_point3d *)&biped->object.translational_velocity);
SET_FLAG(biped->biped.flags, _biped_airborne_bit, TRUE);
impulse = TRUE;
}
if (!impulse &&
TEST_FLAG(biped->unit.control_flags, _unit_control_crouch_modifier_bit) &&
else if (TEST_FLAG(biped->unit.control_flags, _unit_control_crouch_modifier_bit) &&
TEST_FLAG(biped->biped.flags, _biped_airborne_bit))
{
real_vector3d *velocity = &biped->object.translational_velocity;
scale_vector3d(velocity, 0.8f - 1.f, velocity);
scale_vector3d(
&biped->object.translational_velocity,
damping - 1.f,
&biped->object.translational_velocity);
}
if (player->local_player_index != NONE && impulse)