TombEngine/TR5Main/Game/switch.cpp
MontyTRC89 8db7df3868 Merge branch 'doors_refactoring'
# Conflicts:
#	TR5Main/Game/door.cpp
#	TR5Main/Game/door.h
#	TR5Main/Game/memory/malloc.cpp
#	TR5Main/Objects/Generic/Switches/cog_switch.cpp
#	TR5Main/Objects/Generic/Switches/crowbar_switch.cpp
#	TR5Main/Objects/Generic/Switches/generic_switch.h
#	TR5Main/Objects/Generic/Switches/turn_switch.cpp
#	TR5Main/Objects/TR4/Object/tr4_obelisk.cpp
#	TR5Main/Renderer/Renderer11Draw.cpp
#	TR5Main/Specific/level.cpp
#	TR5Main/TombEngine.vcxproj
#	TR5Main/TombEngine.vcxproj.filters
2021-09-11 05:38:26 +02:00

47 lines
1.2 KiB
C++

#include "framework.h"
#include "switch.h"
#include "items.h"
#include "lot.h"
#include "objects.h"
#include "Lara.h"
#ifdef NEW_INV
#include "newinv2.h"
#else
#include "inventory.h"
#endif
#include "draw.h"
#include "sphere.h"
#include "camera.h"
#include "setup.h"
#include "level.h"
#include "input.h"
#include "Sound\sound.h"
// NOTE: we need to decompile/inspect if these functions are still needed
void ProcessExplodingSwitchType8(ITEM_INFO* item)
{
PHD_VECTOR pos;
pos.x = 0;
pos.y = 0;
pos.z = 0;
GetJointAbsPosition(item, &pos, 0);
TestTriggers(pos.x, pos.y, pos.z, item->roomNumber, true, NULL);
ExplodeItemNode(item, Objects[item->objectNumber].nmeshes - 1, 0, 64);
item->meshBits |= 1 << ((Objects[item->objectNumber].nmeshes & 0xFF) - 2);
}
void InitialiseShootSwitch(short itemNumber)
{
ITEM_INFO* item = &g_Level.Items[itemNumber];
if (item->triggerFlags == 444)
item->meshBits &= ~(1 << (Objects[item->objectNumber].nmeshes - 2));
}
void ShootSwitchCollision(short itemNumber, ITEM_INFO* l, COLL_INFO* coll)
{
ITEM_INFO* item = &g_Level.Items[itemNumber];
if (item->objectNumber == ID_SHOOT_SWITCH1 && !(item->meshBits & 1))
item->status = ITEM_INVISIBLE;
}