MCPcopy Create free account
hub / github.com/TombEngine/TombEngine / IsPointInRoom

Function IsPointInRoom

TombEngine/Game/room.cpp:767–785  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

765}
766
767bool IsPointInRoom(const Vector3i& pos, int roomNumber)
768{
769 if (roomNumber < 0 || roomNumber >= g_Level.Rooms.size())
770 return false;
771
772 const auto& room = g_Level.Rooms[roomNumber];
773
774 if (!room.Active())
775 return false;
776
777 if (pos.z >= (room.Position.z + BLOCK(1)) && pos.z <= (room.Position.z + BLOCK(room.ZSize - 1)) &&
778 pos.y <= room.BottomHeight && pos.y > room.TopHeight &&
779 pos.x >= (room.Position.x + BLOCK(1)) && pos.x <= (room.Position.x + BLOCK(room.XSize - 1)))
780 {
781 return true;
782 }
783
784 return false;
785}
786
787int FindRoomNumber(const Vector3i& pos, int startRoomNumber, bool onlyNeighbors)
788{

Callers 7

PrepareDynamicLightMethod · 0.85
CalculateSpotCamerasFunction · 0.85
FindRoomNumberFunction · 0.85
UpdateWeatherMethod · 0.85
SpawnDustParticlesMethod · 0.85
CreateFunction · 0.85
InitializeMethod · 0.85

Calls 2

ActiveMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected