Skip to content

Commit

Permalink
objects: further clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
rr- committed Sep 13, 2024
1 parent 453d1ed commit 45b2781
Show file tree
Hide file tree
Showing 42 changed files with 451 additions and 461 deletions.
4 changes: 2 additions & 2 deletions src/game/carrier.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ static ITEM_INFO *Carrier_GetCarrier(int16_t item_num);
static void Carrier_AnimateDrop(CARRIED_ITEM *item);

static const GAME_OBJECT_PAIR m_LegacyMap[] = {
{ O_PIERRE, O_SCION_ITEM2 }, { O_COWBOY, O_MAGNUM_ITEM },
{ O_SKATEKID, O_UZI_ITEM }, { O_BALDY, O_SHOTGUN_ITEM },
{ O_PIERRE, O_SCION_ITEM_2 }, { O_COWBOY, O_MAGNUM_ITEM },
{ O_SKATEKID, O_UZI_ITEM }, { O_BALDY, O_SHOTGUN_ITEM },
{ NO_OBJECT, NO_OBJECT },
};

Expand Down
2 changes: 1 addition & 1 deletion src/game/effect_routines/bubbles.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ void FX_Bubbles(ITEM_INFO *item)
fx->pos.x = offset.x;
fx->pos.y = offset.y;
fx->pos.z = offset.z;
fx->object_id = O_BUBBLES1;
fx->object_id = O_BUBBLES_1;
fx->frame_num = -((Random_GetDraw() * 3) / 0x8000);
fx->speed = 10 + ((Random_GetDraw() * 6) / 0x8000);
}
Expand Down
2 changes: 1 addition & 1 deletion src/game/effects/blood.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ int16_t Effect_Blood(
fx->pos.y = y;
fx->pos.z = z;
fx->rot.y = direction;
fx->object_id = O_BLOOD1;
fx->object_id = O_BLOOD_1;
fx->frame_num = 0;
fx->counter = 0;
fx->speed = speed;
Expand Down
4 changes: 2 additions & 2 deletions src/game/effects/gun.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ int16_t Effect_ShardGun(
fx->rot.x = 0;
fx->rot.y = y_rot;
fx->rot.z = 0;
fx->object_id = O_MISSILE2;
fx->object_id = O_MISSILE_2;
fx->frame_num = 0;
fx->speed = SHARD_SPEED;
fx->shade = 3584;
Expand All @@ -67,7 +67,7 @@ int16_t Effect_RocketGun(
fx->rot.x = 0;
fx->rot.y = y_rot;
fx->rot.z = 0;
fx->object_id = O_MISSILE3;
fx->object_id = O_MISSILE_3;
fx->frame_num = 0;
fx->speed = ROCKET_SPEED;
fx->shade = 4096;
Expand Down
2 changes: 1 addition & 1 deletion src/game/gun/gun_misc.c
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,7 @@ void Gun_HitTarget(ITEM_INFO *item, GAME_VECTOR *hitpos, int16_t damage)
}
Item_TakeDamage(item, damage, true);

if (g_Config.fix_texture_issues && item->object_id == O_SCION_ITEM3) {
if (g_Config.fix_texture_issues && item->object_id == O_SCION_ITEM_3) {
GAME_VECTOR pos;
pos.x = hitpos->x;
pos.y = hitpos->y;
Expand Down
44 changes: 22 additions & 22 deletions src/game/inventory/inventory_func.c
Original file line number Diff line number Diff line change
Expand Up @@ -118,23 +118,23 @@ bool Inv_AddItem(const GAME_OBJECT_ID object_id)
Inv_InsertItem(&g_InvItemBigMedi);
return true;

case O_PUZZLE_ITEM1:
case O_PUZZLE_OPTION1:
case O_PUZZLE_ITEM_1:
case O_PUZZLE_OPTION_1:
Inv_InsertItem(&g_InvItemPuzzle1);
return true;

case O_PUZZLE_ITEM2:
case O_PUZZLE_OPTION2:
case O_PUZZLE_ITEM_2:
case O_PUZZLE_OPTION_2:
Inv_InsertItem(&g_InvItemPuzzle2);
return true;

case O_PUZZLE_ITEM3:
case O_PUZZLE_OPTION3:
case O_PUZZLE_ITEM_3:
case O_PUZZLE_OPTION_3:
Inv_InsertItem(&g_InvItemPuzzle3);
return true;

case O_PUZZLE_ITEM4:
case O_PUZZLE_OPTION4:
case O_PUZZLE_ITEM_4:
case O_PUZZLE_OPTION_4:
Inv_InsertItem(&g_InvItemPuzzle4);
return true;

Expand All @@ -143,38 +143,38 @@ bool Inv_AddItem(const GAME_OBJECT_ID object_id)
Inv_InsertItem(&g_InvItemLeadBar);
return true;

case O_KEY_ITEM1:
case O_KEY_OPTION1:
case O_KEY_ITEM_1:
case O_KEY_OPTION_1:
Inv_InsertItem(&g_InvItemKey1);
return true;

case O_KEY_ITEM2:
case O_KEY_OPTION2:
case O_KEY_ITEM_2:
case O_KEY_OPTION_2:
Inv_InsertItem(&g_InvItemKey2);
return true;

case O_KEY_ITEM3:
case O_KEY_OPTION3:
case O_KEY_ITEM_3:
case O_KEY_OPTION_3:
Inv_InsertItem(&g_InvItemKey3);
return true;

case O_KEY_ITEM4:
case O_KEY_OPTION4:
case O_KEY_ITEM_4:
case O_KEY_OPTION_4:
Inv_InsertItem(&g_InvItemKey4);
return true;

case O_PICKUP_ITEM1:
case O_PICKUP_OPTION1:
case O_PICKUP_ITEM_1:
case O_PICKUP_OPTION_1:
Inv_InsertItem(&g_InvItemPickup1);
return true;

case O_PICKUP_ITEM2:
case O_PICKUP_OPTION2:
case O_PICKUP_ITEM_2:
case O_PICKUP_OPTION_2:
Inv_InsertItem(&g_InvItemPickup2);
return true;

case O_SCION_ITEM:
case O_SCION_ITEM2:
case O_SCION_ITEM_1:
case O_SCION_ITEM_2:
case O_SCION_OPTION:
Inv_InsertItem(&g_InvItemScion);
return true;
Expand Down
20 changes: 10 additions & 10 deletions src/game/inventory/inventory_ring.c
Original file line number Diff line number Diff line change
Expand Up @@ -256,17 +256,17 @@ void Inv_Ring_Active(INVENTORY_ITEM *inv_item)
}
break;

case O_KEY_OPTION1:
case O_KEY_OPTION2:
case O_KEY_OPTION3:
case O_KEY_OPTION4:
case O_KEY_OPTION_1:
case O_KEY_OPTION_2:
case O_KEY_OPTION_3:
case O_KEY_OPTION_4:
case O_LEADBAR_OPTION:
case O_PICKUP_OPTION1:
case O_PICKUP_OPTION2:
case O_PUZZLE_OPTION1:
case O_PUZZLE_OPTION2:
case O_PUZZLE_OPTION3:
case O_PUZZLE_OPTION4:
case O_PICKUP_OPTION_1:
case O_PICKUP_OPTION_2:
case O_PUZZLE_OPTION_1:
case O_PUZZLE_OPTION_2:
case O_PUZZLE_OPTION_3:
case O_PUZZLE_OPTION_4:
case O_SCION_OPTION:
if (!g_InvItemText[IT_QTY] && qty > 1) {
sprintf(temp_text, "%d", qty);
Expand Down
20 changes: 10 additions & 10 deletions src/game/inventory/inventory_vars.c
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ INVENTORY_ITEM g_InvItemLeadBar = {

INVENTORY_ITEM g_InvItemPickup1 = {
.string = "Pickup",
.object_id = O_PICKUP_OPTION1,
.object_id = O_PICKUP_OPTION_1,
.frames_total = 1,
.current_frame = 0,
.goal_frame = 0,
Expand All @@ -197,7 +197,7 @@ INVENTORY_ITEM g_InvItemPickup1 = {

INVENTORY_ITEM g_InvItemPickup2 = {
.string = "Pickup",
.object_id = O_PICKUP_OPTION2,
.object_id = O_PICKUP_OPTION_2,
.frames_total = 1,
.current_frame = 0,
.goal_frame = 0,
Expand Down Expand Up @@ -245,7 +245,7 @@ INVENTORY_ITEM g_InvItemScion = {

INVENTORY_ITEM g_InvItemPuzzle1 = {
.string = "Puzzle",
.object_id = O_PUZZLE_OPTION1,
.object_id = O_PUZZLE_OPTION_1,
.frames_total = 1,
.current_frame = 0,
.goal_frame = 0,
Expand All @@ -269,7 +269,7 @@ INVENTORY_ITEM g_InvItemPuzzle1 = {

INVENTORY_ITEM g_InvItemPuzzle2 = {
.string = "Puzzle",
.object_id = O_PUZZLE_OPTION2,
.object_id = O_PUZZLE_OPTION_2,
.frames_total = 1,
.current_frame = 0,
.goal_frame = 0,
Expand All @@ -293,7 +293,7 @@ INVENTORY_ITEM g_InvItemPuzzle2 = {

INVENTORY_ITEM g_InvItemPuzzle3 = {
.string = "Puzzle",
.object_id = O_PUZZLE_OPTION3,
.object_id = O_PUZZLE_OPTION_3,
.frames_total = 1,
.current_frame = 0,
.goal_frame = 0,
Expand All @@ -317,7 +317,7 @@ INVENTORY_ITEM g_InvItemPuzzle3 = {

INVENTORY_ITEM g_InvItemPuzzle4 = {
.string = "Puzzle",
.object_id = O_PUZZLE_OPTION4,
.object_id = O_PUZZLE_OPTION_4,
.frames_total = 1,
.current_frame = 0,
.goal_frame = 0,
Expand All @@ -341,7 +341,7 @@ INVENTORY_ITEM g_InvItemPuzzle4 = {

INVENTORY_ITEM g_InvItemKey1 = {
.string = "Key",
.object_id = O_KEY_OPTION1,
.object_id = O_KEY_OPTION_1,
.frames_total = 1,
.current_frame = 0,
.goal_frame = 0,
Expand All @@ -365,7 +365,7 @@ INVENTORY_ITEM g_InvItemKey1 = {

INVENTORY_ITEM g_InvItemKey2 = {
.string = "Key",
.object_id = O_KEY_OPTION2,
.object_id = O_KEY_OPTION_2,
.frames_total = 1,
.current_frame = 0,
.goal_frame = 0,
Expand All @@ -389,7 +389,7 @@ INVENTORY_ITEM g_InvItemKey2 = {

INVENTORY_ITEM g_InvItemKey3 = {
.string = "Key",
.object_id = O_KEY_OPTION3,
.object_id = O_KEY_OPTION_3,
.frames_total = 1,
.current_frame = 0,
.goal_frame = 0,
Expand All @@ -413,7 +413,7 @@ INVENTORY_ITEM g_InvItemKey3 = {

INVENTORY_ITEM g_InvItemKey4 = {
.string = "Key",
.object_id = O_KEY_OPTION4,
.object_id = O_KEY_OPTION_4,
.frames_total = 1,
.current_frame = 0,
.goal_frame = 0,
Expand Down
42 changes: 21 additions & 21 deletions src/game/lara/lara.c
Original file line number Diff line number Diff line change
Expand Up @@ -391,28 +391,28 @@ void Lara_UseItem(GAME_OBJECT_ID object_id)
Sound_Effect(SFX_MENU_MEDI, NULL, SPM_ALWAYS);
break;

case O_KEY_ITEM1:
case O_KEY_OPTION1:
case O_KEY_ITEM2:
case O_KEY_OPTION2:
case O_KEY_ITEM3:
case O_KEY_OPTION3:
case O_KEY_ITEM4:
case O_KEY_OPTION4:
case O_PUZZLE_ITEM1:
case O_PUZZLE_OPTION1:
case O_PUZZLE_ITEM2:
case O_PUZZLE_OPTION2:
case O_PUZZLE_ITEM3:
case O_PUZZLE_OPTION3:
case O_PUZZLE_ITEM4:
case O_PUZZLE_OPTION4:
case O_KEY_ITEM_1:
case O_KEY_OPTION_1:
case O_KEY_ITEM_2:
case O_KEY_OPTION_2:
case O_KEY_ITEM_3:
case O_KEY_OPTION_3:
case O_KEY_ITEM_4:
case O_KEY_OPTION_4:
case O_PUZZLE_ITEM_1:
case O_PUZZLE_OPTION_1:
case O_PUZZLE_ITEM_2:
case O_PUZZLE_OPTION_2:
case O_PUZZLE_ITEM_3:
case O_PUZZLE_OPTION_3:
case O_PUZZLE_ITEM_4:
case O_PUZZLE_OPTION_4:
case O_LEADBAR_ITEM:
case O_LEADBAR_OPTION:
case O_SCION_ITEM:
case O_SCION_ITEM2:
case O_SCION_ITEM3:
case O_SCION_ITEM4:
case O_SCION_ITEM_1:
case O_SCION_ITEM_2:
case O_SCION_ITEM_3:
case O_SCION_ITEM_4:
case O_SCION_OPTION: {
int16_t receptacle_item_num = Object_FindReceptacle(object_id);
if (receptacle_item_num == NO_OBJECT) {
Expand Down Expand Up @@ -581,7 +581,7 @@ void Lara_InitialiseInventory(int32_t level_num)
}

for (int i = 0; i < resume->num_scions; i++) {
Inv_AddItem(O_SCION_ITEM);
Inv_AddItem(O_SCION_ITEM_1);
}

for (int i = 0; i < resume->num_medis; i++) {
Expand Down
60 changes: 30 additions & 30 deletions src/game/lara/lara_cheat.c
Original file line number Diff line number Diff line change
Expand Up @@ -203,16 +203,16 @@ bool Lara_Cheat_GiveAllKeys(void)
return false;
}

Inv_AddItem(O_PUZZLE_ITEM1);
Inv_AddItem(O_PUZZLE_ITEM2);
Inv_AddItem(O_PUZZLE_ITEM3);
Inv_AddItem(O_PUZZLE_ITEM4);
Inv_AddItem(O_KEY_ITEM1);
Inv_AddItem(O_KEY_ITEM2);
Inv_AddItem(O_KEY_ITEM3);
Inv_AddItem(O_KEY_ITEM4);
Inv_AddItem(O_PICKUP_ITEM1);
Inv_AddItem(O_PICKUP_ITEM2);
Inv_AddItem(O_PUZZLE_ITEM_1);
Inv_AddItem(O_PUZZLE_ITEM_2);
Inv_AddItem(O_PUZZLE_ITEM_3);
Inv_AddItem(O_PUZZLE_ITEM_4);
Inv_AddItem(O_KEY_ITEM_1);
Inv_AddItem(O_KEY_ITEM_2);
Inv_AddItem(O_KEY_ITEM_3);
Inv_AddItem(O_KEY_ITEM_4);
Inv_AddItem(O_PICKUP_ITEM_1);
Inv_AddItem(O_PICKUP_ITEM_2);

Sound_Effect(SFX_LARA_KEY, NULL, SPM_ALWAYS);
Console_Log(GS(OSD_GIVE_ITEM_ALL_KEYS));
Expand Down Expand Up @@ -270,35 +270,35 @@ bool Lara_Cheat_GiveAllItems(void)
}
}

if (!Inv_RequestItem(O_KEY_ITEM1)) {
Inv_AddItem(O_KEY_ITEM1);
if (!Inv_RequestItem(O_KEY_ITEM_1)) {
Inv_AddItem(O_KEY_ITEM_1);
}
if (!Inv_RequestItem(O_KEY_ITEM2)) {
Inv_AddItem(O_KEY_ITEM2);
if (!Inv_RequestItem(O_KEY_ITEM_2)) {
Inv_AddItem(O_KEY_ITEM_2);
}
if (!Inv_RequestItem(O_KEY_ITEM3)) {
Inv_AddItem(O_KEY_ITEM3);
if (!Inv_RequestItem(O_KEY_ITEM_3)) {
Inv_AddItem(O_KEY_ITEM_3);
}
if (!Inv_RequestItem(O_KEY_ITEM4)) {
Inv_AddItem(O_KEY_ITEM4);
if (!Inv_RequestItem(O_KEY_ITEM_4)) {
Inv_AddItem(O_KEY_ITEM_4);
}
if (!Inv_RequestItem(O_PUZZLE_ITEM1)) {
Inv_AddItem(O_PUZZLE_ITEM1);
if (!Inv_RequestItem(O_PUZZLE_ITEM_1)) {
Inv_AddItem(O_PUZZLE_ITEM_1);
}
if (!Inv_RequestItem(O_PUZZLE_ITEM2)) {
Inv_AddItem(O_PUZZLE_ITEM2);
if (!Inv_RequestItem(O_PUZZLE_ITEM_2)) {
Inv_AddItem(O_PUZZLE_ITEM_2);
}
if (!Inv_RequestItem(O_PUZZLE_ITEM3)) {
Inv_AddItem(O_PUZZLE_ITEM3);
if (!Inv_RequestItem(O_PUZZLE_ITEM_3)) {
Inv_AddItem(O_PUZZLE_ITEM_3);
}
if (!Inv_RequestItem(O_PUZZLE_ITEM4)) {
Inv_AddItem(O_PUZZLE_ITEM4);
if (!Inv_RequestItem(O_PUZZLE_ITEM_4)) {
Inv_AddItem(O_PUZZLE_ITEM_4);
}
if (!Inv_RequestItem(O_PICKUP_ITEM1)) {
Inv_AddItem(O_PICKUP_ITEM1);
if (!Inv_RequestItem(O_PICKUP_ITEM_1)) {
Inv_AddItem(O_PICKUP_ITEM_1);
}
if (!Inv_RequestItem(O_PICKUP_ITEM2)) {
Inv_AddItem(O_PICKUP_ITEM2);
if (!Inv_RequestItem(O_PICKUP_ITEM_2)) {
Inv_AddItem(O_PICKUP_ITEM_2);
}

Sound_Effect(SFX_LARA_HOLSTER, &g_LaraItem->pos, SPM_NORMAL);
Expand Down
Loading

0 comments on commit 45b2781

Please sign in to comment.