2020-12-02 16:19:16 -05:00
|
|
|
#pragma once
|
2021-10-24 18:08:00 -04:00
|
|
|
#include "tchar.h"
|
2021-10-25 10:03:27 -04:00
|
|
|
#include "pdh.h"
|
2021-06-15 09:30:48 -04:00
|
|
|
|
2022-01-23 07:30:28 -05:00
|
|
|
/*
|
|
|
|
* Contains utility functions
|
|
|
|
*/
|
2020-12-02 16:19:16 -05:00
|
|
|
class Util
|
|
|
|
{
|
2022-01-04 17:33:07 -05:00
|
|
|
private:
|
2022-01-07 03:18:00 -05:00
|
|
|
static inline PDH_HQUERY cpuQuery;
|
|
|
|
static inline PDH_HCOUNTER cpuTotal;
|
|
|
|
static inline ULARGE_INTEGER lastCPU, lastSysCPU, lastUserCPU;
|
|
|
|
static inline int numProcessors;
|
|
|
|
static inline HANDLE self;
|
2022-01-04 17:33:07 -05:00
|
|
|
|
2020-12-02 16:19:16 -05:00
|
|
|
public:
|
2022-01-07 03:18:00 -05:00
|
|
|
Util() = delete;
|
|
|
|
Util(Util&) = delete;
|
2021-10-25 10:03:27 -04:00
|
|
|
|
2021-08-06 11:53:18 -04:00
|
|
|
#ifdef GTASA
|
2022-01-07 03:18:00 -05:00
|
|
|
static int GetLargestGangInZone();
|
2022-01-23 07:30:28 -05:00
|
|
|
static void ClearCharTasksVehCheck(CPed* ped);
|
|
|
|
static bool IsOnMission();
|
2021-08-06 11:53:18 -04:00
|
|
|
#endif
|
2022-01-23 07:30:28 -05:00
|
|
|
|
|
|
|
static void FlipVehicle(CVehicle *pVeh);
|
|
|
|
static void FixVehicle(CVehicle *pVeh);
|
2022-01-07 03:18:00 -05:00
|
|
|
static CPed* GetClosestPed();
|
|
|
|
static CVehicle* GetClosestVehicle();
|
|
|
|
static void GetCPUUsageInit();
|
|
|
|
static double GetCurrentCPUUsage();
|
|
|
|
static std::string GetLocationName(CVector* pos);
|
|
|
|
static bool IsOnCutscene();
|
2022-01-23 07:30:28 -05:00
|
|
|
static bool IsInVehicle(CPed *pPed = FindPlayerPed());
|
2022-01-07 03:18:00 -05:00
|
|
|
static void RainbowValues(int& r, int& g, int& b, float speed);
|
2022-01-23 07:30:28 -05:00
|
|
|
static void SetCarForwardSpeed(CVehicle *pVeh, float speed);
|
2020-12-02 16:19:16 -05:00
|
|
|
};
|