From 08db7b73bc05007bad593d42ce97c25c58edbd03 Mon Sep 17 00:00:00 2001 From: Jerome St-Louis Date: Sun, 10 Mar 2013 11:07:54 -0400 Subject: [PATCH] Tweaks for Android --- chess.epj | 6 +++++- src/chess.ec | 25 ++++++++++++++++++------- 2 files changed, 23 insertions(+), 8 deletions(-) diff --git a/chess.epj b/chess.epj index eababf9..1679250 100644 --- a/chess.epj +++ b/chess.epj @@ -33,9 +33,13 @@ { "Name" : "Android", "Options" : { - "Debug" : true, + "Optimization" : "Speed", + "PreprocessorDefinitions" : [ + "HIGH_DPI" + ], "TargetType" : "SharedLibrary", "TargetFileName" : "Chess", + "FastMath" : true, "PostbuildCommands" : [ "$(call mkdirq,$(OBJ)apk/lib/x86)", "$(call mkdirq,$(OBJ)apk/lib/armeabi)", diff --git a/src/chess.ec b/src/chess.ec index e86b27e..f120c1c 100644 --- a/src/chess.ec +++ b/src/chess.ec @@ -41,11 +41,11 @@ ChessApp app; class ChessApp : GuiApplication { appName = APPNAME; -#if defined(__WIN32__) +/*#if defined(__WIN32__) driver = "Direct3D"; -#else +#else*/ driver = "OpenGL"; -#endif +//#endif Chess{}; void Main() @@ -55,11 +55,22 @@ class ChessApp : GuiApplication } } +#ifdef HIGH_DPI +define stateWidth = 300; +define turnWidth = 150; +#else +define stateWidth = 200; +define turnWidth = 100; +#endif + class Chess : Window { background = gray, hasMenuBar = true, hasStatusBar = true, - text = APPNAME, hasClose = true, hasMaximize = true, hasMinimize = true, - borderStyle = sizable, hasClose = true, + text = APPNAME, +#ifndef __ANDROID__ + hasClose = true, hasMaximize = true, hasMinimize = true, + borderStyle = sizable, +#endif anchor = Anchor { left = 0, top = 0, right = 0, bottom = 0 }; bool hosting, local, ai; @@ -71,8 +82,8 @@ class Chess : Window ChessState chessState; - StatusField stateField { statusBar, width = 200 }; - StatusField turnField { statusBar, width = 100 }; + StatusField stateField { statusBar, width = stateWidth}; + StatusField turnField { statusBar, width = turnWidth }; property ChessState * chessState { get { return &chessState; } } -- 1.8.3.1