MCPcopy Create free account
hub / github.com/DescentDevelopers/Descent3 / FramePop

Function FramePop

Descent3/game.cpp:1167–1199  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1165}
1166
1167void FramePop(int *x1, int *y1, int *x2, int *y2, bool *clear) {
1168 if (!FrameStackRoot || !FrameStackPtr) {
1169 mprintf(0, "StartFrame/EndFrame mismatch\n");
1170 Int3();
1171 *clear = true;
1172 *x1 = Game_window_x;
1173 *y1 = Game_window_y;
1174 *x2 = *x1 + Game_window_w;
1175 *y2 = *y1 + Game_window_h;
1176 return;
1177 }
1178
1179 tFrameStackFrame *frame = FrameStackPtr;
1180
1181 *x1 = FrameStackPtr->x1;
1182 *x2 = FrameStackPtr->x2;
1183 *y1 = FrameStackPtr->y1;
1184 *y2 = FrameStackPtr->y2;
1185 *clear = FrameStackPtr->clear;
1186
1187 if (frame == FrameStackRoot) {
1188 // we're popping off the root
1189 // DAJ mem_free(FrameStackRoot);
1190 FrameStackRoot = NULL;
1191 FrameStackPtr = NULL;
1192 } else {
1193 // we're just going back a frame, but still have a stack
1194 FrameStackPtr = FrameStackPtr->prev; // pop back a frame
1195 FrameStackPtr->next = NULL;
1196 // DAJ mem_free(frame);
1197 }
1198 FrameStackDepth--;
1199}
1200
1201// peeks at the current frame
1202// returns false if there is no current frame

Callers 1

EndFrameFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected