浏览代码

Code tweaks and comments for Android

pull/363/head
Ray San 7 年前
父节点
当前提交
c45eeb8024
共有 2 个文件被更改,包括 9 次插入5 次删除
  1. +8
    -5
      src/core.c
  2. +1
    -0
      src/utils.c

+ 8
- 5
src/core.c 查看文件

@ -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

+ 1
- 0
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)

正在加载...
取消
保存