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

Function FlipRooms

TombEngine/Game/room.cpp:588–615  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

586}
587
588static void FlipRooms(int roomNumber, RoomData& activeRoom, RoomData& flippedRoom)
589{
590 RemoveRoomFlipItems(activeRoom);
591
592 // Swap rooms.
593 std::swap(activeRoom, flippedRoom);
594 activeRoom.flippedRoom = flippedRoom.flippedRoom;
595 flippedRoom.flippedRoom = NO_VALUE;
596 activeRoom.itemNumber = flippedRoom.itemNumber;
597 activeRoom.fxNumber = flippedRoom.fxNumber;
598
599 AddRoomFlipItems(activeRoom);
600
601 // Update active room sectors.
602 for (auto& sector : activeRoom.Sectors)
603 sector.RoomNumber = roomNumber;
604
605 // Update flipped room sectors.
606 for (auto& sector : flippedRoom.Sectors)
607 sector.RoomNumber = activeRoom.flippedRoom;
608
609 // Swap stopper flags.
610 for (int i = 0; i < activeRoom.Sectors.size(); i++)
611 std::swap(activeRoom.Sectors[i].Stopper, flippedRoom.Sectors[i].Stopper);
612
613 // Update renderer data.
614 g_Renderer.FlipRooms(roomNumber, activeRoom.flippedRoom);
615}
616
617void ResetRoomData()
618{

Callers 2

ResetRoomDataFunction · 0.85
DoFlipMapFunction · 0.85

Calls 5

RemoveRoomFlipItemsFunction · 0.85
AddRoomFlipItemsFunction · 0.85
FlipRoomsMethod · 0.80
swapFunction · 0.50
sizeMethod · 0.45

Tested by

no test coverage detected