From 20c0960cc60b1e8713d6784a878e9877d5453562 Mon Sep 17 00:00:00 2001 From: georgemoralis Date: Thu, 29 Jun 2023 13:17:05 +0300 Subject: [PATCH] dummy timer class --- CMakeLists.txt | 2 +- src/Lib/Timer.cpp | 42 ++++++++++++++++++++++++++++++++++++++++++ src/Lib/Timer.h | 34 ++++++++++++++++++++++++++++++++++ 3 files changed, 77 insertions(+), 1 deletion(-) create mode 100644 src/Lib/Timer.cpp create mode 100644 src/Lib/Timer.h diff --git a/CMakeLists.txt b/CMakeLists.txt index c656aadc..7ee1da38 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -34,7 +34,7 @@ add_executable(shadps4 src/Core/Memory.h src/Core/PS4/Linker.cpp src/Core/PS4/Linker.h - "src/Util/Singleton.h" "src/Util/Disassembler.cpp" "src/Util/Disassembler.h" "src/Util/StringUtil.h" "src/Core/PS4/Util/aerolib.h" "src/Core/PS4/Loader/SymbolsResolver.h" "src/Core/PS4/Loader/SymbolsResolver.cpp" "src/Core/PS4/HLE/Libs.cpp" "src/Core/PS4/HLE/Libs.h" "src/Core/PS4/HLE/LibC.cpp" "src/Core/PS4/HLE/LibC.h") + "src/Util/Singleton.h" "src/Util/Disassembler.cpp" "src/Util/Disassembler.h" "src/Util/StringUtil.h" "src/Core/PS4/Util/aerolib.h" "src/Core/PS4/Loader/SymbolsResolver.h" "src/Core/PS4/Loader/SymbolsResolver.cpp" "src/Core/PS4/HLE/Libs.cpp" "src/Core/PS4/HLE/Libs.h" "src/Core/PS4/HLE/LibC.cpp" "src/Core/PS4/HLE/LibC.h" "src/Lib/Timer.cpp" "src/Lib/Timer.h") find_package(OpenGL REQUIRED) diff --git a/src/Lib/Timer.cpp b/src/Lib/Timer.cpp new file mode 100644 index 00000000..e07ff73d --- /dev/null +++ b/src/Lib/Timer.cpp @@ -0,0 +1,42 @@ +#include "Timer.h" + +Lib::Timer::Timer() +{ +} + +void Lib::Timer::Start() +{ +} + +void Lib::Timer::Pause() +{ +} + +void Lib::Timer::Resume() +{ +} + +bool Lib::Timer::IsPaused() const +{ + return false; +} + +double Lib::Timer::GetTimeMsec() const +{ + return 0.0; +} + +double Lib::Timer::GetTimeSec() const +{ + return 0.0; +} + +u64 Lib::Timer::GetTicks() const +{ + return u64(); +} + +u64 Lib::Timer::GetFrequency() const +{ + return u64(); +} diff --git a/src/Lib/Timer.h b/src/Lib/Timer.h new file mode 100644 index 00000000..5066d2e8 --- /dev/null +++ b/src/Lib/Timer.h @@ -0,0 +1,34 @@ +#pragma once + +#include "../Types.h" + +namespace Lib { + class Timer final + { + public: + Timer(); + ~Timer() = default; + + void Start(); + void Pause(); + void Resume(); + bool IsPaused() const; + + double GetTimeMsec() const;// return time in milliseconds + double GetTimeSec() const;// return time in seconds + u64 GetTicks() const;// return time in ticks + u64 GetFrequency() const;// return ticks frequency + + public: + Timer(const Timer&) = delete; + Timer& operator=(const Timer&) = delete; + Timer(Timer&&) = delete; + Timer& operator=(Timer&&) = delete; + + private: + bool m_is_timer_paused = true; + u64 m_Frequency = 0; + u64 m_StartTime = 0; + u64 m_PauseTime = 0; + }; +} \ No newline at end of file