Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Superdev #27

Open
wants to merge 14 commits into
base: master
Choose a base branch
from
30 changes: 15 additions & 15 deletions TR2_progress.txt
Original file line number Diff line number Diff line change
@@ -629,14 +629,14 @@ x function is unused / included in another function
0x0042C180: ControlHarpoonBolt
0x0042C4D0: + FireRocket
0x0042C5C0: + ControlRocket
0x0042C9D0: draw_shotgun
0x0042CB40: undraw_shotgun
0x0042C9D0: * draw_shotgun
0x0042CB40: * undraw_shotgun
0x0042CC50: + AnimateShotgun

game/lara2gun.cpp
0x0042D000: + set_pistol_arm
0x0042D050: draw_pistols
0x0042D0D0: undraw_pistols
0x0042D050: * draw_pistols
0x0042D0D0: * undraw_pistols
0x0042D300: ready_pistols
0x0042D360: draw_pistol_meshes
0x0042D3B0: undraw_pistol_mesh_left
@@ -664,7 +664,7 @@ x function is unused / included in another function
0x0042E4F0: LaraTestClimbUpPos

game/larafire.cpp
0x0042E740: * LaraGun
0x0042E740: + LaraGun
0x0042ECB0: * CheckForHoldingState
0x0042ECF0: * InitialiseNewWeapon
0x0042EE30: * LaraTargetInfo
@@ -677,17 +677,17 @@ x function is unused / included in another function
0x0042F7E0: * WeaponObject

game/laraflare.cpp
0x0042F840: DoFlareLight
0x0042F8E0: DoFlareInHand
0x0042F840: + DoFlareLight
0x0042F8E0: + DoFlareInHand
0x0042F9C0: + DrawFlareInAir
0x0042FAC0: CreateFlare
0x0042FCA0: set_flare_arm
0x0042FCF0: draw_flare
0x0042FE60: undraw_flare
0x00430090: draw_flare_meshes
0x004300B0: undraw_flare_meshes
0x004300D0: ready_flare
0x00430110: FlareControl
0x0042FAC0: + CreateFlare
0x0042FCA0: + set_flare_arm
0x0042FCF0: + draw_flare
0x0042FE60: + undraw_flare
0x00430090: + draw_flare_meshes
0x004300B0: + undraw_flare_meshes
0x004300D0: + ready_flare
0x00430110: + FlareControl

game/laramisc.cpp
0x00430380: + LaraControl
4 changes: 2 additions & 2 deletions game/lara1gun.h
Original file line number Diff line number Diff line change
@@ -41,8 +41,8 @@ void __cdecl FireHarpoon(); // 0x0042BFF0
void __cdecl FireRocket(); // 0x0042C4D0
void __cdecl ControlRocket(__int16 itemID); // 0x0042C5C0

// 0x0042C9D0: draw_shotgun
// 0x0042CB40: undraw_shotgun
#define draw_shotgun ((void(__cdecl*)(int)) 0x0042C9D0)
#define undraw_shotgun ((void(__cdecl*)(int)) 0x0042CB40)

void __cdecl AnimateShotgun(int gunType); // 0x0042CC50

5 changes: 3 additions & 2 deletions game/lara2gun.h
Original file line number Diff line number Diff line change
@@ -29,8 +29,9 @@
*/
void __cdecl set_pistol_arm(LARA_ARM *arm, int frame); // 0x0042D000

// 0x0042D050: draw_pistols
// 0x0042D0D0: undraw_pistols
#define draw_pistols ((void(__cdecl*)(int)) 0x0042D050)
#define undraw_pistols ((void(__cdecl*)(int)) 0x0042D0D0)

// 0x0042D300: ready_pistols
// 0x0042D360: draw_pistol_meshes
// 0x0042D3B0: undraw_pistol_mesh_left
205 changes: 204 additions & 1 deletion game/larafire.cpp
Original file line number Diff line number Diff line change
@@ -24,12 +24,214 @@
#include "3dsystem/3d_gen.h"
#include "game/control.h"
#include "game/effects.h"
#include "game/invfunc.h"
#include "game/items.h"
#include "game/lara1gun.h"
#include "game/lara2gun.h"
#include "game/laraflare.h"
#include "game/objects.h"
#include "game/sound.h"
#include "game/sphere.h"
#include "specific/game.h"
#include "global/vars.h"

