| 104 | } |
| 105 | |
| 106 | static void CameraStackRemove(CameraWorld* world, CameraComponent* camera) |
| 107 | { |
| 108 | bool found = false; |
| 109 | uint32_t num_cameras_in_stack = world->m_CameraStack.Size(); |
| 110 | for (uint32_t i = 0; i < num_cameras_in_stack; ++i) |
| 111 | { |
| 112 | if (world->m_CameraStack[i] == camera) |
| 113 | { |
| 114 | found = true; |
| 115 | } |
| 116 | |
| 117 | // If the camera is in the stack, we move all other entries one step to the left |
| 118 | if (found && i < num_cameras_in_stack - 1) |
| 119 | { |
| 120 | world->m_CameraStack[i] = world->m_CameraStack[i + 1]; |
| 121 | } |
| 122 | } |
| 123 | if (found) |
| 124 | { |
| 125 | world->m_CameraStack.Pop(); |
| 126 | } |
| 127 | } |
| 128 | |
| 129 | static void CameraStackPush(CameraWorld* world, CameraComponent* camera) |
| 130 | { |
no test coverage detected