EmulatorComponent.cpp 555 B

12345678910111213141516171819202122232425262728293031323334
  1. #include "EmulatorComponent.h"
  2. #include "../Constants.h"
  3. namespace TLAC::Components
  4. {
  5. EmulatorComponent::EmulatorComponent()
  6. {
  7. }
  8. EmulatorComponent::~EmulatorComponent()
  9. {
  10. }
  11. void EmulatorComponent::SetElapsedTime(float value)
  12. {
  13. elapsedTime = value;
  14. }
  15. float EmulatorComponent::GetElapsedTime()
  16. {
  17. return elapsedTime == 0.0f ? (1000.0f / 60.0f) : elapsedTime;
  18. }
  19. float EmulatorComponent::GetFrameRate()
  20. {
  21. return 1000.0f / GetElapsedTime();
  22. }
  23. float EmulatorComponent::GetGameFrameRate()
  24. {
  25. return *(float*)FRAME_RATE_ADDRESS;
  26. }
  27. }