DrawColumns matching

This commit is contained in:
Dethrace Labs 2025-09-10 21:38:35 +12:00 committed by Dethrace Engineering Department
parent 778e83b38f
commit 2b89d3d0bc
3 changed files with 15 additions and 11 deletions

View File

@ -189,12 +189,15 @@ endif()
# Create our main game binary.
if(MSVC_42_FOR_RECCMP)
add_executable(dethrace WIN32)
set(CMAKE_C_FLAGS_DEBUG "/Od /Oi /Zi /MLd")
set_target_properties(dethrace PROPERTIES OUTPUT_NAME "CARM95")
target_link_options(dethrace PRIVATE /INCREMENTAL:NO /subsystem:windows /ENTRY:mainCRTStartup)
set_source_files_properties(common/utility.c PROPERTIES COMPILE_FLAGS "/FAs")
# set_source_files_properties(common/brucetrk.c PROPERTIES COMPILE_FLAGS "/Oi-")
set_source_files_properties(common/brucetrk.c PROPERTIES COMPILE_FLAGS "/G5")
# set_source_files_properties(common/car.c PROPERTIES COMPILE_FLAGS "/G5")
reccmp_add_target(dethrace ID CARM95)
reccmp_configure()
else()

View File

@ -169,10 +169,11 @@ br_uintptr_t FindNonCarsCB(br_actor* pActor, tTrack_spec* pTrack_spec) {
if (pActor->identifier != NULL && pActor->identifier[0] == '&' && pActor->identifier[1] >= '0' && pActor->identifier[1] <= '9') {
i = ((pActor->identifier[5] - '0') * 100)
+ ((pActor->identifier[6] - '0') * 10)
i = (pActor->identifier[5] - '0') * 100
+ (pActor->identifier[6] - '0') * 10
+ pActor->identifier[7] - '0'
+ ((pActor->identifier[4] - '0') * 1000);
+ (pActor->identifier[4] - '0') * 1000;
if (i < 0 || pTrack_spec->ampersand_digits <= i) {
return 1;
}
@ -285,8 +286,8 @@ void ExtractColumns(tTrack_spec* pTrack_spec) {
pTrack_spec->ncolumns_z = z;
extra_room = e;
BrActorToBounds(&bounds, pTrack_spec->the_actor);
pTrack_spec->column_size_x = (float)(bounds.max.v[0] - bounds.min.v[0] + extra_room * 2.0f) / pTrack_spec->ncolumns_x;
pTrack_spec->column_size_z = (float)(bounds.max.v[2] - bounds.min.v[2] + extra_room * 2.0f) / pTrack_spec->ncolumns_z;
pTrack_spec->column_size_x = (bounds.max.v[0] - bounds.min.v[0] + extra_room * 2.0f) / pTrack_spec->ncolumns_x;
pTrack_spec->column_size_z = (bounds.max.v[2] - bounds.min.v[2] + extra_room * 2.0f) / pTrack_spec->ncolumns_z;
pTrack_spec->origin_x = bounds.min.v[0] - extra_room;
pTrack_spec->origin_z = bounds.min.v[2] - extra_room;
AllocateActorMatrix(pTrack_spec, &pTrack_spec->columns);
@ -436,7 +437,9 @@ void RenderTrack(br_actor* pWorld, tTrack_spec* pTrack_spec, br_actor* pCamera,
static br_scalar tan_fov_ish;
static br_actor* result;
if (pTrack_spec->columns != NULL) {
if (pTrack_spec->columns == NULL) {
BrZbSceneRenderAdd(pWorld);
} else {
if (pRender_blends) {
DrawColumns(1, pTrack_spec, min_x, max_x, min_z, max_z, pCamera_to_world);
} else {
@ -447,7 +450,7 @@ void RenderTrack(br_actor* pWorld, tTrack_spec* pTrack_spec, br_actor* pCamera,
min_z = column_z;
max_z = column_z;
tan_fov_ish = sin(BrAngleToRadian(camera->field_of_view / 2)) / cos(BrAngleToRadian(camera->field_of_view / 2));
edge_after.v[0] = camera->aspect * tan_fov_ish;
edge_after.v[0] = BR_MUL(camera->aspect, tan_fov_ish);
edge_after.v[1] = tan_fov_ish;
edge_after.v[2] = -1.0;
edge_before.v[0] = camera->yon_z * gYon_factor * edge_after.v[0];
@ -520,8 +523,6 @@ void RenderTrack(br_actor* pWorld, tTrack_spec* pTrack_spec, br_actor* pCamera,
}
DrawColumns(0, pTrack_spec, min_x, max_x, min_z, max_z, pCamera_to_world);
}
} else {
BrZbSceneRenderAdd(pWorld);
}
}

View File

@ -240,7 +240,7 @@ int AnyKeyDown(void) {
int the_key;
the_key = PDAnyKeyDown();
return the_key != -1 && the_key != 4 || EitherMouseButtonDown();
return (the_key != -1 && the_key != 4) || EitherMouseButtonDown();
}
// IDA: tU32* __cdecl KevKeyService()