diff options
| author | Ray San <raysan5@gmail.com> | 2017-09-29 13:56:37 +0200 |
|---|---|---|
| committer | Ray San <raysan5@gmail.com> | 2017-09-29 13:56:37 +0200 |
| commit | c45eeb80245f52f694a33ada6212fa62e85d1206 (patch) | |
| tree | 61c16877ee27b300a067258fc4e7a3a05dca2152 /src | |
| parent | becddd7725d8cb544957af1d1cb0d44333bf37d9 (diff) | |
| download | raylib-c45eeb80245f52f694a33ada6212fa62e85d1206.tar.gz raylib-c45eeb80245f52f694a33ada6212fa62e85d1206.zip | |
Code tweaks and comments for Android
Diffstat (limited to 'src')
| -rw-r--r-- | src/core.c | 13 | ||||
| -rw-r--r-- | src/utils.c | 1 |
2 files changed, 9 insertions, 5 deletions
@@ -314,9 +314,7 @@ static Vector2 mousePosition; // Mouse position on screen static bool toggleCursorLock = false; // Ask for cursor pointer lock on next click #endif -#if defined(SUPPORT_GESTURES_SYSTEM) static Vector2 touchPosition[MAX_TOUCH_POINTS]; // Touch position on screen -#endif #if defined(PLATFORM_DESKTOP) static char **dropFilesPath; // Store dropped files paths as strings @@ -477,8 +475,6 @@ void InitWindow(int width, int height, void *state) { TraceLog(LOG_INFO, "Initializing raylib (v1.8.0)"); - app_dummy(); - screenWidth = width; screenHeight = height; @@ -1495,6 +1491,7 @@ bool IsMouseButtonPressed(int button) { bool pressed = false; +// TODO: Review, gestures could be not supported despite being on Android platform! #if defined(PLATFORM_ANDROID) if (IsGestureDetected(GESTURE_TAP)) pressed = true; #else @@ -2748,6 +2745,7 @@ static int32_t AndroidInputCallback(struct android_app *app, AInputEvent *event) int32_t action = AMotionEvent_getAction(event); unsigned int flags = action & AMOTION_EVENT_ACTION_MASK; +#if defined(SUPPORT_GESTURES_SYSTEM) GestureEvent gestureEvent; // Register touch actions @@ -2776,8 +2774,13 @@ static int32_t AndroidInputCallback(struct android_app *app, AInputEvent *event) // Gesture data is sent to gestures system for processing ProcessGestureEvent(gestureEvent); +#else + + // TODO: Support only simple touch position + +#endif - return 0; // return 1; + return 0; } #endif diff --git a/src/utils.c b/src/utils.c index cd4638af..967ed916 100644 --- a/src/utils.c +++ b/src/utils.c @@ -47,6 +47,7 @@ #define SUPPORT_TRACELOG // Output tracelog messages //#define SUPPORT_TRACELOG_DEBUG // Avoid LOG_DEBUG messages tracing +#include "raylib.h" // WARNING: Required for: LogType enum #include "utils.h" #if defined(PLATFORM_ANDROID) |
