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

Function rtp_RecordFrame

rtperformance/rtperformance.cpp:214–240  ·  view source on GitHub ↗

void rtp_RecordFrame Calling this will record the data of the frame into the internal log, and prepare for the next frame */

Source from the content-addressed store, hash-verified

212 the next frame
213*/
214void rtp_RecordFrame() {
215#ifdef USE_RTP
216 if (Runtime_performance_enabled) {
217 // do our saving of information
218 // --------------------------------
219
220 RTP_SingleFrame.frame_num = Runtime_performance_frame_counter; // save the frame num
221
222 // Copy everything into the buffer, and advance the buffer
223 memcpy(&RTP_FrameBuffer[Runtime_performance_counter], &RTP_SingleFrame, sizeof(tRTFrameInfo));
224
225 Runtime_performance_counter++;
226
227 if (Runtime_performance_counter >= MAX_RTP_SAMPLES) {
228 // uh oh, we hit the end of our samples, flush the buffer and stop
229 rtp_StopLog();
230 }
231
232 // reset our global struct to zero everything out
233 // ------------------------------------------------
234 memset(&RTP_SingleFrame, 0, sizeof(tRTFrameInfo));
235 }
236
237 // Update the frame counter to the next frame, always
238 Runtime_performance_frame_counter++;
239#endif
240}
241
242// External Functions
243// -----------------------------

Callers 1

GameFrameFunction · 0.85

Calls 1

rtp_StopLogFunction · 0.85

Tested by

no test coverage detected