Просмотр исходного кода

Renamed SUPPORT_MOUSE_CURSOR_NATIVE -> SUPPORT_MOUSE_CURSOR_POINT

pull/1835/head
Ray 3 лет назад
Родитель
Сommit
68e408474d
3 измененных файлов: 19 добавлений и 18 удалений
  1. +1
    -1
      src/config.h
  2. +16
    -15
      src/core.c
  3. +2
    -2
      src/models.c

+ 1
- 1
src/config.h Просмотреть файл

@ -37,7 +37,7 @@
// Reconfigure standard input to receive key inputs, works with SSH connection. // Reconfigure standard input to receive key inputs, works with SSH connection.
#define SUPPORT_SSH_KEYBOARD_RPI 1 #define SUPPORT_SSH_KEYBOARD_RPI 1
// Draw a mouse pointer on screen // Draw a mouse pointer on screen
#define SUPPORT_MOUSE_CURSOR_NATIVE 1 #define SUPPORT_MOUSE_CURSOR_POINT 1
// Setting a higher resolution can improve the accuracy of time-out intervals in wait functions. // Setting a higher resolution can improve the accuracy of time-out intervals in wait functions.
// However, it can also reduce overall system performance, because the thread scheduler switches tasks more often. // However, it can also reduce overall system performance, because the thread scheduler switches tasks more often.
#define SUPPORT_WINMM_HIGHRES_TIMER 1 #define SUPPORT_WINMM_HIGHRES_TIMER 1

+ 16
- 15
src/core.c Просмотреть файл

