]> git.lizzy.rs Git - dragonfireclient.git/blobdiff - src/porting.h
Make scrollbar scale according to DPI and scaling factor
[dragonfireclient.git] / src / porting.h
index b5a5d00f284120184e4cb1ffba0b53fb94181111..9be09da75d65bf396a00e1d933c038f1c7e5cffe 100644 (file)
@@ -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