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

Function BuildOutsideRoomsTable

TombEngine/Specific/level.cpp:2011–2040  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2009}
2010
2011void BuildOutsideRoomsTable()
2012{
2013 for (int x = 0; x < OUTSIDE_SIZE; x++)
2014 {
2015 for (int z = 0; z < OUTSIDE_SIZE; z++)
2016 OutsideRoomTable[x][z].clear();
2017 }
2018
2019 for (int i = 0; i < g_Level.Rooms.size(); i++)
2020 {
2021 auto* room = &g_Level.Rooms[i];
2022
2023 int rx = (room->Position.x / BLOCK(1));
2024 int rz = (room->Position.z / BLOCK(1));
2025
2026 for (int x = 0; x < OUTSIDE_SIZE; x++)
2027 {
2028 if (x < (rx + 1) || x > (rx + room->XSize - 2))
2029 continue;
2030
2031 for (int z = 0; z < OUTSIDE_SIZE; z++)
2032 {
2033 if (z < (rz + 1) || z > (rz + room->ZSize - 2))
2034 continue;
2035
2036 OutsideRoomTable[x][z].push_back(i);
2037 }
2038 }
2039 }
2040}

Callers 1

LoadRoomsFunction · 0.85

Calls 3

clearMethod · 0.45
sizeMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected