mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Add support for Android 2.3+
There have been plenty of ppl involved in creating this version. I don't wanna mention names as I'm sure I'd forget someone so I just tell where help has been done: - The partial android versions done by various ppl - Testing on different android devices - reviewing code (especially the in core changes) - testing controls - reviewing texts A big thank you to everyone helping this to be completed!
This commit is contained in:
parent
ff36071d93
commit
1cc40c0a7c
66 changed files with 4425 additions and 162 deletions
|
@ -53,12 +53,12 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
|
||||
#ifdef _WIN32
|
||||
#include <windows.h>
|
||||
|
||||
|
||||
#define sleep_ms(x) Sleep(x)
|
||||
#else
|
||||
#include <unistd.h>
|
||||
#include <stdint.h> //for uintptr_t
|
||||
|
||||
|
||||
#if (defined(linux) || defined(__linux)) && !defined(_GNU_SOURCE)
|
||||
#define _GNU_SOURCE
|
||||
#endif
|
||||
|
@ -79,7 +79,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
#endif
|
||||
|
||||
#define sleep_ms(x) usleep(x*1000)
|
||||
|
||||
|
||||
#define THREAD_PRIORITY_LOWEST 0
|
||||
#define THREAD_PRIORITY_BELOW_NORMAL 1
|
||||
#define THREAD_PRIORITY_NORMAL 2
|
||||
|
@ -197,17 +197,17 @@ void initIrrlicht(irr::IrrlichtDevice * );
|
|||
#define _WIN32_WINNT 0x0501
|
||||
#endif
|
||||
#include <windows.h>
|
||||
|
||||
|
||||
inline u32 getTimeS()
|
||||
{
|
||||
return GetTickCount() / 1000;
|
||||
}
|
||||
|
||||
|
||||
inline u32 getTimeMs()
|
||||
{
|
||||
return GetTickCount();
|
||||
}
|
||||
|
||||
|
||||
inline u32 getTimeUs()
|
||||
{
|
||||
LARGE_INTEGER freq, t;
|
||||
|
@ -215,7 +215,7 @@ void initIrrlicht(irr::IrrlichtDevice * );
|
|||
QueryPerformanceCounter(&t);
|
||||
return (double)(t.QuadPart) / ((double)(freq.QuadPart) / 1000000.0);
|
||||
}
|
||||
|
||||
|
||||
inline u32 getTimeNs()
|
||||
{
|
||||
LARGE_INTEGER freq, t;
|
||||
|
@ -223,7 +223,7 @@ void initIrrlicht(irr::IrrlichtDevice * );
|
|||
QueryPerformanceCounter(&t);
|
||||
return (double)(t.QuadPart) / ((double)(freq.QuadPart) / 1000000000.0);
|
||||
}
|
||||
|
||||
|
||||
#else // Posix
|
||||
#include <sys/time.h>
|
||||
#include <time.h>
|
||||
|
@ -238,21 +238,21 @@ void initIrrlicht(irr::IrrlichtDevice * );
|
|||
gettimeofday(&tv, NULL);
|
||||
return tv.tv_sec;
|
||||
}
|
||||
|
||||
|
||||
inline u32 getTimeMs()
|
||||
{
|
||||
struct timeval tv;
|
||||
gettimeofday(&tv, NULL);
|
||||
return tv.tv_sec * 1000 + tv.tv_usec / 1000;
|
||||
}
|
||||
|
||||
|
||||
inline u32 getTimeUs()
|
||||
{
|
||||
struct timeval tv;
|
||||
gettimeofday(&tv, NULL);
|
||||
return tv.tv_sec * 1000000 + tv.tv_usec;
|
||||
}
|
||||
|
||||
|
||||
inline u32 getTimeNs()
|
||||
{
|
||||
struct timespec ts;
|
||||
|
@ -270,7 +270,7 @@ void initIrrlicht(irr::IrrlichtDevice * );
|
|||
#endif
|
||||
return ts.tv_sec * 1000000000 + ts.tv_nsec;
|
||||
}
|
||||
|
||||
|
||||
/*#include <sys/timeb.h>
|
||||
inline u32 getTimeMs()
|
||||
{
|
||||
|
@ -373,5 +373,9 @@ v2u32 getWindowSize();
|
|||
|
||||
} // namespace porting
|
||||
|
||||
#ifdef __ANDROID__
|
||||
#include "porting_android.h"
|
||||
#endif
|
||||
|
||||
#endif // PORTING_HEADER
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue