MCPcopy Create free account
hub / github.com/SpecialKO/SpecialK / SK_Unity_EndFrame

Function SK_Unity_EndFrame

src/plugins/unity.cpp:1024–1066  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1022} SK_Unity_il2cppClasses;
1023
1024void
1025__stdcall
1026SK_Unity_EndFrame (void)
1027{
1028 static float last_fps = 0.0f;
1029
1030 bool forced_update =
1031 (SK_Unity_Cfg.fixed_delta_auto_sync) && last_fps != __target_fps_now && __target_fps_now > 0.0f;
1032
1033 // Stupid hack to ensure this is applied initially; may take many frames.
1034 if (SK_GetFramesDrawn () >= 15 && (forced_update || SK_GetFramesDrawn () < 1500))
1035 {
1036 static DWORD
1037 dwLastForced = 0;
1038 if (dwLastForced < SK::ControlPanel::current_time - 2500UL || forced_update)
1039 { dwLastForced = SK::ControlPanel::current_time;
1040 SK_RunOnce (SK_Unity_InitFixedDeltaTimeOverride ());
1041
1042 if (forced_update)
1043 {
1044 SK_Unity_Cfg.time_fixed_delta_time = 1.0f/__target_fps_now;
1045 }
1046
1047 if (SK_Unity_Cfg.time_fixed_delta_time != 0.0f &&
1048 SK_Unity_Cfg.time_fixed_delta_time != SK_Unity_OriginalFixedDeltaTime)
1049 {
1050 if (SK_Unity_Cfg.fixed_delta_auto_sync) last_fps = __target_fps_now;
1051 SK_Unity_SetFixedDeltaTime (SK_Unity_Cfg.time_fixed_delta_time);
1052 }
1053
1054 if (SK_Unity_Cfg.gamepad_polling_hz != 60.0f)
1055 {
1056 SK_Unity_SetInputPollingFreq (SK_Unity_Cfg.gamepad_polling_hz);
1057 }
1058 }
1059 }
1060
1061 if (__target_fps_now > 0.0f)
1062 {
1063 void SK_Unity_UpdateTimingOverrides (void);
1064 SK_Unity_UpdateTimingOverrides ( );
1065 }
1066}
1067
1068HRESULT
1069STDMETHODCALLTYPE

Callers

nothing calls this directly

Calls 5

SK_RunOnceFunction · 0.85

Tested by

no test coverage detected