void __cdecl LaraGun() {
DWORD *ammo;

if (Lara.left_arm.flash_gun > 0)
--Lara.left_arm.flash_gun;
if (Lara.right_arm.flash_gun > 0)
--Lara.right_arm.flash_gun;
if (LaraItem->hitPoints <= 0) {
Lara.gun_status = LGS_Armless;
} else {
if (Lara.gun_status == LGS_Armless) {
if (CHK_ANY(InputStatus, IN_DRAW)) {
Lara.request_gun_type = Lara.last_gun_type;
} else {
if (CHK_ANY(InputStatus, IN_FLARE)) {
if (Lara.gun_type == LGT_Flare) {
Lara.gun_status = LGS_Undraw;
} else {
if (Inv_RequestItem(ID_FLARES_ITEM))
Lara.request_gun_type = LGT_Flare;
}
}
}
if (Lara.request_gun_type != Lara.gun_type || CHK_ANY(InputStatus, IN_DRAW)) {
if (Lara.request_gun_type != LGT_Flare &&
(Lara.skidoo != -1 ||
(Lara.request_gun_type != LGT_Harpoon &&
Lara.water_status != LWS_AboveWater &&
(Lara.water_status != LWS_Wade ||
Lara.water_surface_dist <= -Weapons[Lara.gun_type].gunHeight))))
{
Lara.last_gun_type = Lara.request_gun_type;
if (Lara.gun_type == LGT_Flare) {
Lara.request_gun_type = LGT_Flare;
} else {
Lara.gun_type = Lara.request_gun_type;
}
} else {
if (Lara.gun_type == LGT_Flare) {
CreateFlare(FALSE);
undraw_flare_meshes();
Lara.flare_control_left = 0;
}
Lara.gun_type = Lara.request_gun_type;
InitialiseNewWeapon();
Lara.gun_status = LGS_Draw;
Lara.right_arm.frame_number = 0;
Lara.left_arm.frame_number = 0;
}
}
} else {
if (Lara.gun_status == LGS_Ready) {
if (CHK_ANY(InputStatus, IN_FLARE) && Inv_RequestItem(ID_FLARES_ITEM))
Lara.request_gun_type = LGT_Flare;
if (CHK_ANY(InputStatus, IN_DRAW) ||
Lara.request_gun_type != Lara.gun_type ||
(Lara.gun_type != LGT_Harpoon &&
Lara.water_status != LWS_AboveWater &&
(Lara.water_status != LWS_Wade ||
Lara.water_surface_dist < -Weapons[Lara.gun_type].gunHeight)))
{
Lara.gun_status = LGS_Undraw;
}
}
}
}
switch (Lara.gun_status) {
case LGS_Armless:
if (Lara.gun_type == LGT_Flare) {
if (Lara.skidoo == -1 && !CheckForHoldingState(LaraItem->currentAnimState)) {
Lara.flare_control_left = 0;
} else {
if (!Lara.flare_control_left) {
Lara.flare_control_left = 1;
Lara.left_arm.frame_number = 95;
} else {
if (Lara.left_arm.frame_number) {
++Lara.left_arm.frame_number;
if (Lara.left_arm.frame_number == 110)
Lara.left_arm.frame_number = 0;
}
}
}
DoFlareInHand(Lara.flare_age);
set_flare_arm(Lara.left_arm.frame_number);
}
break;
case LGS_HandBusy:
if (Lara.gun_type == LGT_Flare) {
Lara.flare_control_left = Lara.skidoo != -1 || CheckForHoldingState(LaraItem->currentAnimState);
DoFlareInHand(Lara.flare_age);
set_flare_arm(Lara.left_arm.frame_number);
}
break;
case LGS_Draw:
if (Lara.gun_type != LGT_Flare && Lara.gun_type != LGT_Unarmed)
Lara.last_gun_type = Lara.gun_type;
switch (Lara.gun_type) {
case LGT_Pistols:
case LGT_Magnums:
case LGT_Uzis:
if (Camera.type != CAM_Cinematic && Camera.type != CAM_Look)
Camera.type = CAM_Combat;
draw_pistols(Lara.gun_type);
break;
case LGT_Shotgun:
case LGT_M16:
case LGT_Grenade:
case LGT_Harpoon:
if (Camera.type != CAM_Cinematic && Camera.type != CAM_Look)
Camera.type = CAM_Combat;
draw_shotgun(Lara.gun_type);
break;
case LGT_Flare:
draw_flare();
break;
default:
Lara.gun_status = LGS_Armless;
break;
}
break;
case LGS_Undraw:
Lara.mesh_ptrs[14] = MeshPtr[Objects[ID_LARA].meshIndex + 14];
switch (Lara.gun_type) {
case LGT_Pistols:
case LGT_Magnums:
case LGT_Uzis:
undraw_pistols(Lara.gun_type);
break;
case LGT_Shotgun:
case LGT_M16:
case LGT_Grenade:
case LGT_Harpoon:
undraw_shotgun(Lara.gun_type);
break;
case LGT_Flare:
undraw_flare();
break;
}
break;
case LGS_Ready:
if (!Lara.pistol_ammo || !CHK_ANY(InputStatus, IN_ACTION)) {
Lara.mesh_ptrs[14] = MeshPtr[Objects[ID_LARA].meshIndex + 14];
} else {
Lara.mesh_ptrs[14] = MeshPtr[Objects[ID_LARA_UZIS].meshIndex + 14];
}
if (Camera.type != CAM_Cinematic && Camera.type != CAM_Look)
Camera.type = CAM_Combat;
switch (Lara.gun_type) {
case LGT_Magnums:
ammo = &Lara.magnum_ammo;
break;
case LGT_Uzis:
ammo = &Lara.uzi_ammo;
break;
case LGT_Shotgun:
ammo = &Lara.shotgun_ammo;
break;
case LGT_M16:
ammo = &Lara.m16_ammo;
break;
case LGT_Grenade:
ammo = &Lara.grenade_ammo;
break;
case LGT_Harpoon:
ammo = &Lara.harpoon_ammo;
break;
default:
ammo = &Lara.pistol_ammo;
break;
}
if (CHK_ANY(InputStatus, IN_ACTION) && *ammo <= 0) {
*ammo = 0;
PlaySoundEffect(48, &LaraItem->pos, 0);
Lara.request_gun_type = Inv_RequestItem(ID_PISTOL_ITEM) ? LGT_Pistols : LGT_Unarmed;
} else {
switch (Lara.gun_type) {
case LGT_Pistols:
case LGT_Magnums:
case LGT_Uzis:
PistolHandler(Lara.gun_type);
break;
case LGT_Shotgun:
case LGT_M16:
case LGT_Grenade:
case LGT_Harpoon:
RifleHandler(Lara.gun_type);
break;
}
}
break;
case LGS_Special:
draw_flare();
break;
}
}

