Add PSP support
This commit is contained in:
parent
1509b9bd0e
commit
9f8dcae52a
@ -21,21 +21,7 @@
|
||||
|
||||
#include <bounce/common/settings.h>
|
||||
|
||||
#define B3_WINDOWS 1
|
||||
#define B3_MAC 2
|
||||
#define B3_UNIX 3
|
||||
|
||||
#if defined (_WIN32)
|
||||
#define B3_PLATFORM B3_WINDOWS
|
||||
#elif defined( __APPLE__ )
|
||||
#define B3_PLATFORM B3_MAC
|
||||
#elif defined(_arch_dreamcast)
|
||||
#define B3_PLATFORM B3_DREAMCAST
|
||||
#else
|
||||
#define B3_PLATFORM B3_UNIX
|
||||
#endif
|
||||
|
||||
#if B3_PLATFORM == B3_WINDOWS
|
||||
#if defined(__WIN32__)
|
||||
|
||||
#include <windows.h>
|
||||
|
||||
@ -101,7 +87,7 @@ private:
|
||||
float64 m_t;
|
||||
};
|
||||
|
||||
#elif B3_PLATFORM == B3_MAC
|
||||
#elif defined(__APPLE__)
|
||||
|
||||
#include <mach/mach_time.h>
|
||||
|
||||
@ -159,7 +145,7 @@ private:
|
||||
double m_t;
|
||||
};
|
||||
|
||||
#elif B3_PLATFORM == B3_DREAMCAST
|
||||
#elif defined(_arch_dreamcast)
|
||||
|
||||
#include <kos.h>
|
||||
|
||||
@ -207,6 +193,54 @@ private:
|
||||
double m_t;
|
||||
};
|
||||
|
||||
#elif defined(__PSP__)
|
||||
|
||||
#include <pspthreadman.h>
|
||||
|
||||
class b3Time
|
||||
{
|
||||
public:
|
||||
b3Time()
|
||||
{
|
||||
m_c0 = sceKernelGetSystemTimeLow();
|
||||
m_t0 = 0.0;
|
||||
m_t = 0.0;
|
||||
}
|
||||
|
||||
// Get the accumulated time in miliseconds from this timer.
|
||||
double GetCurrentMilis() const
|
||||
{
|
||||
return m_t;
|
||||
}
|
||||
|
||||
// Get the elapsed time since this timer was updated.
|
||||
double GetElapsedMilis() const
|
||||
{
|
||||
return m_t - m_t0;
|
||||
}
|
||||
|
||||
// Add the elapsed time since this function was called to this timer.
|
||||
void Update()
|
||||
{
|
||||
uint64_t c = sceKernelGetSystemTimeLow();
|
||||
double dt = double(c - m_c0) * 0.000001;
|
||||
m_c0 = c;
|
||||
Add(dt);
|
||||
}
|
||||
|
||||
// Add time to this timer.
|
||||
void Add(double dt)
|
||||
{
|
||||
m_t0 = m_t;
|
||||
m_t += dt;
|
||||
}
|
||||
|
||||
private:
|
||||
uint64_t m_c0;
|
||||
double m_t0;
|
||||
double m_t;
|
||||
};
|
||||
|
||||
#else
|
||||
|
||||
#include <time.h>
|
||||
|
Loading…
x
Reference in New Issue
Block a user