diff --git a/src/xenia/profiling.cc b/src/xenia/profiling.cc index b72eba457..ce3a4ece0 100644 --- a/src/xenia/profiling.cc +++ b/src/xenia/profiling.cc @@ -15,9 +15,11 @@ namespace xe { std::unique_ptr Profiler::display_ = nullptr; +#if XE_OPTION_PROFILING + void Profiler::Initialize() { MicroProfileInit(); - MicroProfileSetDisplayMode(2); + MicroProfileSetDisplayMode(1); } void Profiler::Dump() { @@ -99,8 +101,29 @@ void Profiler::Present() { display_->End(); } +#else + +void Profiler::Initialize() {} +void Profiler::Dump() {} +void Profiler::Shutdown() {} +uint32_t Profiler::GetColor(const char* str) { return 0; } +void Profiler::ThreadEnter(const char* name) {} +void Profiler::ThreadExit() {} +bool Profiler::OnKeyDown(int key_code) { return false; } +bool Profiler::OnKeyUp(int key_code) { return false; } +void Profiler::OnMouseDown(bool left_button, bool right_button) {} +void Profiler::OnMouseUp() {} +void Profiler::OnMouseMove(int x, int y) {} +void Profiler::OnMouseWheel(int x, int y, int dy) {} +void Profiler::set_display(std::unique_ptr display) {} +void Profiler::Present() {} + +#endif // XE_OPTION_PROFILING + } // namespace xe +#if XE_OPTION_PROFILING + uint32_t MicroProfileGpuInsertTimeStamp() { return 0; } @@ -143,3 +166,5 @@ void MicroProfileDrawText(int nX, int nY, uint32_t nColor, const char* pText, ui } display->DrawText(nX, nY, nColor, pText, nLen); } + +#endif // XE_OPTION_PROFILING diff --git a/src/xenia/profiling.h b/src/xenia/profiling.h index bf66c68a5..30ab996ac 100644 --- a/src/xenia/profiling.h +++ b/src/xenia/profiling.h @@ -81,24 +81,34 @@ namespace xe { #else -#define DEFINE_profile_cpu(name, group_name, scope_name, color) -#define DEFINE_profile_gpu(name, group_name, scope_name, color) +#define DEFINE_profile_cpu(name, group_name, scope_name) +#define DEFINE_profile_gpu(name, group_name, scope_name) #define DECLARE_profile_cpu(name) #define DECLARE_profile_gpu(name) #define SCOPE_profile_cpu(name) do {} while (false) -#define SCOPE_profile_cpu_i(group_name, scope_name, color) do {} while (false) +#define SCOPE_profile_cpu_f(name) do {} while (false) +#define SCOPE_profile_cpu_i(group_name, scope_name) do {} while (false) #define SCOPE_profile_gpu(name) do {} while (false) -#define SCOPE_profile_gpu_i(group_name, scope_name, color) do {} while (false) +#define SCOPE_profile_gpu_f(name) do {} while (false) +#define SCOPE_profile_gpu_i(group_name, scope_name) do {} while (false) #define COUNT_profile_cpu(name, count) do {} while (false) #define COUNT_profile_gpu(name, count) do {} while (false) +#define MICROPROFILE_TEXT_WIDTH 1 +#define MICROPROFILE_TEXT_HEIGHT 1 + #endif // XE_OPTION_PROFILING class ProfilerDisplay { public: enum BoxType { +#if XE_OPTION_PROFILING BOX_TYPE_BAR = MicroProfileBoxTypeBar, BOX_TYPE_FLAT = MicroProfileBoxTypeFlat, +#else + BOX_TYPE_BAR, + BOX_TYPE_FLAT, +#endif // XE_OPTION_PROFILING }; virtual uint32_t width() const = 0;