aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorptitSeb2017-12-06 17:06:17 +0100
committerptitSeb2017-12-06 17:06:17 +0100
commit9445c69a5148b9ef070aca2e73d94b38e9f4ce79 (patch)
tree9c9d38cd39d5a6f27e39d6f5a782e3e56c328026
parentc5e4535f9ac06c25bd37529b351fbbf927e82683 (diff)
downloadhydracastlelabyrinth-9445c69a5148b9ef070aca2e73d94b38e9f4ce79.tar.gz
hydracastlelabyrinth-9445c69a5148b9ef070aca2e73d94b38e9f4ce79.tar.bz2
hydracastlelabyrinth-9445c69a5148b9ef070aca2e73d94b38e9f4ce79.zip
Added ODROID support (thanks to @meveric)
-rw-r--r--CMakeLists.txt6
-rw-r--r--src/main.c18
2 files changed, 22 insertions, 2 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 8c2a26c..49927f1 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,6 +1,7 @@
cmake_minimum_required(VERSION 2.8)
option(PANDORA "Set to ON if targeting an OpenPandora device" ${PANDORA})
+option(ODROID "Set to ON if targeting an ODroid device" ${ODROID})
option(PYRA "Set to ON if targeting an DragonBox Pyra device" ${PANDORA})
option(CHIP "Set to ON if targeting an PocketCHIP device" ${PANDORA})
@@ -14,7 +15,10 @@ endif()
if(CHIP)
add_definitions(-DCHIP)
endif()
-
+if(ODROID)
+ add_definitions(-DODROID)
+ set (EXTRA_LIBS ${EXTRA_LIBS} X11)
+endif()
#create a _SDL2 later?
add_definitions(-D_SDL)
diff --git a/src/main.c b/src/main.c
index cd09738..e163692 100644
--- a/src/main.c
+++ b/src/main.c
@@ -3,6 +3,10 @@
#include <stdlib.h>
#include <time.h>
#include <sys/stat.h>
+#ifdef ODROID
+#define _XTYPEDEF_MASK
+#include <X11/Xlib.h>
+#endif
void createSaveLocations()
{
@@ -39,7 +43,7 @@ int main(int argc, char **argv)
osSetSpeedupEnable(false);
#endif
#ifdef _SDL
- #if defined(PANDORA) || defined(PYRA) || defined(CHIP)
+ #if defined(PANDORA) || defined(PYRA) || defined(CHIP) || defined(ODROID)
wantFullscreen = 1;
#else
wantFullscreen = 0;
@@ -48,6 +52,18 @@ int main(int argc, char **argv)
screenScale = 1;
#elif defined(PYRA)
screenScale = 3;
+ #elif defined(ODROID)
+ Display* disp = XOpenDisplay(NULL);
+ Screen* scrn = DefaultScreenOfDisplay(disp);
+ int maxy = scrn->height;
+ if(maxy < 640)
+ screenScale = 1;
+ else if (maxy < 720)
+ screenScale = 2;
+ else if (maxy < 960)
+ screenScale = 3;
+ else
+ screenScale = 4;
#else
screenScale = 2;
#endif