improve naming consistency

This commit is contained in:
rr- 2021-03-05 18:56:05 +01:00
parent 899b1f91c0
commit c724d7d37e
21 changed files with 239 additions and 232 deletions

View file

@ -16,9 +16,9 @@ typedef enum {
BAT_ATTACK = 3,
BAT_FALL = 4,
BAT_DEATH = 5,
} BAT_ANIMS;
} BAT_ANIM;
BITE_INFO BatBite = { 0, 16, 45, 4 };
static BITE_INFO BatBite = { 0, 16, 45, 4 };
void BatControl(int16_t item_num)
{

View file

@ -33,9 +33,9 @@ typedef enum {
BEAR_ATTACK2 = 7,
BEAR_EAT = 8,
BEAR_DEATH = 9,
} BEAR_ANIMS;
} BEAR_ANIM;
BITE_INFO BearHeadBite = { 0, 96, 335, 14 };
static BITE_INFO BearHeadBite = { 0, 96, 335, 14 };
void BearControl(int16_t item_num)
{

View file

@ -31,16 +31,16 @@ typedef enum {
CROC_ATTACK1 = 5,
CROC_ATTACK2 = 6,
CROC_DEATH = 7,
} CROC_ANIMS;
} CROC_ANIM;
typedef enum {
GATOR_EMPTY = 0,
GATOR_SWIM = 1,
GATOR_ATTACK = 2,
GATOR_DEATH = 3,
} GATOR_ANIMS;
} GATOR_ANIM;
BITE_INFO CrocBite = { 5, -21, 467, 9 };
static BITE_INFO CrocBite = { 5, -21, 467, 9 };
void AlligatorControl(int16_t item_num)
{

View file

@ -42,7 +42,7 @@ typedef enum {
RAPTOR_WARNING = 6,
RAPTOR_ATTACK2 = 7,
RAPTOR_ATTACK3 = 8,
} RAPTOR_ANIMS;
} RAPTOR_ANIM;
typedef enum {
DINO_EMPTY = 0,
@ -54,9 +54,9 @@ typedef enum {
DINO_ROAR = 6,
DINO_ATTACK2 = 7,
DINO_KILL = 8,
} DINO_ANIMS;
} DINO_ANIM;
BITE_INFO RaptorBite = { 0, 66, 318, 22 };
static BITE_INFO RaptorBite = { 0, 66, 318, 22 };
void RaptorControl(int16_t item_num)
{

View file

@ -16,7 +16,7 @@
#define FLIPFLAG 0x40
#define UNFLIPFLAG 0x80
void (*effect_routines[])(ITEM_INFO* item) = {
void (*EffectRoutines[])(ITEM_INFO* item) = {
FxTurn180, FxDinoStomp, FxLaraNormal, FxLaraBubbles, FxFinishLevel,
FxEarthQuake, FxFlood, FxRaisingBlock, FxStairs2Slope, FxSand,
FxPowerUp, FxExplosion, FxLaraHandsFree, FxFlipMap, FxDrawRightGun,
@ -58,7 +58,7 @@ void SoundEffects()
// NOTE: why are we firing this here?
// Some of the FX routines rely on the item to be not null!
if (FlipEffect != -1) {
effect_routines[FlipEffect](NULL);
EffectRoutines[FlipEffect](NULL);
}
mn_update_sound_effects();

View file

@ -43,6 +43,8 @@ void FxLaraHandsFree(ITEM_INFO* item);
void FxFlipMap(ITEM_INFO* item);
void FxDrawRightGun(ITEM_INFO* item);
extern void (*EffectRoutines[])(ITEM_INFO* item);
void T1MInjectGameEffects();
#endif

View file

@ -15,28 +15,28 @@
#define HAIR_OFFSET_Y (20) // up-down
#define HAIR_OFFSET_Z (-45) // front-back
static int first_hair;
static PHD_3DPOS hair[HAIR_SEGMENTS + 1];
static PHD_VECTOR hvel[HAIR_SEGMENTS + 1];
static int FirstHair;
static PHD_3DPOS Hair[HAIR_SEGMENTS + 1];
static PHD_VECTOR HVel[HAIR_SEGMENTS + 1];
void InitialiseHair()
{
first_hair = 1;
FirstHair = 1;
int32_t* bone = &AnimBones[Objects[O_HAIR].bone_index];
hair[0].y_rot = 0;
hair[0].x_rot = -PHD_90;
Hair[0].y_rot = 0;
Hair[0].x_rot = -PHD_90;
for (int i = 1; i < HAIR_SEGMENTS + 1; i++, bone += 4) {
hair[i].x = *(bone + 1);
hair[i].y = *(bone + 2);
hair[i].z = *(bone + 3);
hair[i].x_rot = -PHD_90;
hair[i].y_rot = hair[i].z_rot = 0;
hvel[i].x = 0;
hvel[i].y = 0;
hvel[i].z = 0;
Hair[i].x = *(bone + 1);
Hair[i].y = *(bone + 2);
Hair[i].z = *(bone + 3);
Hair[i].x_rot = -PHD_90;
Hair[i].y_rot = Hair[i].z_rot = 0;
HVel[i].x = 0;
HVel[i].y = 0;
HVel[i].z = 0;
}
}
@ -167,31 +167,31 @@ void HairControl(int in_cutscene)
bone = &AnimBones[Objects[O_HAIR].bone_index];
if (first_hair) {
first_hair = 0;
if (FirstHair) {
FirstHair = 0;
hair[0].x = pos.x;
hair[0].y = pos.y;
hair[0].z = pos.z;
Hair[0].x = pos.x;
Hair[0].y = pos.y;
Hair[0].z = pos.z;
for (i = 0; i < HAIR_SEGMENTS; i++, bone += 4) {
phd_PushUnitMatrix();
PhdMatrixPtr->_03 = hair[i].x << W2V_SHIFT;
PhdMatrixPtr->_13 = hair[i].y << W2V_SHIFT;
PhdMatrixPtr->_23 = hair[i].z << W2V_SHIFT;
phd_RotYXZ(hair[i].y_rot, hair[i].x_rot, 0);
PhdMatrixPtr->_03 = Hair[i].x << W2V_SHIFT;
PhdMatrixPtr->_13 = Hair[i].y << W2V_SHIFT;
PhdMatrixPtr->_23 = Hair[i].z << W2V_SHIFT;
phd_RotYXZ(Hair[i].y_rot, Hair[i].x_rot, 0);
phd_TranslateRel(*(bone + 1), *(bone + 2), *(bone + 3));
hair[i + 1].x = PhdMatrixPtr->_03 >> W2V_SHIFT;
hair[i + 1].y = PhdMatrixPtr->_13 >> W2V_SHIFT;
hair[i + 1].z = PhdMatrixPtr->_23 >> W2V_SHIFT;
Hair[i + 1].x = PhdMatrixPtr->_03 >> W2V_SHIFT;
Hair[i + 1].y = PhdMatrixPtr->_13 >> W2V_SHIFT;
Hair[i + 1].z = PhdMatrixPtr->_23 >> W2V_SHIFT;
phd_PopMatrix();
}
} else {
hair[0].x = pos.x;
hair[0].y = pos.y;
hair[0].z = pos.z;
Hair[0].x = pos.x;
Hair[0].y = pos.y;
Hair[0].z = pos.z;
room_number = LaraItem->room_number;
@ -208,45 +208,45 @@ void HairControl(int in_cutscene)
}
for (i = 1; i < HAIR_SEGMENTS + 1; i++, bone += 4) {
hvel[0].x = hair[i].x;
hvel[0].y = hair[i].y;
hvel[0].z = hair[i].z;
HVel[0].x = Hair[i].x;
HVel[0].y = Hair[i].y;
HVel[0].z = Hair[i].z;
if (!in_cutscene) {
floor = GetFloor(hair[i].x, hair[i].y, hair[i].z, &room_number);
height = GetHeight(floor, hair[i].x, hair[i].y, hair[i].z);
floor = GetFloor(Hair[i].x, Hair[i].y, Hair[i].z, &room_number);
height = GetHeight(floor, Hair[i].x, Hair[i].y, Hair[i].z);
} else
height = 32767;
hair[i].x += hvel[i].x * 3 / 4;
hair[i].y += hvel[i].y * 3 / 4;
hair[i].z += hvel[i].z * 3 / 4;
Hair[i].x += HVel[i].x * 3 / 4;
Hair[i].y += HVel[i].y * 3 / 4;
Hair[i].z += HVel[i].z * 3 / 4;
switch (Lara.water_status) {
case LWS_ABOVEWATER:
hair[i].y += 10;
if (water_level != NO_HEIGHT && hair[i].y > water_level)
hair[i].y = water_level;
else if (hair[i].y > height) {
hair[i].x = hvel[0].x;
hair[i].z = hvel[0].z;
Hair[i].y += 10;
if (water_level != NO_HEIGHT && Hair[i].y > water_level)
Hair[i].y = water_level;
else if (Hair[i].y > height) {
Hair[i].x = HVel[0].x;
Hair[i].z = HVel[0].z;
}
break;
case LWS_UNDERWATER:
case LWS_SURFACE:
if (hair[i].y < water_level) {
hair[i].y = water_level;
} else if (hair[i].y > height) {
hair[i].y = height;
if (Hair[i].y < water_level) {
Hair[i].y = water_level;
} else if (Hair[i].y > height) {
Hair[i].y = height;
}
break;
}
for (j = 0; j < 5; j++) {
x = hair[i].x - sphere[j].x;
y = hair[i].y - sphere[j].y;
z = hair[i].z - sphere[j].z;
x = Hair[i].x - sphere[j].x;
y = Hair[i].y - sphere[j].y;
z = Hair[i].z - sphere[j].z;
distance = x * x + y * y + z * z;
@ -256,24 +256,24 @@ void HairControl(int in_cutscene)
if (distance == 0)
distance = 1;
hair[i].x = sphere[j].x + x * sphere[j].r / distance;
hair[i].y = sphere[j].y + y * sphere[j].r / distance;
hair[i].z = sphere[j].z + z * sphere[j].r / distance;
Hair[i].x = sphere[j].x + x * sphere[j].r / distance;
Hair[i].y = sphere[j].y + y * sphere[j].r / distance;
Hair[i].z = sphere[j].z + z * sphere[j].r / distance;
}
}
distance = phd_sqrt(
SQUARE(hair[i].z - hair[i - 1].z)
+ SQUARE(hair[i].x - hair[i - 1].x));
hair[i - 1].y_rot =
phd_atan(hair[i].z - hair[i - 1].z, hair[i].x - hair[i - 1].x);
hair[i - 1].x_rot = -phd_atan(distance, hair[i].y - hair[i - 1].y);
SQUARE(Hair[i].z - Hair[i - 1].z)
+ SQUARE(Hair[i].x - Hair[i - 1].x));
Hair[i - 1].y_rot =
phd_atan(Hair[i].z - Hair[i - 1].z, Hair[i].x - Hair[i - 1].x);
Hair[i - 1].x_rot = -phd_atan(distance, Hair[i].y - Hair[i - 1].y);
phd_PushUnitMatrix();
PhdMatrixPtr->_03 = hair[i - 1].x << W2V_SHIFT;
PhdMatrixPtr->_13 = hair[i - 1].y << W2V_SHIFT;
PhdMatrixPtr->_23 = hair[i - 1].z << W2V_SHIFT;
phd_RotYXZ(hair[i - 1].y_rot, hair[i - 1].x_rot, 0);
PhdMatrixPtr->_03 = Hair[i - 1].x << W2V_SHIFT;
PhdMatrixPtr->_13 = Hair[i - 1].y << W2V_SHIFT;
PhdMatrixPtr->_23 = Hair[i - 1].z << W2V_SHIFT;
phd_RotYXZ(Hair[i - 1].y_rot, Hair[i - 1].x_rot, 0);
if (i == HAIR_SEGMENTS) {
phd_TranslateRel(*(bone - 3), *(bone - 2), *(bone - 1));
@ -281,13 +281,13 @@ void HairControl(int in_cutscene)
phd_TranslateRel(*(bone + 1), *(bone + 2), *(bone + 3));
}
hair[i].x = PhdMatrixPtr->_03 >> W2V_SHIFT;
hair[i].y = PhdMatrixPtr->_13 >> W2V_SHIFT;
hair[i].z = PhdMatrixPtr->_23 >> W2V_SHIFT;
Hair[i].x = PhdMatrixPtr->_03 >> W2V_SHIFT;
Hair[i].y = PhdMatrixPtr->_13 >> W2V_SHIFT;
Hair[i].z = PhdMatrixPtr->_23 >> W2V_SHIFT;
hvel[i].x = hair[i].x - hvel[0].x;
hvel[i].y = hair[i].y - hvel[0].y;
hvel[i].z = hair[i].z - hvel[0].z;
HVel[i].x = Hair[i].x - HVel[0].x;
HVel[i].y = Hair[i].y - HVel[0].y;
HVel[i].z = Hair[i].z - HVel[0].z;
phd_PopMatrix();
}
@ -306,9 +306,9 @@ void DrawHair()
for (int i = 0; i < HAIR_SEGMENTS; i++) {
phd_PushMatrix();
phd_TranslateAbs(hair[i].x, hair[i].y, hair[i].z);
phd_RotY(hair[i].y_rot);
phd_RotX(hair[i].x_rot);
phd_TranslateAbs(Hair[i].x, Hair[i].y, Hair[i].z);
phd_RotY(Hair[i].y_rot);
phd_RotX(Hair[i].x_rot);
phd_PutPolygons(*mesh++, 1);
phd_PopMatrix();

View file

@ -24,7 +24,7 @@ typedef enum {
PBACK = 16,
PINBACK = 32,
PPAGE1 = 64
} PASS_PAGES;
} PASS_PAGE;
static int OldInputDB = 0;
@ -36,7 +36,7 @@ int32_t Display_Inventory(int inv_mode)
memset(&imo, 0, sizeof(IMOTION_INFO));
memset(&ring, 0, sizeof(RING_INFO));
if (inv_mode == RM_KEYS && !InvKeysObjects) {
if (inv_mode == RT_KEYS && !InvKeysObjects) {
InventoryChosen = -1;
return 0;
}
@ -75,29 +75,29 @@ int32_t Display_Inventory(int inv_mode)
case INV_LOAD_MODE:
case INV_TITLE_MODE:
Inv_RingInit(
&ring, RM_OPTION, InvOptionList, InvOptionObjects, InvOptionCurrent,
&ring, RT_OPTION, InvOptionList, InvOptionObjects, InvOptionCurrent,
&imo);
break;
case INV_KEYS_MODE:
Inv_RingInit(
&ring, RM_KEYS, InvKeysList, InvKeysObjects, InvMainCurrent, &imo);
&ring, RT_KEYS, InvKeysList, InvKeysObjects, InvMainCurrent, &imo);
break;
default:
if (InvMainObjects) {
Inv_RingInit(
&ring, RM_MAIN, InvMainList, InvMainObjects, InvMainCurrent,
&ring, RT_MAIN, InvMainList, InvMainObjects, InvMainCurrent,
&imo);
} else {
Inv_RingInit(
&ring, RM_OPTION, InvOptionList, InvOptionObjects,
&ring, RT_OPTION, InvOptionList, InvOptionObjects,
InvOptionCurrent, &imo);
}
break;
}
SoundEffect(111, 0, RM_KEYS);
SoundEffect(111, 0, RT_KEYS);
InvNFrames = 2;
@ -269,7 +269,7 @@ int32_t Display_Inventory(int inv_mode)
SoundEffect(112, 0, SFX_ALWAYS);
InventoryChosen = -1;
if (ring.type == RM_MAIN) {
if (ring.type == RT_MAIN) {
InvMainCurrent = ring.current_object;
} else {
InvOptionCurrent = ring.current_object;
@ -301,10 +301,10 @@ int32_t Display_Inventory(int inv_mode)
Item_Data = 0;
INVENTORY_ITEM* inv_item;
if (ring.type == RM_MAIN) {
if (ring.type == RT_MAIN) {
InvMainCurrent = ring.current_object;
inv_item = InvMainList[ring.current_object];
} else if (ring.type == RM_OPTION) {
} else if (ring.type == RT_OPTION) {
InvOptionCurrent = ring.current_object;
inv_item = InvOptionList[ring.current_object];
} else {
@ -351,7 +351,7 @@ int32_t Display_Inventory(int inv_mode)
if (CHK_ANY(InputDB, IN_FORWARD) && InventoryMode != INV_TITLE_MODE
&& InventoryMode != INV_KEYS_MODE) {
if (ring.type == RM_MAIN) {
if (ring.type == RT_MAIN) {
if (InvKeysObjects) {
Inv_RingMotionSetup(
&ring, RNG_CLOSING, RNG_MAIN2KEYS,
@ -365,7 +365,7 @@ int32_t Display_Inventory(int inv_mode)
}
Input = 0;
InputDB = 0;
} else if (ring.type == RM_OPTION) {
} else if (ring.type == RT_OPTION) {
if (InvMainObjects) {
Inv_RingMotionSetup(
&ring, RNG_CLOSING, RNG_OPTION2MAIN,
@ -382,7 +382,7 @@ int32_t Display_Inventory(int inv_mode)
} else if (
CHK_ANY(InputDB, IN_BACK) && InventoryMode != INV_TITLE_MODE
&& InventoryMode != INV_KEYS_MODE) {
if (ring.type == RM_KEYS) {
if (ring.type == RT_KEYS) {
if (InvMainObjects) {
Inv_RingMotionSetup(
&ring, RNG_CLOSING, RNG_KEYS2MAIN,
@ -396,7 +396,7 @@ int32_t Display_Inventory(int inv_mode)
}
Input = 0;
InputDB = 0;
} else if (ring.type == RM_MAIN) {
} else if (ring.type == RT_MAIN) {
if (InvOptionObjects) {
Inv_RingMotionSetup(
&ring, RNG_CLOSING, RNG_MAIN2OPTION,
@ -422,7 +422,7 @@ int32_t Display_Inventory(int inv_mode)
imo.camera_pitch_target = 0;
InvMainCurrent = ring.current_object;
ring.list = InvOptionList;
ring.type = RM_OPTION;
ring.type = RT_OPTION;
ring.number_of_objects = InvOptionObjects;
ring.current_object = InvOptionCurrent;
Inv_RingCalcAdders(&ring, ROTATE_DURATION);
@ -442,7 +442,7 @@ int32_t Display_Inventory(int inv_mode)
InvMainCurrent = ring.current_object;
InvMainObjects = ring.number_of_objects;
ring.list = InvKeysList;
ring.type = RM_KEYS;
ring.type = RT_KEYS;
ring.number_of_objects = InvKeysObjects;
ring.current_object = InvKeysCurrent;
Inv_RingCalcAdders(&ring, ROTATE_DURATION);
@ -461,7 +461,7 @@ int32_t Display_Inventory(int inv_mode)
imo.camera_pitch_target = 0;
InvKeysCurrent = ring.current_object;
ring.list = InvMainList;
ring.type = RM_MAIN;
ring.type = RT_MAIN;
ring.number_of_objects = InvMainObjects;
ring.current_object = InvMainCurrent;
Inv_RingCalcAdders(&ring, ROTATE_DURATION);
@ -481,7 +481,7 @@ int32_t Display_Inventory(int inv_mode)
InvOptionObjects = ring.number_of_objects;
InvOptionCurrent = ring.current_object;
ring.list = InvMainList;
ring.type = RM_MAIN;
ring.type = RT_MAIN;
ring.number_of_objects = InvMainObjects;
ring.current_object = InvMainCurrent;
Inv_RingCalcAdders(&ring, ROTATE_DURATION);
@ -527,7 +527,7 @@ int32_t Display_Inventory(int inv_mode)
if (CHK_ANY(InputDB, IN_SELECT)) {
inv_item->sprlist = NULL;
InventoryChosen = inv_item->object_number;
if (ring.type == RM_MAIN) {
if (ring.type == RT_MAIN) {
InvMainCurrent = ring.current_object;
} else {
InvOptionCurrent = ring.current_object;

View file

@ -30,11 +30,11 @@ void RingIsOpen(RING_INFO* ring)
if (!InvRingText) {
switch (ring->type) {
case RM_MAIN:
case RT_MAIN:
InvRingText = T_Print(0, 26, 0, "INVENTORY");
break;
case RM_OPTION:
case RT_OPTION:
if (InventoryMode == INV_DEATH_MODE) {
InvRingText = T_Print(0, 26, 0, "GAME OVER");
} else {
@ -42,7 +42,7 @@ void RingIsOpen(RING_INFO* ring)
}
break;
case RM_KEYS:
case RT_KEYS:
InvRingText = T_Print(0, 26, 0, "ITEMS");
break;
}
@ -55,8 +55,8 @@ void RingIsOpen(RING_INFO* ring)
}
if (!InvUpArrow1) {
if (ring->type == RM_OPTION
|| (ring->type == RM_MAIN && InvKeysObjects)) {
if (ring->type == RT_OPTION
|| (ring->type == RT_MAIN && InvKeysObjects)) {
InvUpArrow1 = T_Print(20, 28, 0, "[");
InvUpArrow2 = T_Print(-20, 28, 0, "[");
T_RightAlign(InvUpArrow2, 1);
@ -64,7 +64,7 @@ void RingIsOpen(RING_INFO* ring)
}
if (!InvDownArrow1) {
if (ring->type == RM_MAIN || ring->type == RM_KEYS) {
if (ring->type == RT_MAIN || ring->type == RT_KEYS) {
InvDownArrow1 = T_Print(20, -15, 0, "]");
InvDownArrow2 = T_Print(-20, -15, 0, "]");
T_BottomAlign(InvDownArrow1, 1);

View file

@ -167,21 +167,21 @@ int32_t FireWeapon(
int32_t weapon_type, ITEM_INFO* target, ITEM_INFO* src, PHD_ANGLE* angles);
void HitTarget(ITEM_INFO* item, GAME_VECTOR* hitpos, int32_t damage);
void draw_shotgun();
void undraw_shotgun();
void draw_shotgun_meshes();
void undraw_shotgun_meshes();
void ready_shotgun();
void DrawShotgun();
void UndrawShotgun();
void DrawShotgunMeshes();
void UndrawShotgunMeshes();
void ReadyShotgun();
void RifleHandler(int32_t weapon_type);
void AnimateShotgun();
void FireShotgun();
void draw_pistols(int32_t weapon_type);
void undraw_pistols(int32_t weapon_type);
void ready_pistols();
void draw_pistol_meshes(int32_t weapon_type);
void undraw_pistol_mesh_left(int32_t weapon_type);
void undraw_pistol_mesh_right(int32_t weapon_type);
void DrawPistols(int32_t weapon_type);
void UndrawPistols(int32_t weapon_type);
void ReadyPistols();
void DrawPistolMeshes(int32_t weapon_type);
void UndrawPistolMeshLeft(int32_t weapon_type);
void UndrawPistolMeshRight(int32_t weapon_type);
void PistolHandler(int32_t weapon_type);
void AnimatePistols(int32_t weapon_type);

View file

@ -5,7 +5,8 @@
#include "specific/input.h"
#include "config.h"
void draw_shotgun()
// original name: draw_shotgun
void DrawShotgun()
{
int16_t ani = Lara.left_arm.frame_number;
ani++;
@ -13,17 +14,18 @@ void draw_shotgun()
if (ani < AF_SG_DRAW || ani > AF_SG_RECOIL) {
ani = AF_SG_DRAW;
} else if (ani == AF_SG_DRAW + 10) {
draw_shotgun_meshes();
DrawShotgunMeshes();
SoundEffect(6, &LaraItem->pos, 0);
} else if (ani == AF_SG_RECOIL) {
ready_shotgun();
ReadyShotgun();
ani = AF_SG_AIM;
}
Lara.left_arm.frame_number = ani;
Lara.right_arm.frame_number = ani;
}
void undraw_shotgun()
// origianl name: undraw_shotgun
void UndrawShotgun()
{
int16_t ani = ani = Lara.left_arm.frame_number;
@ -51,7 +53,7 @@ void undraw_shotgun()
} else if (ani >= AF_SG_UNDRAW && ani < AF_SG_UNAIM) {
ani++;
if (ani == AF_SG_UNDRAW + 20) {
undraw_shotgun_meshes();
UndrawShotgunMeshes();
SoundEffect(6, &LaraItem->pos, 0);
} else if (ani == AF_SG_UNAIM) {
ani = AF_SG_AIM;
@ -70,7 +72,8 @@ void undraw_shotgun()
Lara.left_arm.frame_number = ani;
}
void draw_shotgun_meshes()
// original name: draw_shotgun_meshes
void DrawShotgunMeshes()
{
Lara.mesh_ptrs[LM_HAND_L] =
Meshes[Objects[O_SHOTGUN].mesh_index + LM_HAND_L];
@ -79,14 +82,16 @@ void draw_shotgun_meshes()
Lara.mesh_ptrs[LM_TORSO] = Meshes[Objects[O_LARA].mesh_index + LM_TORSO];
}
void undraw_shotgun_meshes()
// original name: undraw_shotgun_meshes
void UndrawShotgunMeshes()
{
Lara.mesh_ptrs[LM_HAND_L] = Meshes[Objects[O_LARA].mesh_index + LM_HAND_L];
Lara.mesh_ptrs[LM_HAND_R] = Meshes[Objects[O_LARA].mesh_index + LM_HAND_R];
Lara.mesh_ptrs[LM_TORSO] = Meshes[Objects[O_SHOTGUN].mesh_index + LM_TORSO];
}
void ready_shotgun()
// original name: ReadyShotgun
void ReadyShotgun()
{
Lara.gun_status = LGS_READY;
Lara.left_arm.x_rot = 0;
@ -230,7 +235,7 @@ void FireShotgun()
void T1MInjectGameLaraGun1()
{
INJECT(0x00425E30, draw_shotgun);
INJECT(0x00425F50, undraw_shotgun);
INJECT(0x00425E30, DrawShotgun);
INJECT(0x00425F50, UndrawShotgun);
INJECT(0x004260F0, RifleHandler);
}

View file

@ -3,7 +3,8 @@
#include "game/vars.h"
#include "util.h"
void draw_pistols(int32_t weapon_type)
// original name: draw_pistols
void DrawPistols(int32_t weapon_type)
{
int16_t ani = Lara.left_arm.frame_number;
ani++;
@ -11,10 +12,10 @@ void draw_pistols(int32_t weapon_type)
if (ani < AF_G_DRAW1 || ani > AF_G_DRAW2_L) {
ani = AF_G_DRAW1;
} else if (ani == AF_G_DRAW2) {
draw_pistol_meshes(weapon_type);
DrawPistolMeshes(weapon_type);
SoundEffect(6, &LaraItem->pos, 0);
} else if (ani == AF_G_DRAW2_L) {
ready_pistols();
ReadyPistols();
ani = AF_G_AIM;
}
@ -22,7 +23,8 @@ void draw_pistols(int32_t weapon_type)
Lara.right_arm.frame_number = ani;
}
void undraw_pistols(int32_t weapon_type)
// original name: undraw_pistols
void UndrawPistols(int32_t weapon_type)
{
int16_t anil = Lara.left_arm.frame_number;
if (anil >= AF_G_RECOIL) {
@ -39,7 +41,7 @@ void undraw_pistols(int32_t weapon_type)
} else if (anil > AF_G_DRAW1) {
anil--;
if (anil == AF_G_DRAW2) {
undraw_pistol_mesh_left(weapon_type);
UndrawPistolMeshLeft(weapon_type);
}
}
Lara.left_arm.frame_number = anil;
@ -59,7 +61,7 @@ void undraw_pistols(int32_t weapon_type)
} else if (anir > AF_G_DRAW1) {
anir--;
if (anir == AF_G_DRAW2) {
undraw_pistol_mesh_right(weapon_type);
UndrawPistolMeshRight(weapon_type);
}
}
Lara.right_arm.frame_number = anir;
@ -79,7 +81,8 @@ void undraw_pistols(int32_t weapon_type)
Lara.torso_y_rot = (Lara.right_arm.y_rot + Lara.left_arm.y_rot) / 4;
}
void ready_pistols()
// original name: ready_pistols
void ReadyPistols()
{
Lara.gun_status = LGS_READY;
Lara.left_arm.x_rot = 0;
@ -99,7 +102,8 @@ void ready_pistols()
Lara.left_arm.frame_base = Objects[O_PISTOLS].frame_base;
}
void draw_pistol_meshes(int32_t weapon_type)
// original name: draw_pistol_meshes
void DrawPistolMeshes(int32_t weapon_type)
{
int16_t object_num = O_PISTOLS;
if (weapon_type == LGT_MAGNUMS) {
@ -118,7 +122,8 @@ void draw_pistol_meshes(int32_t weapon_type)
Meshes[Objects[O_LARA].mesh_index + LM_THIGH_R];
}
void undraw_pistol_mesh_left(int32_t weapon_type)
// original name: undraw_pistol_mesh_left
void UndrawPistolMeshLeft(int32_t weapon_type)
{
int16_t object_num = O_PISTOLS;
if (weapon_type == LGT_MAGNUMS) {
@ -132,7 +137,8 @@ void undraw_pistol_mesh_left(int32_t weapon_type)
SoundEffect(7, &LaraItem->pos, 0);
}
void undraw_pistol_mesh_right(int32_t weapon_type)
// original name: undraw_pistol_mesh_right
void UndrawPistolMeshRight(int32_t weapon_type)
{
int16_t object_num = O_PISTOLS;
if (weapon_type == LGT_MAGNUMS) {
@ -240,9 +246,9 @@ void AnimatePistols(int32_t weapon_type)
void T1MInjectGameLaraGun2()
{
INJECT(0x00426470, draw_pistols);
INJECT(0x004265C0, undraw_pistols);
INJECT(0x00426830, draw_pistol_meshes);
INJECT(0x00426470, DrawPistols);
INJECT(0x004265C0, UndrawPistols);
INJECT(0x00426830, DrawPistolMeshes);
INJECT(0x004268A0, PistolHandler);
INJECT(0x004269D0, AnimatePistols);
}

View file

@ -92,14 +92,14 @@ void LaraGun()
if (Camera.type != CAM_CINEMATIC && Camera.type != CAM_LOOK) {
Camera.type = CAM_COMBAT;
}
draw_pistols(Lara.gun_type);
DrawPistols(Lara.gun_type);
break;
case LGT_SHOTGUN:
if (Camera.type != CAM_CINEMATIC && Camera.type != CAM_LOOK) {
Camera.type = CAM_COMBAT;
}
draw_shotgun();
DrawShotgun();
break;
}
break;
@ -110,11 +110,11 @@ void LaraGun()
case LGT_PISTOLS:
case LGT_MAGNUMS:
case LGT_UZIS:
undraw_pistols(Lara.gun_type);
UndrawPistols(Lara.gun_type);
break;
case LGT_SHOTGUN:
undraw_shotgun();
UndrawShotgun();
break;
}
break;
@ -193,7 +193,7 @@ void InitialiseNewWeapon()
Lara.right_arm.frame_base = Objects[O_PISTOLS].frame_base;
Lara.left_arm.frame_base = Objects[O_PISTOLS].frame_base;
if (Lara.gun_status != LGS_ARMLESS) {
draw_pistol_meshes(Lara.gun_type);
DrawPistolMeshes(Lara.gun_type);
}
break;
@ -201,7 +201,7 @@ void InitialiseNewWeapon()
Lara.right_arm.frame_base = Objects[O_SHOTGUN].frame_base;
Lara.left_arm.frame_base = Objects[O_SHOTGUN].frame_base;
if (Lara.gun_status != LGS_ARMLESS) {
draw_shotgun_meshes();
DrawShotgunMeshes();
}
break;

View file

@ -36,7 +36,7 @@ typedef enum {
THS_TEASE = 1,
THS_ACTIVE = 2,
THS_DONE = 3,
} THOR_HAMMER_STATES;
} THOR_HAMMER_STATE;
void DrawLightning(ITEM_INFO* item)
{

View file

@ -8,15 +8,24 @@
#include "game/vars.h"
#include "util.h"
#define MB_MAXOFF 300
#define MB_MAXOFF_Z (LARA_RAD + 80) // = 180
typedef enum {
MBS_STILL = 1,
MBS_PUSH = 2,
MBS_PULL = 3,
} MOVABLE_BLOCK_STATE;
typedef enum {
RBS_START = 0,
RBS_END = 1,
RBS_MOVING = 2,
} ROLLING_BLOCK_STATE;
static int16_t MovingBlockBounds[12] = {
-MB_MAXOFF,
+MB_MAXOFF,
-300,
+300,
0,
0,
-WALL_L / 2 - MB_MAXOFF_Z,
-WALL_L / 2 - (LARA_RAD + 80),
-WALL_L / 2,
-10 * PHD_DEGREE,
+10 * PHD_DEGREE,
@ -26,18 +35,6 @@ static int16_t MovingBlockBounds[12] = {
+10 * PHD_DEGREE,
};
typedef enum {
MBS_STILL = 1,
MBS_PUSH = 2,
MBS_PULL = 3,
} MOVABLE_BLOCK_STATES;
typedef enum {
RBS_START = 0,
RBS_END = 1,
RBS_MOVING = 2,
} ROLLING_BLOCK_STATES;
// original name: InitialiseMovingBlock
void InitialiseMovableBlock(int16_t item_num)
{

View file

@ -35,7 +35,7 @@
#define ABORTION_TRIGHT 0x3FF8000
#define ABORTION_TOUCH (ABORTION_TLEFT | ABORTION_TRIGHT)
enum ABORTION_ANIMS {
typedef enum {
ABORTION_EMPTY = 0,
ABORTION_STOP = 1,
ABORTION_TURN_L = 2,
@ -48,22 +48,22 @@ enum ABORTION_ANIMS {
ABORTION_FALL = 9,
ABORTION_DEATH = 10,
ABORTION_KILL = 11,
};
} ABORTION_ANIM;
typedef enum {
NATLA_EMPTY,
NATLA_STOP,
NATLA_FLY,
NATLA_RUN,
NATLA_AIM,
NATLA_SEMIDEATH,
NATLA_SHOOT,
NATLA_FALL,
NATLA_STAND,
NATLA_DEATH
} NATLA_ANIMS;
NATLA_EMPTY = 0,
NATLA_STOP = 1,
NATLA_FLY = 2,
NATLA_RUN = 3,
NATLA_AIM = 4,
NATLA_SEMIDEATH = 5,
NATLA_SHOOT = 6,
NATLA_FALL = 7,
NATLA_STAND = 8,
NATLA_DEATH = 9,
} NATLA_ANIM;
BITE_INFO NatlaGun = { 5, 220, 7, 4 };
static BITE_INFO NatlaGun = { 5, 220, 7, 4 };
void AbortionControl(int16_t item_num)
{

View file

@ -14,14 +14,14 @@ typedef enum {
CABIN_DROP2 = 2,
CABIN_DROP3 = 3,
CABIN_FINISH = 4,
} CABIN_ANIMS;
} CABIN_ANIM;
typedef enum {
BOAT_EMPTY = 0,
BOAT_SET = 1,
BOAT_MOVE = 2,
BOAT_STOP = 3,
} BOAT_ANIMS;
} BOAT_ANIM;
void ShutThatDoor(DOORPOS_DATA* d)
{

View file

@ -28,7 +28,7 @@ typedef enum {
PEOPLE_DEATH = 5,
PEOPLE_POSE = 6,
PEOPLE_SHOOT = 7,
} PEOPLE_ANIMS;
} PEOPLE_ANIM;
BITE_INFO LarsonGun = { -60, 170, 0, 14 };

View file

@ -15,7 +15,7 @@ typedef enum {
SS_OFF = 0,
SS_ON = 1,
SS_LINK = 2,
} SWITCH_STATES;
} SWITCH_STATE;
static int16_t PickUpBounds[12] = {
-256, +256, -100, +100, -256, +100, -10 * PHD_DEGREE, +10 * PHD_DEGREE,
@ -141,7 +141,9 @@ static PHD_VECTOR Switch2Position = { 0, 0, 108 };
static PHD_VECTOR KeyHolePosition = { 0, 0, WALL_L / 2 - LARA_RAD - 50 };
static PHD_VECTOR PuzzleHolePosition = { 0, 0, WALL_L / 2 - LARA_RAD - 85 };
static int PickUpX, PickUpY, PickUpZ;
static int32_t PickUpX;
static int32_t PickUpY;
static int32_t PickUpZ;
void AnimateLaraUntil(ITEM_INFO* lara_item, int32_t goal)
{

View file

@ -212,7 +212,7 @@ typedef enum {
#endif
O_ALPHABET = 190,
NUMBER_OBJECTS = 191,
} GAME_OBJECT_ID;
} OBJECT_ID;
typedef enum {
AF_VAULT12 = 759,
@ -258,7 +258,7 @@ typedef enum {
AF_PICKUP_UW = 2970,
AF_PICKUPSCION = 44,
AF_USEPUZZLE = 3372,
} LARA_ANIMATION_FRAMES;
} LARA_ANIMATION_FRAME;
typedef enum {
AF_SG_AIM = 0,
@ -267,7 +267,7 @@ typedef enum {
AF_SG_UNDRAW = 80,
AF_SG_UNAIM = 114,
AF_SG_END = 127,
} LARA_SHOTGUN_ANIMATION_FRAMES;
} LARA_SHOTGUN_ANIMATION_FRAME;
typedef enum {
AF_G_AIM = 0,
@ -277,7 +277,7 @@ typedef enum {
AF_G_DRAW2 = 13,
AF_G_DRAW2_L = 23,
AF_G_RECOIL = 24,
} LARA_GUN_ANIMATION_FRAMES;
} LARA_GUN_ANIMATION_FRAME;
typedef enum {
AA_VAULT12 = 50,
@ -322,14 +322,14 @@ typedef enum {
AA_SPAZ_BACK = 126,
AA_SPAZ_RIGHT = 127,
AA_SPAZ_LEFT = 128,
} LARA_ANIMATION_ANIMS;
} LARA_ANIMATION;
typedef enum {
LWS_ABOVEWATER = 0,
LWS_UNDERWATER = 1,
LWS_SURFACE = 2,
LWS_CHEAT = 3,
} LARA_WATER_STATES;
} LARA_WATER_STATUS;
typedef enum {
AS_WALK = 0,
@ -388,7 +388,7 @@ typedef enum {
AS_FASTDIVE = 53,
AS_GYMNAST = 54,
AS_WATEROUT = 55,
} LARA_STATES;
} LARA_STATE;
typedef enum {
LGS_ARMLESS = 0,
@ -396,7 +396,7 @@ typedef enum {
LGS_DRAW = 2,
LGS_UNDRAW = 3,
LGS_READY = 4,
} LARA_GUN_STATES;
} LARA_GUN_STATE;
typedef enum {
LGT_UNARMED = 0,
@ -405,7 +405,7 @@ typedef enum {
LGT_UZIS = 3,
LGT_SHOTGUN = 4,
NUM_WEAPONS = 5
} LARA_GUN_TYPES;
} LARA_GUN_TYPE;
typedef enum {
LM_HIPS = 0,
@ -424,7 +424,7 @@ typedef enum {
LM_HAND_L = 13,
LM_HEAD = 14,
LM_NUMBER_OF = 15,
} LARA_MESHES;
} LARA_MESH;
typedef enum {
MOOD_BORED = 0,
@ -433,7 +433,7 @@ typedef enum {
MOOD_STALK = 3,
} MOOD_TYPE;
enum {
typedef enum {
TARGET_NONE = 0,
TARGET_PRIMARY = 1,
TARGET_SECONDARY = 2,
@ -509,8 +509,8 @@ typedef enum {
// UB_LEVEL2 = 23, // TRUB - Temple of Cat
// UB_LEVEL3 = 24,
// UB_LEVEL4 = 25,
NUMBER_OF_LEVELS = 22,
} GAME_LEVELS;
LV_NUMBER_OF = 22,
} GAME_LEVEL;
typedef enum {
GF_STARTGAME = 0,
@ -531,7 +531,7 @@ typedef enum {
GF_CREDITS = 15 << 6,
GF_PREWARMGAME = 16 << 6,
GF_LOOPCINE = 17 << 6
} TITLE_OPTIONS;
} GAMEFLOW_OPTION;
typedef enum {
IN_FORWARD = (1 << 0),
@ -581,11 +581,11 @@ typedef enum {
TF_BOTTOM = (1 << 8),
TF_BGND = (1 << 9),
TF_OUTLINE = (1 << 10),
} TEXTSTRING_FLAGS;
} TEXTSTRING_FLAG;
typedef enum {
ASF_FPS = 1 << 2,
} APP_SETTINGS_FLAGS;
} APP_SETTINGS_FLAG;
typedef enum {
COLL_NONE = 0,
@ -595,13 +595,13 @@ typedef enum {
COLL_TOP = 8,
COLL_TOPFRONT = 16,
COLL_CLAMP = 32,
} COLL_TYPES;
} COLL_TYPE;
typedef enum {
HT_WALL = 0,
HT_SMALL_SLOPE = 1,
HT_BIG_SLOPE = 2,
} HEIGHT_TYPES;
} HEIGHT_TYPE;
typedef enum {
DIR_NORTH = 0,
@ -637,7 +637,7 @@ typedef enum {
typedef enum {
RF_UNDERWATER = 1,
} ROOM_FLAGS;
} ROOM_FLAG;
typedef enum {
FT_FLOOR = 0,
@ -646,7 +646,7 @@ typedef enum {
FT_ROOF = 3,
FT_TRIGGER = 4,
FT_LAVA = 5,
} FLOOR_TYPES;
} FLOOR_TYPE;
typedef enum {
TT_TRIGGER = 0,
@ -658,7 +658,7 @@ typedef enum {
TT_ANTIPAD = 6,
TT_COMBAT = 7,
TT_DUMMY = 8,
} TRIGGER_TYPES;
} TRIGGER_TYPE;
typedef enum {
TO_OBJECT = 0,
@ -672,7 +672,7 @@ typedef enum {
TO_CD = 8,
TO_FLIPEFFECT = 9,
TO_SECRET = 10,
} TRIGGER_OBJECTS;
} TRIGGER_OBJECT;
typedef enum {
IF_ONESHOT = 0x0100,
@ -680,7 +680,7 @@ typedef enum {
IF_REVERSE = 0x4000,
IF_NOT_VISIBLE = 0x0100,
IF_KILLED_ITEM = 0x8000,
} ITEM_FLAGS;
} ITEM_FLAG;
typedef enum {
FMV_INTRO = 0,
@ -724,10 +724,10 @@ typedef enum {
} INV_MODE;
typedef enum {
RM_MAIN = 0,
RM_OPTION = 1,
RM_KEYS = 2,
} RING_MODE;
RT_MAIN = 0,
RT_OPTION = 1,
RT_KEYS = 2,
} RING_TYPE;
typedef enum {
SHAPE_SPRITE = 1,
@ -766,7 +766,7 @@ typedef enum {
typedef enum {
DOOR_CLOSED = 0,
DOOR_OPEN = 1,
} DOOR_ANIMS;
} DOOR_ANIM;
#pragma pack(push, 1)
@ -1032,7 +1032,7 @@ typedef struct {
} START_INFO;
typedef struct {
/* 0000 */ START_INFO start[NUMBER_OF_LEVELS];
/* 0000 */ START_INFO start[LV_NUMBER_OF];
/* 014A */ uint32_t timer;
/* 014E */ uint32_t kills;
/* 0152 */ uint16_t secrets;

View file

@ -45,9 +45,9 @@
#define Lara VAR_U_(0x0045ED80, LARA_INFO)
#define LaraItem VAR_U_(0x0045EE6C, ITEM_INFO*)
#define PierreItem VAR_U_(0x0045E328, int16_t)
#define LevelNames ARRAY_(0x00453648, const char*, [NUMBER_OF_LEVELS])
#define LevelTitles ARRAY_(0x00453DF8, const char*, [NUMBER_OF_LEVELS])
#define LevelMusic ARRAY_(0x00456A18, int16_t, [NUMBER_OF_LEVELS])
#define LevelNames ARRAY_(0x00453648, const char*, [LV_NUMBER_OF])
#define LevelTitles ARRAY_(0x00453DF8, const char*, [LV_NUMBER_OF])
#define LevelMusic ARRAY_(0x00456A18, int16_t, [LV_NUMBER_OF])
#define SecretTotals ARRAY_(0x00453CB0, int8_t, [MAX_SECRETS])
#define ResetFlag VAR_I_(0x00459F50, int32_t, 0)
#define Input VAR_U_(0x0045EEF4, int32_t)
@ -125,17 +125,12 @@
#define Cine VAR_U_(0x00462CF4, int16_t*)
#define CineFrame VAR_U_(0x00462D14, int16_t)
#define CinematicPosition VAR_U_(0x00462D00, PHD_3DPOS)
// #define LaraControlRoutines ARRAY_(0x00456490, ControlRoutine, [])
// #define LaraCollisionRoutines ARRAY_(0x00456570, CollisionRoutine, [])
#define DumpX VAR_I_(0x004546E0, int16_t, 0)
#define DumpY VAR_I_(0x004546E2, int16_t, 0)
#define DumpWidth VAR_I_(0x004546E4, int16_t, 0)
#define DumpHeight VAR_I_(0x004546E6, int16_t, 0)
#define TriggerIndex VAR_U_(0x00462CE8, int16_t*)
#define Ticks VAR_U_(0x0045A318, int32_t)
#define EffectRoutines ARRAY_(0x00453600, EffectRoutine, [])
#define IMRate VAR_U_(0x00462BE0, int32_t)
#define IMFrac VAR_U_(0x00462570, int32_t)
#define IMMatrixPtr VAR_U_(0x00462BE4, PHD_MATRIX*)
@ -200,16 +195,16 @@
#define Item_Data VAR_U_(0x0045A0B8, int16_t)
#define InvNFrames VAR_U_(0x004550A0, int32_t)
#define LsAdder VAR_U_(0x0068F3A0, int32_t)
#define Key1Strings ARRAY_(0x00454178, char*, [NUMBER_OF_LEVELS])
#define Key2Strings ARRAY_(0x004541D0, char*, [NUMBER_OF_LEVELS])
#define Key3Strings ARRAY_(0x00454228, char*, [NUMBER_OF_LEVELS])
#define Key4Strings ARRAY_(0x00454280, char*, [NUMBER_OF_LEVELS])
#define Pickup1Strings ARRAY_(0x004540C8, char*, [NUMBER_OF_LEVELS])
#define Pickup2Strings ARRAY_(0x00454120, char*, [NUMBER_OF_LEVELS])
#define Puzzle1Strings ARRAY_(0x00453F68, char*, [NUMBER_OF_LEVELS])
#define Puzzle2Strings ARRAY_(0x00453FC0, char*, [NUMBER_OF_LEVELS])
#define Puzzle3Strings ARRAY_(0x00454018, char*, [NUMBER_OF_LEVELS])
#define Puzzle4Strings ARRAY_(0x00454070, char*, [NUMBER_OF_LEVELS])
#define Key1Strings ARRAY_(0x00454178, char*, [LV_NUMBER_OF])
#define Key2Strings ARRAY_(0x004541D0, char*, [LV_NUMBER_OF])
#define Key3Strings ARRAY_(0x00454228, char*, [LV_NUMBER_OF])
#define Key4Strings ARRAY_(0x00454280, char*, [LV_NUMBER_OF])
#define Pickup1Strings ARRAY_(0x004540C8, char*, [LV_NUMBER_OF])
#define Pickup2Strings ARRAY_(0x00454120, char*, [LV_NUMBER_OF])
#define Puzzle1Strings ARRAY_(0x00453F68, char*, [LV_NUMBER_OF])
#define Puzzle2Strings ARRAY_(0x00453FC0, char*, [LV_NUMBER_OF])
#define Puzzle3Strings ARRAY_(0x00454018, char*, [LV_NUMBER_OF])
#define Puzzle4Strings ARRAY_(0x00454070, char*, [LV_NUMBER_OF])
#define IMediOption VAR_U_(0x004559E0, INVENTORY_ITEM)
#define IBigMediOption VAR_U_(0x00455A20, INVENTORY_ITEM)
#define ILeadBarOption VAR_U_(0x00455A60, INVENTORY_ITEM)