@ -56,7 +56,7 @@
* WARNING: Reconfiguring standard input could lead to undesired effects, like breaking other running processes or * WARNING: Reconfiguring standard input could lead to undesired effects, like breaking other running processes or
* blocking the device is not restored properly. Use with care. * blocking the device is not restored properly. Use with care.
* *
* #define SUPPORT_MOUSE_CURSOR_NATIVE (Raspberry Pi and DRM only) * #define SUPPORT_MOUSE_CURSOR_POINT
* Draw a mouse pointer on screen * Draw a mouse pointer on screen
* *
* #define SUPPORT_BUSY_WAIT_LOOP * #define SUPPORT_BUSY_WAIT_LOOP
@ -387,7 +387,7 @@ typedef struct CoreData {
Point position; // Window position on screen (required on fullscreen toggle) Point position; // Window position on screen (required on fullscreen toggle)
Size display; // Display width and height (monitor, device-screen, LCD, ...) Size display; // Display width and height (monitor, device-screen, LCD, ...)
Size screen; // Screen width and height (used render area) Size screen; // Screen width and height (used render area)
Size currentFbo; // Current render width and height, it could change on BeginTextureMode() Size currentFbo; // Current render width and height (depends on active fbo)
Size render; // Framebuffer width and height (render area, including black bars if required) Size render; // Framebuffer width and height (render area, including black bars if required)
Point renderOffset; // Offset from render area (must be divided by 2) Point renderOffset; // Offset from render area (must be divided by 2)
Matrix screenScale; // Matrix to scale screen (framebuffer rendering) Matrix screenScale; // Matrix to scale screen (framebuffer rendering)
@ -1952,22 +1952,22 @@ void BeginDrawing(void)
// End canvas drawing and swap buffers (double buffering) // End canvas drawing and swap buffers (double buffering)
void EndDrawing(void) void EndDrawing(void)
{ {
#if (defined(PLATFORM_RPI) || defined(PLATFORM_DRM)) && defined(SUPPORT_MOUSE_CURSOR_NATIVE) rlDrawRenderBatchActive(); // Update and draw internal render batch
// On native mode we have no system mouse cursor, so, #if defined(SUPPORT_MOUSE_CURSOR_POINT)
// we draw a small rectangle for user reference // Draw a small rectangle on mouse position for user reference
if (!CORE.Input.Mouse.cursorHidden) if (!CORE.Input.Mouse.cursorHidden)
{ {
DrawRectangle(CORE.Input.Mouse.currentPosition.x, CORE.Input.Mouse.currentPosition.y, 3, 3, MAROON); DrawRectangle(CORE.Input.Mouse.currentPosition.x, CORE.Input.Mouse.currentPosition.y, 3, 3, MAROON);
rlDrawRenderBatchActive(); // Update and draw internal render batch
} }
#endif #endif
rlDrawRenderBatchActive(); // Update and draw internal render batch
#if defined(SUPPORT_GIF_RECORDING) #if defined(SUPPORT_GIF_RECORDING)
#define GIF_RECORD_FRAMERATE 10 // Draw record indicator
if (gifRecording) if (gifRecording)
{ {
#define GIF_RECORD_FRAMERATE 10
gifFramesCounter++; gifFramesCounter++;
// NOTE: We record one gif frame every 10 game frames // NOTE: We record one gif frame every 10 game frames
@ -1992,6 +1992,7 @@ void EndDrawing(void)
#endif #endif
#if defined(SUPPORT_EVENTS_AUTOMATION) #if defined(SUPPORT_EVENTS_AUTOMATION)
// Draw record/play indicator
if (eventsRecording) if (eventsRecording)
{ {
gifFramesCounter++; gifFramesCounter++;
@ -2018,8 +2019,8 @@ void EndDrawing(void)
} }
#endif #endif
SwapBuffers(); // Copy back buffer to front buffer SwapBuffers(); // Copy back buffer to front buffer (screen)
// Frame time control system // Frame time control system
CORE.Time.current = GetTime(); CORE.Time.current = GetTime();
CORE.Time.draw = CORE.Time.current - CORE.Time.previous; CORE.Time.draw = CORE.Time.current - CORE.Time.previous;
@ -2040,13 +2041,13 @@ void EndDrawing(void)
} }
PollInputEvents(); // Poll user events PollInputEvents(); // Poll user events
#if defined(SUPPORT_EVENTS_AUTOMATION) #if defined(SUPPORT_EVENTS_AUTOMATION)
// Events recording and playing logic
if (eventsRecording) RecordAutomationEvent(CORE.Time.frameCounter); if (eventsRecording) RecordAutomationEvent(CORE.Time.frameCounter);
else if (eventsPlaying)
// TODO: When should we play? After/before/replace PollInputEvents()?
if (eventsPlaying)
{ {
// TODO: When should we play? After/before/replace PollInputEvents()?
if (CORE.Time.frameCounter >= eventCount) eventsPlaying = false; if (CORE.Time.frameCounter >= eventCount) eventsPlaying = false;
PlayAutomationEvent(CORE.Time.frameCounter); PlayAutomationEvent(CORE.Time.frameCounter);
} }

+ 2
- 2
src/models.c Просмотреть файл

@ -4800,7 +4800,7 @@ static ModelAnimation *LoadGLTFModelAnimations(const char *fileName, int *animCo
// output->framerate = // TODO: Use framerate instead of const timestep // output->framerate = // TODO: Use framerate instead of const timestep
// Name and parent bones // Name and parent bones
for (unsigned int j = 0; j < output->boneCount; j++) for (int j = 0; j < output->boneCount; j++)
{ {
strcpy(output->bones[j].name, data->nodes[j].name == 0 ? "ANIMJOINT" : data->nodes[j].name); strcpy(output->bones[j].name, data->nodes[j].name == 0 ? "ANIMJOINT" : data->nodes[j].name);
output->bones[j].parent = (data->nodes[j].parent != NULL) ? (int)(data->nodes[j].parent - data->nodes) : -1; output->bones[j].parent = (data->nodes[j].parent != NULL) ? (int)(data->nodes[j].parent - data->nodes) : -1;
@ -4812,7 +4812,7 @@ static ModelAnimation *LoadGLTFModelAnimations(const char *fileName, int *animCo
{ {
output->framePoses[frame] = RL_MALLOC(output->boneCount*sizeof(Transform)); output->framePoses[frame] = RL_MALLOC(output->boneCount*sizeof(Transform));
for (unsigned int i = 0; i < output->boneCount; i++) for (int i = 0; i < output->boneCount; i++)
{ {
output->framePoses[frame][i].translation = Vector3Zero(); output->framePoses[frame][i].translation = Vector3Zero();
output->framePoses[frame][i].rotation = QuaternionIdentity(); output->framePoses[frame][i].rotation = QuaternionIdentity();

||||||
x
 
000:0
Загрузка…
Отмена
Сохранить