int __cdecl FireWeapon(int weaponType, ITEM_INFO *target, ITEM_INFO *item, __int16 *angles) {
DWORD *ammo;
WEAPON_INFO *weapon;
@@ -144,7 +346,8 @@ void __cdecl SmashItem(__int16 itemID, int weaponType) {
* Inject function
*/
void Inject_LaraFire() {
// INJECT(0x0042E740, LaraGun);
INJECT(0x0042E740, LaraGun);

// INJECT(0x0042ECB0, CheckForHoldingState);
// INJECT(0x0042ECF0, InitialiseNewWeapon);
// INJECT(0x0042EE30, LaraTargetInfo);
3 changes: 2 additions & 1 deletion game/larafire.h
Original file line number Diff line number Diff line change
@@ -27,7 +27,8 @@
/*
* Function list
*/
#define LaraGun ((void(__cdecl*)(void)) 0x0042E740)
void __cdecl LaraGun(); // 0x0042E740

#define CheckForHoldingState ((int(__cdecl*)(int)) 0x0042ECB0)
#define InitialiseNewWeapon ((void(__cdecl*)(void)) 0x0042ECF0)
#define LaraTargetInfo ((void(__cdecl*)(WEAPON_INFO*)) 0x0042EE30)
363 changes: 351 additions & 12 deletions game/laraflare.cpp
Original file line number Diff line number Diff line change
@@ -22,8 +22,16 @@
#include "global/precompiled.h"
#include "game/laraflare.h"
#include "3dsystem/3d_gen.h"
#include "3dsystem/phd_math.h"
#include "3dsystem/scalespr.h"
#include "game/control.h"
#include "game/draw.h"
#include "game/effects.h"
#include "game/invfunc.h"
#include "game/items.h"
#include "game/lara.h"
#include "game/larafire.h"
#include "game/sound.h"
#include "specific/game.h"
#include "specific/output.h"
#include "global/vars.h"
@@ -32,6 +40,57 @@
extern DWORD AlphaBlendMode;
#endif // FEATURE_VIDEOFX_IMPROVED

int __cdecl DoFlareLight(PHD_VECTOR *pos, int flareAge) {
BOOL light;
int random, x;

light = TRUE;
if (flareAge < 1800) {
random = GetRandomDraw();
x = pos->x + (random & 15);
if (flareAge < 30) {
AddDynamicLight(x, pos->y, pos->z, (flareAge - 30) / 5 + 12, 11);
} else {
if (flareAge < 1740) {
AddDynamicLight(x, pos->y, pos->z, 12, 11);
} else {
if (random > 8192) {
AddDynamicLight(x, pos->y, pos->z, 12 - (random & 3), 11);
} else {
AddDynamicLight(x, pos->y, pos->z, 12, 5);
light = FALSE;
}
}
}
} else {
light = FALSE;
}
return light;
}

void __cdecl DoFlareInHand(int flareAge) {
PHD_VECTOR pos;

pos.x = 11;
pos.y = 32;
pos.z = 41;
GetLaraJointAbsPosition(&pos, 13);
Lara.left_arm.flash_gun = DoFlareLight(&pos, flareAge);
if (Lara.flare_age < 1800) {
++Lara.flare_age;
if (CHK_ANY(RoomInfo[LaraItem->roomNumber].flags, ROOM_UNDERWATER)) {
PlaySoundEffect(12, &LaraItem->pos, SFX_UNDERWATER);
if (GetRandomDraw() < 16384)
CreateBubble((PHD_3DPOS *) &pos, LaraItem->roomNumber);
} else {
PlaySoundEffect(12, &LaraItem->pos, 0);
}
} else {
if (Lara.gun_status == LGS_Armless)
Lara.gun_status = LGS_Undraw;
}
}

void __cdecl DrawFlareInAir(ITEM_INFO *item) {
int rate;
__int16 *ptr[2];
@@ -62,21 +121,301 @@ void __cdecl DrawFlareInAir(ITEM_INFO *item) {
phd_PopMatrix();
}

void __cdecl CreateFlare(BOOL isFlying) {
__int16 itemID;
ITEM_INFO *item;
PHD_VECTOR pos;

itemID = CreateItem();
if (itemID != -1) {
item = &Items[itemID];
item->objectID = ID_FLARE_ITEM;
item->roomNumber = LaraItem->roomNumber;
pos.x = -16;
pos.y = 32;
pos.z = 42;
GetLaraJointAbsPosition(&pos, 13);
if (GetHeight(GetFloor(pos.x, pos.y, pos.z, &item->roomNumber), pos.x, pos.y, pos.z) < pos.y) {
item->pos.x = LaraItem->pos.x;
item->pos.y = pos.y;
item->pos.z = LaraItem->pos.z;
item->pos.rotY = -LaraItem->pos.rotY;
item->roomNumber = LaraItem->roomNumber;
} else {
item->pos.x = pos.x;
item->pos.y = pos.y;
item->pos.z = pos.z;
item->pos.rotY = isFlying ? LaraItem->pos.rotY : LaraItem->pos.rotY - PHD_45;
}
InitialiseItem(itemID);
item->pos.rotZ = 0;
item->pos.rotX = 0;
item->shade1 = -1;
if (isFlying) {
item->speed = LaraItem->speed + 50;
item->fallSpeed = LaraItem->fallSpeed - 50;
} else {
item->speed = LaraItem->speed + 10;
item->fallSpeed = LaraItem->fallSpeed + 50;
}
if (DoFlareLight((PHD_VECTOR *) &item->pos, Lara.flare_age)) {
item->data = (LPVOID) (Lara.flare_age | 0x8000);
} else {
item->data = (LPVOID) (Lara.flare_age & 0x7FFF);
}
AddActiveItem(itemID);
item->status = ITEM_ACTIVE;
}
}

void __cdecl set_flare_arm(int frame) {
if (frame < 1) {
Lara.left_arm.anim_number = Objects[ID_LARA_FLARE].animIndex;
} else {
if (frame < 33) {
Lara.left_arm.anim_number = Objects[ID_LARA_FLARE].animIndex + 1;
} else {
if (frame < 72) {
Lara.left_arm.anim_number = Objects[ID_LARA_FLARE].animIndex + 2;
} else {
if (frame < 95) {
Lara.left_arm.anim_number = Objects[ID_LARA_FLARE].animIndex + 3;
} else {
Lara.left_arm.anim_number = Objects[ID_LARA_FLARE].animIndex + 4;
}
}
}
}
Lara.left_arm.frame_base = Anims[Lara.left_arm.anim_number].framePtr;
}

void __cdecl draw_flare() {
__int16 frame;

if (LaraItem->currentAnimState != AS_FLAREPICKUP && LaraItem->currentAnimState != AS_PICKUP) {
Lara.flare_control_left = 1;
frame = Lara.left_arm.frame_number + 1;
if (frame >= 33 && frame <= 94) {
if (frame == 46) {
draw_flare_meshes();
if (!SaveGame.bonusFlag)
Inv_RemoveItem(ID_FLARES_ITEM);
} else {
if (frame >= 72 && frame <= 93) {
if (frame == 72) {
PlaySoundEffect(11, &LaraItem->pos, CHK_ANY(RoomInfo[LaraItem->roomNumber].flags, ROOM_UNDERWATER) ? SFX_UNDERWATER : 0);
Lara.flare_age = 0;
}
DoFlareInHand(Lara.flare_age);
} else {
if (frame == 94) {
ready_flare();
DoFlareInHand(Lara.flare_age);
frame = 0;
}
}
}
} else {
frame = 33;
}
} else {
DoFlareInHand(Lara.flare_age);
Lara.flare_control_left = 0;
frame = 93;
}
Lara.left_arm.frame_number = frame;
set_flare_arm(Lara.left_arm.frame_number);
}

void __cdecl undraw_flare() {
__int16 frame;

Lara.flare_control_left = 1;
frame = Lara.left_arm.frame_number;
if (LaraItem->goalAnimState == AS_STOP && Lara.skidoo == -1) {
if (LaraItem->animNumber == 103) {
LaraItem->animNumber = 189;
Lara.flare_frame = frame + Anims[LaraItem->animNumber].frameBase;
LaraItem->frameNumber = Lara.flare_frame;
}
if (LaraItem->animNumber == 189) {
Lara.flare_control_left = 0;
if (Lara.flare_frame >= Anims[189].frameBase + 31) {
Lara.request_gun_type = Lara.last_gun_type;
Lara.gun_type = Lara.last_gun_type;
Lara.gun_status = LGS_Armless;
InitialiseNewWeapon();
Lara.target = NULL;
Lara.right_arm.lock = 0;
Lara.left_arm.lock = 0;
LaraItem->animNumber = 11;
Lara.flare_frame = Anims[LaraItem->animNumber].frameBase;
LaraItem->frameNumber = Lara.flare_frame;
LaraItem->currentAnimState = AS_STOP;
LaraItem->goalAnimState = AS_STOP;
return;
}
++Lara.flare_frame;
}
} else {
if (LaraItem->currentAnimState == AS_STOP && Lara.skidoo == -1) {
LaraItem->animNumber = 11;
LaraItem->frameNumber = Anims[LaraItem->animNumber].frameBase;
}
}
if (frame) {
if (frame >= 72 && frame < 95) {
++frame;
if (frame == 94)
frame = 1;
} else {
if (frame >= 1 && frame < 33) {
++frame;
if (frame == 21) {
CreateFlare(TRUE);
undraw_flare_meshes();
} else {
if (frame == 33) {
frame = 0;
Lara.request_gun_type = Lara.last_gun_type;
Lara.gun_type = Lara.last_gun_type;
Lara.gun_status = LGS_Armless;
InitialiseNewWeapon();
Lara.flare_control_left = 0;
Lara.target = NULL;
Lara.right_arm.lock = 0;
Lara.left_arm.lock = 0;
Lara.flare_frame = 0;
}
}
} else {
if (frame >= 95 && frame < 110) {
++frame;
if (frame == 110)
frame = 1;
}
}
}
} else {
frame = 1;
}
if (frame >= 1 && frame < 21)
DoFlareInHand(Lara.flare_age);
Lara.left_arm.frame_number = frame;
set_flare_arm(Lara.left_arm.frame_number);
}

void __cdecl draw_flare_meshes() {
Lara.mesh_ptrs[13] = MeshPtr[Objects[ID_LARA_FLARE].meshIndex + 13];
}

void __cdecl undraw_flare_meshes() {
Lara.mesh_ptrs[13] = MeshPtr[Objects[ID_LARA].meshIndex + 13];
}

void __cdecl ready_flare() {
Lara.gun_status = LGS_Armless;
Lara.left_arm.z_rot = 0;
Lara.left_arm.y_rot = 0;
Lara.left_arm.x_rot = 0;
Lara.right_arm.z_rot = 0;
Lara.right_arm.y_rot = 0;
Lara.right_arm.x_rot = 0;
Lara.right_arm.lock = 0;
Lara.left_arm.lock = 0;
Lara.target = NULL;
}

void __cdecl FlareControl(__int16 itemID) {
ITEM_INFO *item;
int x, y, z, height, ceiling, age;
__int16 roomID;
FLOOR_INFO *floor;

item = &Items[itemID];
if (item->fallSpeed) {
item->pos.rotX += 3 * PHD_DEGREE;
item->pos.rotZ += 5 * PHD_DEGREE;
} else {
item->pos.rotX = 0;
item->pos.rotZ = 0;
}
x = item->pos.x;
z = item->pos.z;
y = item->pos.y;
item->pos.z += phd_cos(item->pos.rotY) * item->speed >> W2V_SHIFT;
item->pos.x += phd_sin(item->pos.rotY) * item->speed >> W2V_SHIFT;
if (CHK_ANY(RoomInfo[item->roomNumber].flags, ROOM_UNDERWATER)) {
item->fallSpeed += (5 - item->fallSpeed) / 2;
item->speed += (5 - item->speed) / 2;
} else {
item->fallSpeed += 6;
}
item->pos.y += item->fallSpeed;
roomID = item->roomNumber;
floor = GetFloor(item->pos.x, item->pos.y, item->pos.z, &roomID);
height = GetHeight(floor, item->pos.x, item->pos.y, item->pos.z);
if (item->pos.y >= height) {
if (y > height) {
item->pos.rotY += PHD_180;
item->pos.y = y;
item->speed /= 2;
item->pos.x = x;
item->pos.z = z;
roomID = item->roomNumber;
} else {
if (item->fallSpeed > 40) {
item->fallSpeed = 40 - item->fallSpeed;
CLAMPL(item->fallSpeed, -100);
} else {
item->speed -= 3;
item->fallSpeed = 0;
CLAMPL(item->speed, 0);
}
item->pos.y = height;
}
} else {
ceiling = GetCeiling(floor, item->pos.x, item->pos.y, item->pos.z);
if (item->pos.y < ceiling) {
item->fallSpeed = -item->fallSpeed;
item->pos.y = ceiling;
}
}
if (roomID != item->roomNumber)
ItemNewRoom(itemID, roomID);
age = (int) item->data & 0x7FFF;
if (age < 1800 || item->fallSpeed || item->speed) {
if (age < 1800)
++age;
if (DoFlareLight((PHD_VECTOR *) &item->pos, age)) {
age |= 0x8000;
if (CHK_ANY(RoomInfo[item->roomNumber].flags, ROOM_UNDERWATER)) {
PlaySoundEffect(12, &item->pos, SFX_UNDERWATER);
if (GetRandomDraw() < 16384)
CreateBubble(&item->pos, item->roomNumber);
} else {
PlaySoundEffect(12, &item->pos, 0);
}
}
item->data = (LPVOID) age;
} else {
KillItem(itemID);
}
}

/*
* Inject function
*/
void Inject_LaraFlare() {
// INJECT(0x0042F840, DoFlareLight);
// INJECT(0x0042F8E0, DoFlareInHand);

INJECT(0x0042F840, DoFlareLight);
INJECT(0x0042F8E0, DoFlareInHand);
INJECT(0x0042F9C0, DrawFlareInAir);

// INJECT(0x0042FAC0, CreateFlare);
// INJECT(0x0042FCA0, set_flare_arm);
// INJECT(0x0042FCF0, draw_flare);
// INJECT(0x0042FE60, undraw_flare);
// INJECT(0x00430090, draw_flare_meshes);
// INJECT(0x004300B0, undraw_flare_meshes);
// INJECT(0x004300D0, ready_flare);
// INJECT(0x00430110, FlareControl);
INJECT(0x0042FAC0, CreateFlare);
INJECT(0x0042FCA0, set_flare_arm);
INJECT(0x0042FCF0, draw_flare);
INJECT(0x0042FE60, undraw_flare);
INJECT(0x00430090, draw_flare_meshes);
INJECT(0x004300B0, undraw_flare_meshes);
INJECT(0x004300D0, ready_flare);
INJECT(0x00430110, FlareControl);
}
22 changes: 10 additions & 12 deletions game/laraflare.h
Original file line number Diff line number Diff line change
@@ -27,18 +27,16 @@
/*
* Function list
*/
// 0x0042F840: DoFlareLight
// 0x0042F8E0: DoFlareInHand

int __cdecl DoFlareLight(PHD_VECTOR *pos, int flareAge); // 0x0042F840
void __cdecl DoFlareInHand(int flareAge); // 0x0042F8E0
void __cdecl DrawFlareInAir(ITEM_INFO *item);

// 0x0042FAC0: CreateFlare
// 0x0042FCA0: set_flare_arm
// 0x0042FCF0: draw_flare
// 0x0042FE60: undraw_flare
// 0x00430090: draw_flare_meshes
// 0x004300B0: undraw_flare_meshes
// 0x004300D0: ready_flare
// 0x00430110: FlareControl
void __cdecl CreateFlare(BOOL isFlying); // 0x0042FAC0
void __cdecl set_flare_arm(int frame); // 0x0042FCA0
void __cdecl draw_flare(); // 0x0042FCF0
void __cdecl undraw_flare(); // 0x0042FE60
void __cdecl draw_flare_meshes(); // 0x00430090
void __cdecl undraw_flare_meshes(); // 0x004300B0
void __cdecl ready_flare(); // 0x004300D0
void __cdecl FlareControl(__int16 itemID); // 0x00430110

#endif // LARA_FLARE_H_INCLUDED