Advertisement
fastman92

GTA VC renderTimerResume

Dec 20th, 2014
221
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 2.76 KB | None | 0 0
  1. __int16 __cdecl renderTimerResume()
  2. {
  3.   long double diff; // fst7@2
  4.   long double v1; // fst6@5
  5.   float v2; // ST0C_4@8
  6.   int v3; // eax@9
  7.   long double v4; // fst6@9
  8.   __int16 v5; // fps@13
  9.   char v6; // c0@13
  10.   char v7; // c2@13
  11.   char v8; // c3@13
  12.   __int16 result; // ax@13
  13.   long double v10; // fst6@20
  14.   LARGE_INTEGER PerformanceCount; // [sp+10h] [bp-Ch]@2
  15.  
  16.   renderTimerPaused = currentTime;
  17.   if ( (long double)(unsigned int)performanceFrequency == dbl_691020 )
  18.   {
  19.     QueryPerformanceCounter(&PerformanceCount);
  20.     diff = (long double)((PerformanceCount.s.LowPart - previousMicrosecondCount.s.LowPart) & 0x7FFFFFFF);
  21.     if ( !PauseRender && !cd_not_in_drive )
  22.       diff = diff * fGameSpeed;
  23.     previousMicrosecondCount = PerformanceCount;
  24.     v1 = diff / (long double)(unsigned int)performanceFrequency;
  25.     TimesAfrequencyHasPassed = (signed __int64)((long double)(unsigned int)TimesAfrequencyHasPassed + v1);
  26.     if ( PauseRender || cd_not_in_drive )
  27.     {
  28.       LODWORD(fProcessingTimer) = 0;
  29.     }
  30.     else
  31.     {
  32.       currentTime = (signed __int64)((long double)currentTime + v1);
  33.       dword_A0D894 = (signed __int64)((long double)(unsigned int)dword_A0D894 + v1);
  34.       v2 = diff / (long double)(unsigned int)performanceFrequency * dbl_691028;
  35.       fProcessingTimer = v2;
  36.     }
  37.   }
  38.   else
  39.   {
  40.     v3 = sub_6030F0();
  41.     v4 = (long double)(unsigned int)(v3 - dword_A10680) * fGameSpeed;
  42.     dword_A10680 = v3;
  43.     TimesAfrequencyHasPassed = (signed __int64)((long double)(unsigned int)TimesAfrequencyHasPassed + v4);
  44.     if ( PauseRender || cd_not_in_drive )
  45.     {
  46.       LODWORD(fProcessingTimer) = 0;
  47.     }
  48.     else
  49.     {
  50.       currentTime = (signed __int64)((long double)currentTime + v4);
  51.       dword_A0D894 = (signed __int64)((long double)(unsigned int)dword_A0D894 + v4);
  52.       fProcessingTimer = v4 * flt_691030 * flt_691034;
  53.     }
  54.   }
  55.   UNDEF(v5);
  56.   v6 = fProcessingTimer < (long double)flt_691038;
  57.   v7 = 0;
  58.   v8 = fProcessingTimer == flt_691038;
  59.   result = __PAIR__(HIBYTE(v5), (unsigned __int8)v5) & 0x5FF;
  60.   if ( fProcessingTimer >= (long double)flt_691038 && !PauseRender && !cd_not_in_drive && !byte_A10ADD )
  61.     LODWORD(fProcessingTimer) = 1008981770;
  62.   flt_9753A8 = fProcessingTimer;
  63.   if ( word_A10936 != 2 )
  64.   {
  65.     v10 = fProcessingTimer < (long double)flt_69103C ? flt_69103C : fProcessingTimer;
  66.     result = currentTime - renderTimerPaused;
  67.     fProcessingTimer = v10;
  68.     if ( currentTime - renderTimerPaused > 0x3C )
  69.     {
  70.       result = renderTimerPaused + 60;
  71.       currentTime = renderTimerPaused + 60;
  72.     }
  73.   }
  74.   if ( slowMotion == 1 )
  75.   {
  76.     LODWORD(fProcessingTimer) = 0x3F800000u;
  77.     result = renderTimerPaused + 16;
  78.     currentTime = renderTimerPaused + 16;
  79.   }
  80.   ++unk_Timer;
  81.   return result;
  82. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement