MCPcopy Create free account
hub / github.com/defold/defold / CameraStackRemove

Function CameraStackRemove

engine/gamesys/src/gamesys/components/comp_camera.cpp:106–127  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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 {

Callers 3

CameraStackPushFunction · 0.85
CompCameraDestroyFunction · 0.85
CompCameraOnMessageFunction · 0.85

Calls 2

SizeMethod · 0.45
PopMethod · 0.45

Tested by

no test coverage detected