#elif defined(_USE_QT)
#include <SDL.h>
#include <stdarg.h>
-# if defined(Q_OS_WIN32)
+# if defined(Q_OS_WIN32) || defined(Q_OS_WIN) || defined(Q_OS_CYGWIN)
# include <tchar.h>
# endif
# if defined(_USE_QT5)
# ifndef BOOL
typedef int BOOL;
# endif
-# ifndef Q_OS_WIN32
+# if !defined(Q_OS_WIN32) && !defined(Q_OS_WIN) && !defined(Q_OS_CYGWIN)
# ifndef BYTE
typedef uint8_t BYTE;
# endif
#endif
#if defined(_USE_AGAR) || defined(_USE_SDL) || defined(_USE_QT)
+# if defined(Q_OS_CYGWIN)
+# define stricmp(a,b) strcmp(a,b)
+# define strnicmp(a,b,n) strncmp(a,b,n)
+# endif
+# if defined(Q_OS_WIN32) || defined(Q_OS_WIN) || defined(Q_OS_CYGWIN)
-# if defined(Q_OS_WIN32)
typedef char _TCHAR;
# endif
static int DeleteFile(_TCHAR *path)
#endif
#if defined(_USE_AGAR) || defined(_USE_SDL) || defined(_USE_QT)
-# if defined(Q_OS_WIN32)
+# if defined(Q_OS_WIN32) || defined(Q_OS_WIN) || defined(Q_OS_CYGWIN)
# include <tchar.h>
# endif
# define RGB_COLOR(r, g, b) (((uint32)(r) << 16) | ((uint32)(g) << 8) | ((uint32)(b) << 0))
typedef uint32 scrntype;
# elif defined(_RGBA888)
-//# if defined(USE_BITMAP)
-//# define RGB_COLOR(r, g, b) (((r | g | b) == 0x00) ? \
-// (((uint32)(r) << 16) | ((uint32)(g) << 8) | ((uint32)(b) << 0)) : \
-// (((uint32)(r) << 16) | ((uint32)(g) << 8) | ((uint32)(b) << 0) | (0x000000ff << 24)))
-//# else
# define RGB_COLOR(r, g, b) (((uint32)(r) << 16) | ((uint32)(g) << 8) | ((uint32)(b) << 0)) | ((uint32)0xff << 24)
//# endif
typedef uint32 scrntype;
# endif
//errno_t _tfopen_s(FILE** pFile, const _TCHAR *filename, const _TCHAR *mode);
errno_t _strcpy_s(char *strDestination, size_t numberOfElements, const char *strSource);
-# if !defined(Q_OS_WIN32)
+# if !defined(Q_OS_WIN32) && !defined(Q_OS_WIN) //&& !defined(Q_OS_CYGWIN)
errno_t _tcscpy_s(_TCHAR *strDestination, size_t numberOfElements, const _TCHAR *strSource);
_TCHAR *_tcstok_s(_TCHAR *strToken, const char *strDelimit, _TCHAR **context);
# endif
vm->key_up(VK_SHIFT);
# endif
// check l/r shift
-# if defined(Q_OS_WIN32) //
+# if defined(Q_OS_WIN) || defined(Q_OS_CYGWIN) //
if(!(GetAsyncKeyState(VK_LSHIFT) & 0x8000)) key_status[VK_LSHIFT] &= 0x7f;
if(!(GetAsyncKeyState(VK_RSHIFT) & 0x8000)) key_status[VK_RSHIFT] &= 0x7f;
# else
vm->key_up(VK_LSHIFT);
# endif
// check l/r shift
-# if defined(Q_OS_WIN32) //
+# if defined(Q_OS_WIN) || defined(Q_OS_CYGWIN) //
if(!(GetAsyncKeyState(VK_LSHIFT) & 0x8000)) key_status[VK_LSHIFT] &= 0x7f;
# else
if(!(GetAsyncKeyState(VK_LSHIFT, modkey_status) & 0x8000)) key_status[VK_LSHIFT] &= 0x7f;
vm->key_up(VK_RSHIFT);
# endif
// check l/r shift
-# if defined(Q_OS_WIN32) //
+# if defined(Q_OS_WIN) || defined(Q_OS_CYGWIN) //
if(!(GetAsyncKeyState(VK_RSHIFT) & 0x8000)) key_status[VK_RSHIFT] &= 0x7f;
# else
if(!(GetAsyncKeyState(VK_RSHIFT, modkey_status) & 0x8000)) key_status[VK_RSHIFT] &= 0x7f;
uint8 code = sym;
if(code == VK_SHIFT){
#ifndef USE_SHIFT_NUMPAD_KEY
-# if defined(Q_OS_WIN32) //
+# if defined(Q_OS_WIN) || defined(Q_OS_CYGWIN) //
if(GetAsyncKeyState(VK_SHIFT) & 0x8000) {
# else
if(GetAsyncKeyState(VK_SHIFT, modkey_status) & 0x8000) {
#endif
} else if(code == VK_LSHIFT){
#ifndef USE_SHIFT_NUMPAD_KEY
-# if defined(Q_OS_WIN32)
+# if defined(Q_OS_WIN) || defined(Q_OS_CYGWIN)
if(GetAsyncKeyState(VK_LSHIFT) & 0x8000) key_status[VK_LSHIFT] = 0x80;
# else
if(GetAsyncKeyState(VK_LSHIFT, modkey_status) & 0x8000) key_status[VK_LSHIFT] = 0x80;
#endif
} else if(code == VK_RSHIFT){
#ifndef USE_SHIFT_NUMPAD_KEY
-# if defined(Q_OS_WIN32)
+# if defined(Q_OS_WIN) || defined(Q_OS_CYGWIN)
if(GetAsyncKeyState(VK_RSHIFT) & 0x8000) key_status[VK_RSHIFT] = 0x80;
# else
if(GetAsyncKeyState(VK_RSHIFT, modkey_status) & 0x8000) key_status[VK_RSHIFT] = 0x80;
# endif
#endif
} else if(code == VK_CONTROL) {
-# if defined(Q_OS_WIN32)
+# if defined(Q_OS_WIN) || defined(Q_OS_CYGWIN)
if(GetAsyncKeyState(VK_CONTROL) & 0x8000) {
# else
if(GetAsyncKeyState(VK_CONTROL, modkey_status) & 0x8000) {
key_status[VK_CONTROL] = 0x80;
}
} else if(code == VK_LCONTROL) {
-# if defined(Q_OS_WIN32)
+# if defined(Q_OS_WIN) || defined(Q_OS_CYGWIN)
if(GetAsyncKeyState(VK_LCONTROL) & 0x8000) key_status[VK_LCONTROL] = 0x80;
# else
if(GetAsyncKeyState(VK_LCONTROL, modkey_status) & 0x8000) key_status[VK_LCONTROL] = 0x80;
# endif
} else if(code == VK_RCONTROL) {
-# if defined(Q_OS_WIN32)
+# if defined(Q_OS_WIN) || defined(Q_OS_CYGWIN)
if(GetAsyncKeyState(VK_RCONTROL) & 0x8000) key_status[VK_RCONTROL] = 0x80;
# else
if(GetAsyncKeyState(VK_RCONTROL, modkey_status) & 0x8000) key_status[VK_RCONTROL] = 0x80;
# endif
} else if(code == VK_MENU) {
-# if defined(Q_OS_WIN32)
+# if defined(Q_OS_WIN) || defined(Q_OS_CYGWIN)
if(GetAsyncKeyState(VK_MENU) & 0x8000) {
# else
if(GetAsyncKeyState(VK_MENU, modkey_status) & 0x8000) {
key_status[VK_MENU] = 0x80;
}
} else if(code == VK_LMENU) {
-# if defined(Q_OS_WIN32)
+# if defined(Q_OS_WIN) || defined(Q_OS_CYGWIN)
if(GetAsyncKeyState(VK_LMENU) & 0x8000) key_status[VK_LMENU] = 0x80;
# else
if(GetAsyncKeyState(VK_LMENU, modkey_status) & 0x8000) key_status[VK_LMENU] = 0x80;
# endif
} else if(code == VK_RMENU) {
-# if defined(Q_OS_WIN32)
+# if defined(Q_OS_WIN) || defined(Q_OS_CYGWIN)
if(GetAsyncKeyState(VK_RMENU) & 0x8000) key_status[VK_RMENU] = 0x80;
# else
if(GetAsyncKeyState(VK_RMENU, modkey_status) & 0x8000) key_status[VK_RMENU] = 0x80;
uint8 code = sym;
if(code == VK_SHIFT) {
#ifndef USE_SHIFT_NUMPAD_KEY
-# if defined(Q_OS_WIN32)
+# if defined(Q_OS_WIN) || defined(Q_OS_CYGWIN)
if(!(GetAsyncKeyState(VK_SHIFT) & 0x8000)) {
# else
if(!(GetAsyncKeyState(VK_SHIFT, modkey_status) & 0x8000)) {
#endif
} else if(code == VK_LSHIFT) {
#ifndef USE_SHIFT_NUMPAD_KEY
-# if defined(Q_OS_WIN32)
+# if defined(Q_OS_WIN) || defined(Q_OS_CYGWIN)
if(!(GetAsyncKeyState(VK_LSHIFT) & 0x8000)) key_status[VK_LSHIFT] &= 0x7f;
# else
if(!(GetAsyncKeyState(VK_LSHIFT, modkey_status) & 0x8000)) key_status[VK_LSHIFT] &= 0x7f;
#endif
} else if(code == VK_RSHIFT) {
#ifndef USE_SHIFT_NUMPAD_KEY
-# if defined(Q_OS_WIN32)
+# if defined(Q_OS_WIN) || defined(Q_OS_CYGWIN)
if(!(GetAsyncKeyState(VK_RSHIFT) & 0x8000)) key_status[VK_RSHIFT] &= 0x7f;
# else
if(!(GetAsyncKeyState(VK_RSHIFT, modkey_status) & 0x8000)) key_status[VK_RSHIFT] &= 0x7f;
# endif
#endif
} else if(code == VK_CONTROL) {
-# if defined(Q_OS_WIN32)
+# if defined(Q_OS_WIN) || defined(Q_OS_CYGWIN)
if(!(GetAsyncKeyState(VK_CONTROL) & 0x8000)) {
# else
if(!(GetAsyncKeyState(VK_CONTROL, modkey_status) & 0x8000)) {
key_status[VK_CONTROL] &= 0x7f;
}
} else if(code == VK_LCONTROL) {
-# if defined(Q_OS_WIN32)
+# if defined(Q_OS_WIN) || defined(Q_OS_CYGWIN)
if(!(GetAsyncKeyState(VK_LCONTROL) & 0x8000)) key_status[VK_LCONTROL] &= 0x7f;
# else
if(!(GetAsyncKeyState(VK_LCONTROL, modkey_status) & 0x8000)) key_status[VK_LCONTROL] &= 0x7f;
# endif
} else if(code == VK_RCONTROL) {
-# if defined(Q_OS_WIN32)
+# if defined(Q_OS_WIN) || defined(Q_OS_CYGWIN)
if(!(GetAsyncKeyState(VK_RCONTROL) & 0x8000)) key_status[VK_RCONTROL] &= 0x7f;
# else
if(!(GetAsyncKeyState(VK_RCONTROL, modkey_status) & 0x8000)) key_status[VK_RCONTROL] &= 0x7f;
# endif
} else if(code == VK_MENU) {
-# if defined(Q_OS_WIN32)
+# if defined(Q_OS_WIN) || defined(Q_OS_CYGWIN)
if(!(GetAsyncKeyState(VK_MENU) & 0x8000)) {
# else
if(!(GetAsyncKeyState(VK_MENU, modkey_status) & 0x8000)) {
key_status[VK_MENU] &= 0x7f;
}
} else if(code == VK_LMENU) {
-# if defined(Q_OS_WIN32)
+# if defined(Q_OS_WIN) || defined(Q_OS_CYGWIN)
if(!(GetAsyncKeyState(VK_LMENU) & 0x8000)) key_status[VK_LMENU] &= 0x7f;
# else
if(!(GetAsyncKeyState(VK_LMENU, modkey_status) & 0x8000)) key_status[VK_LMENU] &= 0x7f;
# endif
} else if(code == VK_RMENU) {
-# if defined(Q_OS_WIN32)
+# if defined(Q_OS_WIN) || defined(Q_OS_CYGWIN)
if(!(GetAsyncKeyState(VK_RMENU) & 0x8000)) key_status[VK_RMENU] &= 0x7f;
# else
if(!(GetAsyncKeyState(VK_RMENU, modkey_status) & 0x8000)) key_status[VK_RMENU] &= 0x7f;