mirror of
https://github.com/LostArtefacts/TRX.git
synced 2025-04-28 20:58:07 +03:00
tr2/objects/gondola: save gondola position
This updates gondola objects to have their positions saved in order to be able to restore them correctly on load when they've been destroyed. Legacy saves will ignore this. Resolves #1612.
This commit is contained in:
parent
6e48174a92
commit
cd67279fc7
4 changed files with 12 additions and 2 deletions
|
@ -41,6 +41,7 @@
|
||||||
- fixed invalid portals in The Deck between rooms 17 and 104, which could result in Lara seeing enemies in disconnected rooms (#2393)
|
- fixed invalid portals in The Deck between rooms 17 and 104, which could result in Lara seeing enemies in disconnected rooms (#2393)
|
||||||
- fixed pushblocks being rotated when Lara grabs them, most noticeable if asymmetric textures have been used (#2776)
|
- fixed pushblocks being rotated when Lara grabs them, most noticeable if asymmetric textures have been used (#2776)
|
||||||
- fixed the boat briefly having an underwater hue when Lara first climbs on (#2787)
|
- fixed the boat briefly having an underwater hue when Lara first climbs on (#2787)
|
||||||
|
- fixed destroyed gondolas appearing embedded in the ground after loading a save (#1612)
|
||||||
- fixed the camera going out of bounds in 60fps near specific invalid floor data (known as no-space) (#2764, regression from 0.10)
|
- fixed the camera going out of bounds in 60fps near specific invalid floor data (known as no-space) (#2764, regression from 0.10)
|
||||||
- fixed sprites rendering black if no shade value is assigned in the level (#2701, regression from 0.8)
|
- fixed sprites rendering black if no shade value is assigned in the level (#2701, regression from 0.8)
|
||||||
- fixed some 3D pickup items rendering black in software mode (#2792, regression from 0.10)
|
- fixed some 3D pickup items rendering black in software mode (#2792, regression from 0.10)
|
||||||
|
|
|
@ -246,6 +246,7 @@ as Notepad.
|
||||||
- fixed Floating Islands mystic plaque inventory rotation
|
- fixed Floating Islands mystic plaque inventory rotation
|
||||||
- fixed pushblocks being rotated when Lara grabs them, most noticeable if asymmetric textures have been used
|
- fixed pushblocks being rotated when Lara grabs them, most noticeable if asymmetric textures have been used
|
||||||
- fixed being able to use hotkeys in the end-level statistics screen
|
- fixed being able to use hotkeys in the end-level statistics screen
|
||||||
|
- fixed destroyed gondolas appearing embedded in the ground after loading a save
|
||||||
- improved the animation of Lara's braid
|
- improved the animation of Lara's braid
|
||||||
|
|
||||||
#### Cheats
|
#### Cheats
|
||||||
|
|
|
@ -15,6 +15,7 @@ static void M_Setup(OBJECT *const obj)
|
||||||
obj->collision_func = Object_Collision;
|
obj->collision_func = Object_Collision;
|
||||||
obj->save_flags = 1;
|
obj->save_flags = 1;
|
||||||
obj->save_anim = 1;
|
obj->save_anim = 1;
|
||||||
|
obj->save_position = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void M_Control(const int16_t item_num)
|
static void M_Control(const int16_t item_num)
|
||||||
|
|
|
@ -45,6 +45,7 @@ static int32_t m_BufPos = 0;
|
||||||
static char *m_BufPtr = nullptr;
|
static char *m_BufPtr = nullptr;
|
||||||
|
|
||||||
static bool M_ItemHasSaveFlags(const OBJECT *obj, const ITEM *item);
|
static bool M_ItemHasSaveFlags(const OBJECT *obj, const ITEM *item);
|
||||||
|
static bool M_ItemHasSavePosition(const OBJECT *obj, const ITEM *item);
|
||||||
|
|
||||||
static void M_Reset(char *buffer);
|
static void M_Reset(char *buffer);
|
||||||
|
|
||||||
|
@ -99,6 +100,12 @@ static bool M_ItemHasSaveFlags(const OBJECT *const obj, const ITEM *const item)
|
||||||
return obj->save_flags && item->object_id != O_WATERFALL;
|
return obj->save_flags && item->object_id != O_WATERFALL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static bool M_ItemHasSavePosition(
|
||||||
|
const OBJECT *const obj, const ITEM *const item)
|
||||||
|
{
|
||||||
|
return obj->save_position && item->object_id != O_GONDOLA;
|
||||||
|
}
|
||||||
|
|
||||||
static void M_Reset(char *const buffer)
|
static void M_Reset(char *const buffer)
|
||||||
{
|
{
|
||||||
m_BufPos = 0;
|
m_BufPos = 0;
|
||||||
|
@ -202,7 +209,7 @@ static void M_ReadItems(void)
|
||||||
ITEM *const item = Item_Get(item_num);
|
ITEM *const item = Item_Get(item_num);
|
||||||
const OBJECT *const obj = Object_Get(item->object_id);
|
const OBJECT *const obj = Object_Get(item->object_id);
|
||||||
|
|
||||||
if (obj->save_position) {
|
if (M_ItemHasSavePosition(obj, item)) {
|
||||||
item->pos.x = M_ReadS32();
|
item->pos.x = M_ReadS32();
|
||||||
item->pos.y = M_ReadS32();
|
item->pos.y = M_ReadS32();
|
||||||
item->pos.z = M_ReadS32();
|
item->pos.z = M_ReadS32();
|
||||||
|
@ -489,7 +496,7 @@ static void M_WriteItems(void)
|
||||||
for (int32_t i = 0; i < Item_GetLevelCount(); i++) {
|
for (int32_t i = 0; i < Item_GetLevelCount(); i++) {
|
||||||
const ITEM *const item = Item_Get(i);
|
const ITEM *const item = Item_Get(i);
|
||||||
const OBJECT *const obj = Object_Get(item->object_id);
|
const OBJECT *const obj = Object_Get(item->object_id);
|
||||||
if (obj->save_position) {
|
if (M_ItemHasSavePosition(obj, item)) {
|
||||||
M_WriteS32(item->pos.x);
|
M_WriteS32(item->pos.x);
|
||||||
M_WriteS32(item->pos.y);
|
M_WriteS32(item->pos.y);
|
||||||
M_WriteS32(item->pos.z);
|
M_WriteS32(item->pos.z);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue