Decompile bgTestHitInVtxBatch

This commit is contained in:
Ryan Dwyer
2022-08-07 00:21:47 +10:00
parent 03cedcf233
commit ec964133f7
10 changed files with 257 additions and 859 deletions
+237 -839
View File
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -3,7 +3,7 @@
#include "data.h"
#include "types.h"
struct coord var800a6470[16];
f32 var800a6470[16 * 3];
u32 var800a6530;
u32 var800a6534;
+1 -1
View File
@@ -1214,7 +1214,7 @@ u32 explosionTick(struct prop *prop)
}
if (g_Rooms[exp->room].gfxdata) {
if (g_Rooms[exp->room].gfxdata->unk0c && bgCalculateHitInRoom(&prop->pos, &exp->unk3d0, exp->room, &hitthing)) {
if (g_Rooms[exp->room].gfxdata->unk0c && bgTestHitInRoom(&prop->pos, &exp->unk3d0, exp->room, &hitthing)) {
xlu = hitthing.unk2c == 2;
}
+4 -4
View File
@@ -1369,15 +1369,15 @@ Gfx *lvRender(Gfx *gdl)
// Handle visual effects in cutscenes
switch (g_CutsceneAnimNum) {
case 0x1e5:
case ANIM_CUT_CAVE_INTRO_CAM:
// Horizon scanner in Air Base intro
if (g_CutsceneCurAnimFrame60 > 839 && g_CutsceneCurAnimFrame60 < 1411) {
gdl = bviewDrawHorizonScanner(gdl);
}
break;
case 0x181:
case 0x183:
case 0x188:
case ANIM_CUT_LUE_INTRO_CAM_01:
case ANIM_CUT_LUE_INTRO_CAM_02:
case ANIM_CUT_LUE_INTRO_CAM_03:
{
// Show static randomly in Infiltration intro
s32 cutscenestatic = 0;
+1 -1
View File
@@ -690,7 +690,7 @@ struct prop *shotCalculateHits(s32 handnum, bool arg1, struct coord *arg2, struc
roomsGetActive(roomsptr, 100);
for (i = 0; rooms[i] != -1; i++) {
if (bgCalculateHitInRoom(&shotdata.gunpos, &hitpos, rooms[i], &sp664)) {
if (bgTestHitInRoom(&shotdata.gunpos, &hitpos, rooms[i], &sp664)) {
sp664.unk00.x *= 1;
sp664.unk00.y *= 1;
sp664.unk00.z *= 1;
+3 -3
View File
@@ -5313,7 +5313,7 @@ bool func0f06bea0(struct model *model, struct modelnode *endnode, struct modelno
break;
}
if (s4 && func0f15ffdc(model, arg3, &sp74, arg4, s4, s6, vertices, &sp98, arg5)) {
if (s4 && bgTestHitOnChr(model, arg3, &sp74, arg4, s4, s6, vertices, &sp98, arg5)) {
ok = true;
sp88 = node;
*arg7 = sp84;
@@ -5630,7 +5630,7 @@ s32 func0f06cd00(struct defaultobj *obj, struct coord *pos, struct coord *arg2,
s0 = false;
if (roomIsLoaded(spcc[i])) {
if (bgCalculateHitInRoom(&prop->pos, &sp1c4, spcc[i], &hitthing)) {
if (bgTestHitInRoom(&prop->pos, &sp1c4, spcc[i], &hitthing)) {
hitthing.unk00.x *= scale;
hitthing.unk00.y *= scale;
hitthing.unk00.z *= scale;
@@ -30868,7 +30868,7 @@ bool func0f0849dc(struct model *model, struct modelnode *nodearg, struct coord *
spe0.z = spd4.z * 32767.0f + spec.z;
}
if (func0f15f560(&spec, &spe0, &spd4, s3, s5, vertices, hitthing)) {
if (bgTestHitOnObj(&spec, &spe0, &spd4, s3, s5, vertices, hitthing)) {
*dstmtxindex = mtxindex;
*dstnode = node;
done = true;
+1 -1
View File
@@ -277,7 +277,7 @@ bool splat0f149274(f32 arg0, struct prop *chrprop, struct shotdata *shotdata, f3
portal00018148(&stackshotdata.gunpos, &endpos, &gunrooms, &endrooms, rooms, ARRAYCOUNT(rooms) - 1);
for (i = 0; rooms[i] != -1; i++) {
if (bgCalculateHitInRoom(&stackshotdata.gunpos, &endpos, rooms[i], &hitthing)
if (bgTestHitInRoom(&stackshotdata.gunpos, &endpos, rooms[i], &hitthing)
&& ((stackshotdata.gunpos.x <= endpos.x && hitthing.unk00.x <= endpos.x && stackshotdata.gunpos.x <= hitthing.unk00.x) || (endpos.x <= stackshotdata.gunpos.x && endpos.x <= hitthing.unk00.x && hitthing.unk00.x <= stackshotdata.gunpos.x))
&& ((stackshotdata.gunpos.y <= endpos.y && hitthing.unk00.y <= endpos.y && stackshotdata.gunpos.y <= hitthing.unk00.y) || (endpos.y <= stackshotdata.gunpos.y && endpos.y <= hitthing.unk00.y && hitthing.unk00.y <= stackshotdata.gunpos.y))
&& ((stackshotdata.gunpos.z <= endpos.z && hitthing.unk00.z <= endpos.z && stackshotdata.gunpos.z <= hitthing.unk00.z) || (endpos.z <= stackshotdata.gunpos.z && endpos.z <= hitthing.unk00.z && hitthing.unk00.z <= stackshotdata.gunpos.z))) {
+1 -1
View File
@@ -220,7 +220,7 @@ extern struct var800a4ccc *var800a4ccc;
extern u8 *g_BgLightsFileData;
extern s16 *g_RoomPortals;
extern struct var800a4cf0 var800a4cf0;
extern struct coord var800a6470[16];
extern f32 var800a6470[16 * 3];
extern struct var800a6538 var800a6538[16];
extern u32 g_BgRoomTestsDisabled;
extern struct screenbox var800a65c0;
+4 -4
View File
@@ -66,11 +66,11 @@ s32 bgPopulateVtxBatchType(s32 roomnum, struct vtxbatch *batches, Gfx *gdl, s32
void bgFindRoomVtxBatches(s32 roomnum);
bool func0f15f20c(struct coord *arg0, struct coord *arg1, s32 *arg2, s32 *arg3);
bool bg0f15f2b0(struct coord *arg0, struct coord *arg1, struct coord *arg2, struct coord *arg3);
bool func0f15f560(struct coord *arg0, struct coord *arg1, struct coord *arg2, Gfx *arg3, void *arg4, struct gfxvtx *vertices, struct hitthing *hitthing);
bool func0f15ffdc(struct model *model, struct coord *arg1, struct coord *arg2, struct coord *arg3, Gfx *arg4, Gfx *arg5, struct gfxvtx *vertices, f32 *arg7, void *arg8);
bool bgCalculateHitInVtxBatch(struct coord *arg0, struct coord *arg1, struct coord *arg2, struct vtxbatch *batches, s32 roomnum, struct hitthing *hitthing);
bool bgTestHitOnObj(struct coord *arg0, struct coord *arg1, struct coord *arg2, Gfx *arg3, void *arg4, struct gfxvtx *vertices, struct hitthing *hitthing);
bool bgTestHitOnChr(struct model *model, struct coord *arg1, struct coord *arg2, struct coord *arg3, Gfx *arg4, Gfx *arg5, struct gfxvtx *vertices, f32 *arg7, struct hitthing *hitthing);
bool bgTestHitInVtxBatch(struct coord *arg0, struct coord *arg1, struct coord *arg2, struct vtxbatch *batches, s32 roomnum, struct hitthing *hitthing);
s32 bg0f1612e4(struct coord *bbmin, struct coord *bbmax, struct coord *arg2, struct coord *arg3, struct coord *arg4, struct coord *arg5);
bool bgCalculateHitInRoom(struct coord *frompos, struct coord *topos, s32 roomnum, struct hitthing *hitthing);
bool bgTestHitInRoom(struct coord *frompos, struct coord *topos, s32 roomnum, struct hitthing *hitthing);
bool roomIsLoaded(s32 room);
bool roomContainsCoord(struct coord *pos, s16 roomnum);
bool func0f161c08(struct coord *arg0, s16 roomnum);
+4 -4
View File
@@ -5982,10 +5982,10 @@ struct var8009ddec {
struct hitthing {
struct coord unk00;
struct coord unk0c;
void *unk18;
void *unk1c;
void *unk20;
Gfx *unk24;
struct gfxvtx *unk18;
struct gfxvtx *unk1c;
struct gfxvtx *unk20;
Gfx *tricmd;
s16 unk28;
s16 texturenum;
s16 unk2c;