Skip to content

Commit

Permalink
tr2/objects: port Object_SetupGeneralObjects
Browse files Browse the repository at this point in the history
  • Loading branch information
rr- committed Nov 5, 2024
1 parent 6c36549 commit c9948af
Show file tree
Hide file tree
Showing 105 changed files with 1,047 additions and 127 deletions.
132 changes: 66 additions & 66 deletions docs/tr2/progress.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
60 changes: 30 additions & 30 deletions docs/tr2/progress.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3157,19 +3157,19 @@ typedef enum {
0x0041C560 0x0068 + void __cdecl Sound_UpdateEffects(void);
0x0041C5D0 0x0059 -R int16_t __cdecl DoBloodSplat(int32_t x, int32_t y, int32_t z, int16_t speed, PHD_ANGLE direction, int16_t room_num);
0x0041C630 0x00A4 -R void __cdecl DoLotsOfBlood(int32_t x, int32_t y, int32_t z, int16_t speed, PHD_ANGLE direction, int16_t room_num, int32_t num);
0x0041C6E0 0x0082 -R void __cdecl ControlBlood1(int16_t fx_num);
0x0041C770 0x007F -R void __cdecl ControlExplosion1(int16_t fx_num);
0x0041C6E0 0x0082 -R void __cdecl Blood_Control(int16_t fx_num);
0x0041C770 0x007F -R void __cdecl Explosion_Control(int16_t fx_num);
0x0041C7F0 0x0072 -R void __cdecl Richochet(GAME_VECTOR *pos);
0x0041C870 0x0030 -R void __cdecl ControlRichochet1(int16_t fx_num);
0x0041C870 0x0030 -R void __cdecl Richochet_Control(int16_t fx_num);
0x0041C8A0 0x0064 -R void __cdecl CreateBubble(XYZ_32 *pos, int16_t room_num);
0x0041C910 0x0078 -R void __cdecl LaraBubbles(ITEM *item);
0x0041C990 0x00F3 -R void __cdecl ControlBubble1(int16_t fx_num);
0x0041C990 0x00F3 -R void __cdecl Bubbles_Control(int16_t fx_num);
0x0041CA90 0x00C2 -R void __cdecl Splash(ITEM *item);
0x0041CB60 0x0071 -R void __cdecl ControlSplash1(int16_t fx_num);
0x0041CBE0 0x00AE -R void __cdecl ControlWaterSprite(int16_t fx_num);
0x0041CC90 0x008C -R void __cdecl ControlSnowSprite(int16_t fx_num);
0x0041CD20 0x00DE -R void __cdecl ControlHotLiquid(int16_t fx_num);
0x0041CE00 0x013D -R void __cdecl WaterFall(int16_t fx_num);
0x0041CB60 0x0071 -R void __cdecl Splash_Control(int16_t fx_num);
0x0041CBE0 0x00AE -R void __cdecl WaterSprite_Control(int16_t fx_num);
0x0041CC90 0x008C -R void __cdecl SnowSprite_Control(int16_t fx_num);
0x0041CD20 0x00DE -R void __cdecl HotLiquid_Control(int16_t fx_num);
0x0041CE00 0x013D -R void __cdecl Waterfall_Control(int16_t fx_num);
0x0041CF40 0x000B -R void __cdecl finish_level_effect(ITEM *item);
0x0041CF50 0x0016 -R void __cdecl turn180_effect(ITEM *item);
0x0041CF70 0x0096 -R void __cdecl floor_shake_effect(ITEM *item);
Expand All @@ -3183,15 +3183,15 @@ typedef enum {
0x0041D1B0 0x001C -R void __cdecl CurtainFX(ITEM *item);
0x0041D1D0 0x001C -R void __cdecl StatueFX(ITEM *item);
0x0041D1F0 0x001C -R void __cdecl SetChangeFX(ITEM *item);
0x0041D210 0x003F -R void __cdecl ControlDingDong(int16_t item_num);
0x0041D250 0x0037 -R void __cdecl ControlLaraAlarm(int16_t item_num);
0x0041D290 0x0067 -R void __cdecl ControlAlarmSound(int16_t item_num);
0x0041D300 0x005D -R void __cdecl ControlBirdTweeter(int16_t item_num);
0x0041D210 0x003F - void __cdecl DingDong_Control(int16_t item_num);
0x0041D250 0x0037 - void __cdecl LaraAlarm_Control(int16_t item_num);
0x0041D290 0x0067 - void __cdecl AlarmSound_Control(int16_t item_num);
0x0041D300 0x005D - void __cdecl BirdTweeter_Control(int16_t item_num);
0x0041D360 0x0059 -R void __cdecl DoChimeSound(ITEM *item);
0x0041D3C0 0x0068 -R void __cdecl ControlClockChimes(int16_t item_num);
0x0041D430 0x0128 -R void __cdecl SphereOfDoomCollision(int16_t item_num, ITEM *lara_item, COLL_INFO *coll);
0x0041D560 0x00F0 -R void __cdecl SphereOfDoom(int16_t item_num);
0x0041D650 0x012D -R void __cdecl DrawSphereOfDoom(ITEM *item);
0x0041D3C0 0x0068 - void __cdecl ClockChimes_Control(int16_t item_num);
0x0041D430 0x0128 - void __cdecl SphereOfDoom_Collision(int16_t item_num, ITEM *lara_item, COLL_INFO *coll);
0x0041D560 0x00F0 - void __cdecl SphereOfDoom_Control(int16_t item_num);
0x0041D650 0x012D - void __cdecl SphereOfDoom_Draw(const ITEM *item);
0x0041D780 0x000A -R void __cdecl lara_hands_free(ITEM *item);
0x0041D790 0x0005 -R void __cdecl flip_map_effect(ITEM *item);
0x0041D7A0 0x0043 -R void __cdecl draw_right_gun(ITEM *item);
Expand Down Expand Up @@ -3490,7 +3490,7 @@ typedef enum {
# game/laraflare.c
0x0042F7A0 0x009D - int32_t __cdecl Flare_DoLight(XYZ_32 *pos, int32_t flare_age);
0x0042F840 0x00D3 - void __cdecl Flare_DoInHand(int32_t flare_age);
0x0042F920 0x00F8 - void __cdecl Flare_DrawInAir(ITEM *item);
0x0042F920 0x00F8 - void __cdecl Flare_DrawInAir(const ITEM *item);
0x0042FA20 0x01D7 - void __cdecl Flare_Create(int32_t thrown);
0x0042FC00 0x004B - void __cdecl Flare_SetArm(int32_t frame);
0x0042FC50 0x0169 - void __cdecl Flare_Draw(void);
Expand Down Expand Up @@ -3552,7 +3552,7 @@ typedef enum {
0x00432F90 0x0049 + void __cdecl LOT_ClearLOT(LOT_INFO *lot);

# game/missile.c
0x00432FE0 0x02D0 -R void __cdecl ControlMissile(int16_t fx_num);
0x00432FE0 0x02D0 -R void __cdecl Missile_Control(int16_t fx_num);
0x004332B0 0x00A7 -R void __cdecl ShootAtLara(FX *fx);
0x00433360 0x0386 +R int32_t __cdecl Effect_ExplodingDeath(int16_t item_num, int32_t mesh_bits, int16_t damage);
0x004336F0 0x0200 -R void __cdecl BodyPart_Control(int16_t fx_num);
Expand All @@ -3569,8 +3569,8 @@ typedef enum {
0x004341A0 0x006B - void __cdecl Object_DrawUnclippedItem(const ITEM *item);

# game/objects.c
0x00434210 0x00DB -R void __cdecl EarthQuake(int16_t item_num);
0x004342F0 0x003C -R void __cdecl ControlCutShotgun(int16_t item_num);
0x00434210 0x00DB - void __cdecl Earthquake_Control(int16_t item_num);
0x004342F0 0x003C - void __cdecl FinalCutscene_Control(int16_t item_num);
0x00434330 0x009D -R void __cdecl InitialiseFinalLevel(void);
0x00434400 0x020F + void __cdecl FinalLevelCounter_Control(int16_t item_num);
0x00434610 0x00D9 -R void __cdecl MiniCopterControl(int16_t item_num);
Expand All @@ -3579,12 +3579,12 @@ typedef enum {
0x00434800 0x00BD + void __cdecl GongBonger_Control(int16_t item_num);
0x004348C0 0x00BF + void __cdecl Zipline_Collision(int16_t item_num, ITEM *lara_item, COLL_INFO *coll);
0x00434980 0x028F + void __cdecl Zipline_Control(int16_t item_num);
0x00434C10 0x00E3 -R void __cdecl BigBowlControl(int16_t item_num);
0x00434D00 0x007E -R void __cdecl BellControl(int16_t item_num);
0x00434D80 0x0075 -R void __cdecl InitialiseWindow(int16_t item_num);
0x00434C10 0x00E3 - void __cdecl BigBowl_Control(int16_t item_num);
0x00434D00 0x007E - void __cdecl Bell_Control(int16_t item_num);
0x00434D80 0x0075 - void __cdecl Window_Initialise(int16_t item_num);
0x00434E00 0x00C4 -R void __cdecl SmashWindow(int16_t item_num);
0x00434ED0 0x0096 -R void __cdecl WindowControl(int16_t item_num);
0x00434F70 0x00DC -R void __cdecl SmashIceControl(int16_t item_num);
0x00434ED0 0x0096 - void __cdecl Window_Control(int16_t item_num);
0x00434F70 0x00DC -R void __cdecl SmashIce_Control(int16_t item_num);
0x00435050 0x0042 + void __cdecl Door_Shut(DOORPOS_DATA *d);
0x004350A0 0x0032 + void __cdecl Door_Open(DOORPOS_DATA *d);
0x004350E0 0x03DC + void __cdecl Door_Initialise(int16_t item_num);
Expand All @@ -3611,8 +3611,8 @@ typedef enum {

# game/people.c
0x00435E00 0x0085 + bool __cdecl Creature_CanTargetEnemy(const ITEM *item, const AI_INFO *info);
0x00435E90 0x003B -R void __cdecl ControlGlow(int16_t fx_num);
0x00435ED0 0x004E -R void __cdecl ControlGunShot(int16_t fx_num);
0x00435E90 0x003B -R void __cdecl Glow_Control(int16_t fx_num);
0x00435ED0 0x004E -R void __cdecl GunFlash_Control(int16_t fx_num);
0x00435F20 0x0066 -R int16_t __cdecl GunShot(int32_t x, int32_t y, int32_t z, int16_t speed, PHD_ANGLE yrot, int16_t room_num);
0x00435F90 0x00B9 -R int16_t __cdecl GunHit(int32_t x, int32_t y, int32_t z, int16_t speed, PHD_ANGLE yrot, int16_t room_num);
0x00436050 0x00A7 -R int16_t __cdecl GunMiss(int32_t x, int32_t y, int32_t z, int16_t speed, PHD_ANGLE yrot, int16_t room_num);
Expand All @@ -3638,7 +3638,7 @@ typedef enum {
0x00438D80 0x00BD + int32_t __cdecl Switch_Trigger(int16_t item_num, int16_t timer);
0x00438E40 0x003D + int32_t __cdecl Keyhole_Trigger(int16_t item_num);
0x00438E80 0x0033 + int32_t __cdecl Pickup_Trigger(int16_t item_num);
0x00438EC0 0x0023 -R void __cdecl SecretControl(int16_t item_num);
0x00438EC0 0x0023 -R void __cdecl Secret_Control(int16_t item_num);

# game/rat.c
0x00438EF0 0x01DC - void __cdecl Mouse_Control(int16_t item_num);
Expand All @@ -3659,7 +3659,7 @@ typedef enum {
0x0043A450 0x0027 -R void __cdecl InitialiseLevelFlags(void);
0x0043A480 0x103B + void __cdecl Object_SetupBaddyObjects(void);
0x0043B4C0 0x05FD - void __cdecl Object_SetupTrapObjects(void);
0x0043BAC0 0x0C4C - void __cdecl Object_SetupGeneralObjects(void);
0x0043BAC0 0x0C4C + void __cdecl Object_SetupGeneralObjects(void);
0x0043C710 0x0068 + void __cdecl Object_SetupAllObjects(void);
0x0043C780 0x00CE -R void __cdecl GetCarriedItems(void);

Expand Down
10 changes: 10 additions & 0 deletions src/tr2/game/objects/effects/blood.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#include "game/objects/effects/blood.h"

#include "global/funcs.h"

void Blood_Setup(void)
{
OBJECT *const obj = Object_GetObject(O_BLOOD);
obj->control = Blood_Control;
obj->semi_transparent = 1;
}
5 changes: 5 additions & 0 deletions src/tr2/game/objects/effects/blood.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#pragma once

#include "global/types.h"

void Blood_Setup(void);
11 changes: 11 additions & 0 deletions src/tr2/game/objects/effects/body_part.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#include "game/objects/effects/body_part.h"

#include "global/funcs.h"

void BodyPart_Setup(void)
{
OBJECT *const obj = Object_GetObject(O_BODY_PART);
obj->control = BodyPart_Control;
obj->loaded = 1;
obj->mesh_count = 0;
}
5 changes: 5 additions & 0 deletions src/tr2/game/objects/effects/body_part.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#pragma once

#include "global/types.h"

void BodyPart_Setup(void);
9 changes: 9 additions & 0 deletions src/tr2/game/objects/effects/bubbles.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#include "game/objects/effects/bubbles.h"

#include "global/funcs.h"

void Bubbles_Setup(void)
{
OBJECT *const obj = Object_GetObject(O_BUBBLES);
obj->control = Bubbles_Control;
}
5 changes: 5 additions & 0 deletions src/tr2/game/objects/effects/bubbles.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#pragma once

#include "global/types.h"

void Bubbles_Setup(void);
10 changes: 10 additions & 0 deletions src/tr2/game/objects/effects/explosion.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#include "game/objects/effects/explosion.h"

#include "global/funcs.h"

void Explosion_Setup(void)
{
OBJECT *const obj = Object_GetObject(O_EXPLOSION);
obj->control = Explosion_Control;
obj->semi_transparent = 1;
}
5 changes: 5 additions & 0 deletions src/tr2/game/objects/effects/explosion.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#pragma once

#include "global/types.h"

void Explosion_Setup(void);
9 changes: 9 additions & 0 deletions src/tr2/game/objects/effects/glow.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#include "game/objects/effects/glow.h"

#include "global/funcs.h"

void Glow_Setup(void)
{
OBJECT *const obj = Object_GetObject(O_GLOW);
obj->control = Glow_Control;
}
5 changes: 5 additions & 0 deletions src/tr2/game/objects/effects/glow.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#pragma once

#include "global/types.h"

void Glow_Setup(void);
9 changes: 9 additions & 0 deletions src/tr2/game/objects/effects/gun_flash.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#include "game/objects/effects/gun_flash.h"

#include "global/funcs.h"

void GunFlash_Setup(void)
{
OBJECT *const obj = Object_GetObject(O_GUN_FLASH);
obj->control = GunFlash_Control;
}
5 changes: 5 additions & 0 deletions src/tr2/game/objects/effects/gun_flash.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#pragma once

#include "global/types.h"

void GunFlash_Setup(void);
10 changes: 10 additions & 0 deletions src/tr2/game/objects/effects/missile_flame.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#include "game/objects/effects/missile_flame.h"

#include "global/funcs.h"

void MissileFlame_Setup(void)
{
OBJECT *const obj = Object_GetObject(O_MISSILE_FLAME);
obj->control = Missile_Control;
obj->semi_transparent = 1;
}
5 changes: 5 additions & 0 deletions src/tr2/game/objects/effects/missile_flame.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#pragma once

#include "global/types.h"

void MissileFlame_Setup(void);
10 changes: 10 additions & 0 deletions src/tr2/game/objects/effects/missile_harpoon.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#include "game/objects/effects/missile_harpoon.h"

#include "global/funcs.h"

void MissileHarpoon_Setup(void)
{
OBJECT *const obj = Object_GetObject(O_MISSILE_HARPOON);
obj->control = Missile_Control;
obj->save_position = 1;
}
5 changes: 5 additions & 0 deletions src/tr2/game/objects/effects/missile_harpoon.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#pragma once

#include "global/types.h"

void MissileHarpoon_Setup(void);
10 changes: 10 additions & 0 deletions src/tr2/game/objects/effects/missile_knife.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#include "game/objects/effects/missile_knife.h"

#include "global/funcs.h"

void MissileKnife_Setup(void)
{
OBJECT *const obj = Object_GetObject(O_MISSILE_KNIFE);
obj->control = Missile_Control;
obj->save_position = 1;
}
5 changes: 5 additions & 0 deletions src/tr2/game/objects/effects/missile_knife.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#pragma once

#include "global/types.h"

void MissileKnife_Setup(void);
9 changes: 9 additions & 0 deletions src/tr2/game/objects/effects/ricochet.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#include "game/objects/effects/ricochet.h"

#include "global/funcs.h"

void Ricochet_Setup(void)
{
OBJECT *const obj = Object_GetObject(O_RICOCHET);
obj->control = Richochet_Control;
}
5 changes: 5 additions & 0 deletions src/tr2/game/objects/effects/ricochet.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#pragma once

#include "global/types.h"

void Ricochet_Setup(void);
9 changes: 9 additions & 0 deletions src/tr2/game/objects/effects/snow_sprite.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#include "game/objects/effects/snow_sprite.h"

#include "global/funcs.h"

void SnowSprite_Setup(void)
{
OBJECT *const obj = Object_GetObject(O_SNOW_SPRITE);
obj->control = SnowSprite_Control;
}
5 changes: 5 additions & 0 deletions src/tr2/game/objects/effects/snow_sprite.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#pragma once

#include "global/types.h"

void SnowSprite_Setup(void);
10 changes: 10 additions & 0 deletions src/tr2/game/objects/effects/splash.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#include "game/objects/effects/splash.h"

#include "global/funcs.h"

void Splash_Setup(void)
{
OBJECT *const obj = Object_GetObject(O_SPLASH);
obj->control = Splash_Control;
obj->semi_transparent = 1;
}
5 changes: 5 additions & 0 deletions src/tr2/game/objects/effects/splash.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#pragma once

#include "global/types.h"

void Splash_Setup(void);
6 changes: 6 additions & 0 deletions src/tr2/game/objects/effects/twinkle.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,12 @@ static bool M_ShouldDisappear(
return dx < DISAPPEAR_RANGE && dy < DISAPPEAR_RANGE && dz < DISAPPEAR_RANGE;
}

void Twinkle_Setup(void)
{
OBJECT *const obj = Object_GetObject(O_TWINKLE);
obj->control = Twinkle_Control;
}

void __cdecl Twinkle_Control(const int16_t fx_num)
{
FX *const fx = &g_Effects[fx_num];
Expand Down
2 changes: 2 additions & 0 deletions src/tr2/game/objects/effects/twinkle.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@

#include <stdint.h>

void Twinkle_Setup(void);

void __cdecl Twinkle_Control(int16_t fx_num);
10 changes: 10 additions & 0 deletions src/tr2/game/objects/effects/water_sprite.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#include "game/objects/effects/water_sprite.h"

#include "global/funcs.h"

void WaterSprite_Setup(void)
{
OBJECT *const obj = Object_GetObject(O_WATER_SPRITE);
obj->control = WaterSprite_Control;
obj->semi_transparent = 1;
}
5 changes: 5 additions & 0 deletions src/tr2/game/objects/effects/water_sprite.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#pragma once

#include "global/types.h"

void WaterSprite_Setup(void);
11 changes: 11 additions & 0 deletions src/tr2/game/objects/effects/waterfall.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#include "game/objects/effects/waterfall.h"

#include "game/objects/common.h"
#include "global/funcs.h"

void Waterfall_Setup(void)
{
OBJECT *const obj = Object_GetObject(O_WATERFALL);
obj->control = Waterfall_Control;
obj->draw_routine = Object_DrawDummyItem;
}
5 changes: 5 additions & 0 deletions src/tr2/game/objects/effects/waterfall.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#pragma once

#include "global/types.h"

void Waterfall_Setup(void);
10 changes: 10 additions & 0 deletions src/tr2/game/objects/general/alarm_sound.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#include "game/objects/general/alarm_sound.h"

#include "global/funcs.h"

void AlarmSound_Setup(void)
{
OBJECT *const obj = Object_GetObject(O_ALARM_SOUND);
obj->control = AlarmSound_Control;
obj->save_flags = 1;
}
Loading

0 comments on commit c9948af

Please sign in to comment.