Complete disaster-recovery snapshot: engine/game source, game data assets, VC6 toolchain + DX SDKs, build outputs, deployed game, and _UNUSED archive. Large binaries in Git LFS; text preserved byte-for-byte (core.autocrlf=false, no eol attributes). See RECOVERY.md for the one-clone rebuild procedure.
54 lines
953 B
C++
54 lines
953 B
C++
|
|
#pragma once
|
|
#ifndef ABLPROFILER_HPP
|
|
#define ABLPROFILER_HPP
|
|
|
|
#pragma warning (push)
|
|
#include <stlport\map>
|
|
#include <stlport\string>
|
|
#pragma warning (pop)
|
|
|
|
|
|
|
|
namespace ABL
|
|
{
|
|
class Profiler
|
|
{
|
|
public:
|
|
Profiler();
|
|
~Profiler();
|
|
|
|
void SetActive(bool active);
|
|
bool GetActive() const;
|
|
|
|
void NotifyFunctionCalled(double time,
|
|
const char* function_name,
|
|
const char* module_name);
|
|
|
|
static Profiler* Instance();
|
|
|
|
private:
|
|
struct CallInfo
|
|
{
|
|
CallInfo();
|
|
double total_time;
|
|
int total_calls;
|
|
};
|
|
|
|
bool m_Active;
|
|
|
|
typedef std::map<std::string,CallInfo> call_info_map;
|
|
|
|
call_info_map m_PerFunctionTiming;
|
|
call_info_map m_PerModuleTiming;
|
|
|
|
void AddTimeToCallInfoMap(double time, const char* name, call_info_map& m);
|
|
void UpdateCallInfoMap(call_info_map& m);
|
|
void SpewIt() const;
|
|
|
|
static Profiler* m_Instance;
|
|
};
|
|
};
|
|
|
|
|
|
#endif // ABLPROFILER_HPP
|