Skip to content

Commit

Permalink
port BaddieBiteEffect
Browse files Browse the repository at this point in the history
  • Loading branch information
rr- committed Mar 7, 2021
1 parent 6788421 commit 18ecb01
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 11 deletions.
12 changes: 6 additions & 6 deletions docs/progress.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion docs/progress.txt
Original file line number Diff line number Diff line change
Expand Up @@ -882,7 +882,7 @@ S_StartSyncedAudio 0x00439030 0x000000FC -
TestCollision 0x00439130 0x00000128 +
GetSpheres 0x00439260 0x000002EF +
GetJointAbsPosition 0x00439550 0x0000019C +
BaddieBiteEffect 0x004396F0 0x0000005D *
BaddieBiteEffect 0x004396F0 0x0000005D +

# text.cpp
T_InitPrint 0x00439750 0x00000022 +
Expand Down
13 changes: 13 additions & 0 deletions src/game/sphere.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include "3dsystem/3d_gen.h"
#include "game/draw.h"
#include "game/effects.h"
#include "game/sphere.h"
#include "game/vars.h"
#include "util.h"
Expand Down Expand Up @@ -183,9 +184,21 @@ void GetJointAbsPosition(ITEM_INFO* item, PHD_VECTOR* vec, int32_t joint)
phd_PopMatrix();
}

void BaddieBiteEffect(ITEM_INFO* item, BITE_INFO* bite)
{
PHD_VECTOR pos;
pos.x = bite->x;
pos.y = bite->y;
pos.z = bite->z;
GetJointAbsPosition(item, &pos, bite->mesh_num);
DoBloodSplat(
pos.x, pos.y, pos.z, item->speed, item->pos.y_rot, item->room_number);
}

void T1MInjectGameSphere()
{
INJECT(0x00439130, TestCollision);
INJECT(0x00439260, GetSpheres);
INJECT(0x00439550, GetJointAbsPosition);
INJECT(0x004396F0, BaddieBiteEffect);
}
5 changes: 1 addition & 4 deletions src/game/sphere.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,10 @@
#include "game/types.h"
#include <stdint.h>

// clang-format off
#define BaddieBiteEffect ((void (*)(ITEM_INFO *item, BITE_INFO *bite))0x004396F0)
// clang-format on

int32_t TestCollision(ITEM_INFO* item, ITEM_INFO* lara_item);
int32_t GetSpheres(ITEM_INFO* item, SPHERE* slist, int32_t world_space);
void GetJointAbsPosition(ITEM_INFO* item, PHD_VECTOR* vec, int32_t joint);
void BaddieBiteEffect(ITEM_INFO* item, BITE_INFO* bite);

void T1MInjectGameSphere();

Expand Down

0 comments on commit 18ecb01

Please sign in to comment.