Advertisement
Dimitri_UA

SA's Idle func... [DK]

Aug 1st, 2013
391
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.         int __stdcall Idle()
  2. 2   {
  3. 3       __int16 v0; // bp@0
  4. 4       unsigned int v1; // esi@2
  5. 5       unsigned int v2; // esi@3
  6. 6       int result; // eax@3
  7. 7       signed __int16 v4; // ax@7
  8. 8       float viewWindow; // ST1C_4@15
  9. 9       signed __int16 v6; // [sp-10h] [bp-20h]@7
  10. 10      signed __int16 v7; // [sp-Ch] [bp-1Ch]@7
  11. 11      signed __int16 v8; // [sp-8h] [bp-18h]@7
  12. 12      signed __int16 v9; // [sp-4h] [bp-14h]@7
  13. 13      signed __int16 v10; // [sp+0h] [bp-10h]@7
  14. 14      __int16 v11; // [sp+4h] [bp-Ch]@7
  15. 15      RwV2D screenc; // [sp+8h] [bp-8h]@6
  16. 16      int v13; // [sp+14h] [bp+4h]@0
  17. 17 
  18. 18      CTimer::GetCurrentTimeInCycles();
  19. 19      CTimer::GetCyclesPerMillisecond();
  20. 20      do
  21. 21        v1 = CTimer::GetCurrentTimeInCycles();
  22. 22      while ( v1 / CTimer::GetCyclesPerMillisecond() - _lastTickTime < 14 );
  23. 23      v2 = CTimer::GetCurrentTimeInCycles();
  24. 24      _lastTickTime = v2 / CTimer::GetCyclesPerMillisecond();
  25. 25      CTimer::Update();
  26. 26      CSprite2d::InitPerFrame();
  27. 27      CFont::InitPerFrame();
  28. 28      CPointLights::NumLights = 0;
  29. 29      CGame::Process();
  30. 30      cDMAudio::Service(&DMAudio);
  31. 31      SetLightsWithTimeOfDayColour(Scene.m_pRwWorld);
  32. 32      result = v13;
  33. 33      if ( !v13 )
  34. 34        return result;
  35. 35      if ( FrontEndMenuManager.m_bMenuActive || CCamera::GetScreenFadeStatus(&TheCamera) == 2 )
  36. 36      {
  37. 37        CDraw::CalculateAspectRatio();
  38. 38        viewWindow = tan(CDraw::ms_fFOV * 0.0087266462);
  39. 39        CameraSize(Scene.m_pRwCamera, 0, viewWindow, CDraw::ms_fAspectRatio);
  40. 40        CVisibilityPlugins::SetRenderWareCamera(Scene.m_pRwCamera);
  41. 41        RwCameraClear(Scene.m_pRwCamera, &gColourTop, 2);
  42. 42        result = RsCameraBeginUpdate();
  43. 43        if ( !result )
  44. 44          return result;
  45. 45      }
  46. 46      else
  47. 47      {
  48. 48        screenc.x = (double)RsGlobal.MaximumWidth * 0.5;
  49. 49        screenc.y = (double)RsGlobal.MaximumHeight * 0.5;
  50. 50        RsMouseSetPos(&screenc);
  51. 51        CRenderer::ConstructRenderList(v0);
  52. 52        CRenderer::PreRender();
  53. 53        ProcessPedTasks();
  54. 54        CShadowManager::CreateShadows(&ShadowManager);
  55. 55        RenderSceneGeometryToMirror();
  56. 56        if ( CWeather::LightningFlash )
  57. 57        {
  58. 58          v4 = 255;
  59. 59          v11 = 255;
  60. 60          v10 = 255;
  61. 61          v9 = 255;
  62. 62          v8 = 255;
  63. 63          v7 = 255;
  64. 64          CTimeCycle::m_nCurrentSkyBottomRed = 255;
  65. 65          CTimeCycle::m_nCurrentSkyBottomGreen = 255;
  66. 66          CTimeCycle::m_nCurrentSkyBottomBlue = 255;
  67. 67          v6 = 255;
  68. 68        }
  69. 69        else
  70. 70        {
  71. 71          v11 = 255;
  72. 72          v10 = CTimeCycle::m_nCurrentSkyBottomBlue;
  73. 73          v9 = CTimeCycle::m_nCurrentSkyBottomGreen;
  74. 74          v8 = CTimeCycle::m_nCurrentSkyBottomRed;
  75. 75          v4 = CTimeCycle::m_nCurrentSkyTopRed;
  76. 76          v7 = CTimeCycle::m_nCurrentSkyTopBlue;
  77. 77          v6 = CTimeCycle::m_nCurrentSkyTopGreen;
  78. 78        }
  79. 79        result = DoRWStuffStartOfFrame_Horizon(v4, v6, v7, v8, v9, v10, v11);
  80. 80        if ( !(_BYTE)result )
  81. 81          return result;
  82. 82        DefinedState();
  83. 83        RwCameraSetFarClipPlane(Scene.m_pRwCamera, CTimeCycle::m_fCurrentFarClip);
  84. 84        Scene.m_pRwCamera->fogPlane = CTimeCycle::m_fCurrentFogStart;
  85. 85        RenderMirrors();
  86. 86        RenderScene();
  87. 87        RenderPedWeapons();
  88. 88        sub_53E8D0((struct_this *)&Unk);
  89. 89        RenderEffects();
  90. 90        if ( (!TheCamera.m_BlurType || TheCamera.m_BlurType == 2) && TheCamera.m_ScreenReductionPercentage > 0.0 )
  91. 91          CCamera::SetMotionBlurAlpha(&TheCamera, 150);
  92. 92        CCamera::RenderMotionBlur(&TheCamera);
  93. 93        Render2dStuff();
  94. 94      }
  95. 95      if ( FrontEndMenuManager.m_bMenuActive )
  96. 96        CMenuManager::DrawFrontEnd(&FrontEndMenuManager);
  97. 97      RwEngineInstance->dOpenDevice.fpRenderStateSet(rwRENDERSTATETEXTURERASTER, 0);
  98. 98      DoFade();
  99. 99      sub_58D490();
  100. 100     CMessages::Display(0);
  101. 101     CFont::DrawFonts();
  102. 102     if ( CreditsOn )
  103. 103     {
  104. 104       if ( !FrontEndMenuManager.m_bMenuActive )
  105. 105         CCredits::Render();
  106. 106       if ( CreditsOn )
  107. 107       {
  108. 108         if ( !FrontEndMenuManager.m_bMenuActive )
  109. 109           CCredits::Render();
  110. 110       }
  111. 111     }
  112. 112     CDebug::DebugDisplayTextBuffer();
  113. 113     FlushObrsPrintfs();
  114. 114     RwCameraEndUpdate(Scene.m_pRwCamera);
  115. 115     return RsCameraShowRaster(Scene.m_pRwCamera);
  116. 116 }
Advertisement
Advertisement
Advertisement
RAW Paste Data Copied
Advertisement