Remove trail spaces
This commit is contained in:
parent
ecea95f50f
commit
97c8a28aaa
4 changed files with 29 additions and 29 deletions
18
src/core.c
18
src/core.c
|
@ -1302,7 +1302,7 @@ void EndTextureMode(void)
|
|||
|
||||
// Set viewport to default framebuffer size
|
||||
SetupViewport(renderWidth, renderHeight);
|
||||
|
||||
|
||||
// Reset current screen size
|
||||
currentWidth = GetScreenWidth();
|
||||
currentHeight = GetScreenHeight();
|
||||
|
@ -2241,7 +2241,7 @@ Vector2 GetMousePosition(void)
|
|||
#endif
|
||||
#if defined(PLATFORM_WEB)
|
||||
Vector2 pos = GetTouchPosition(0);
|
||||
|
||||
|
||||
// Touch position has priority over mouse position
|
||||
if ((pos.x > 0) && (pos.y > 0)) position = pos; // There was a touch!
|
||||
#endif
|
||||
|
@ -2933,7 +2933,7 @@ static void SetupViewport(int width, int height)
|
|||
{
|
||||
renderWidth = width;
|
||||
renderHeight = height;
|
||||
|
||||
|
||||
// Set viewport width and height
|
||||
// NOTE: We consider render size and offset in case black bars are required and
|
||||
// render area does not match full display area (this situation is only applicable on fullscreen mode)
|
||||
|
@ -2944,7 +2944,7 @@ static void SetupViewport(int width, int height)
|
|||
|
||||
// Set orthographic projection to current framebuffer size
|
||||
// NOTE: Configured top-left corner as (0, 0)
|
||||
rlOrtho(0, renderWidth, renderHeight, 0, 0.0f, 1.0f);
|
||||
rlOrtho(0, renderWidth, renderHeight, 0, 0.0f, 1.0f);
|
||||
|
||||
rlMatrixMode(RL_MODELVIEW); // Switch back to MODELVIEW matrix
|
||||
rlLoadIdentity(); // Reset current matrix (MODELVIEW)
|
||||
|
@ -3382,7 +3382,7 @@ static void PollInputEvents(void)
|
|||
// NOTE: Postprocessing texture is not scaled to new size
|
||||
|
||||
windowResized = true;
|
||||
|
||||
|
||||
} break;
|
||||
case UWP_MSG_SET_GAME_TIME: currentTime = msg->paramDouble0; break;
|
||||
default: break;
|
||||
|
@ -3734,7 +3734,7 @@ static void WindowSizeCallback(GLFWwindow *window, int width, int height)
|
|||
screenHeight = height;
|
||||
currentWidth = width;
|
||||
currentHeight = height;
|
||||
|
||||
|
||||
// NOTE: Postprocessing texture is not scaled to new size
|
||||
|
||||
windowResized = true;
|
||||
|
@ -4361,7 +4361,7 @@ static void InitEvdevInput(void)
|
|||
|
||||
// Open the linux directory of "/dev/input"
|
||||
directory = opendir(DEFAULT_EVDEV_PATH);
|
||||
|
||||
|
||||
if (directory)
|
||||
{
|
||||
while ((entity = readdir(directory)) != NULL)
|
||||
|
@ -4708,7 +4708,7 @@ static void *EventThread(void *arg)
|
|||
if ((event.code >= 1) && (event.code <= 255)) //Keyboard keys appear for codes 1 to 255
|
||||
{
|
||||
keycode = keymap_US[event.code & 0xFF]; // The code we get is a scancode so we look up the apropriate keycode
|
||||
|
||||
|
||||
// Make sure we got a valid keycode
|
||||
if ((keycode > 0) && (keycode < sizeof(currentKeyState)))
|
||||
{
|
||||
|
@ -4721,7 +4721,7 @@ static void *EventThread(void *arg)
|
|||
lastKeyPressedEvdev.Head = (lastKeyPressedEvdev.Head + 1) & 0x07; // Increment the head pointer forwards and binary wraparound after 7 (fifo is 8 elements long)
|
||||
// TODO: This fifo is not fully threadsafe with multiple writers, so multiple keyboards hitting a key at the exact same time could miss a key (double write to head before it was incremented)
|
||||
}
|
||||
|
||||
|
||||
TraceLog(LOG_DEBUG, "KEY%s ScanCode: %4i KeyCode: %4i",event.value == 0 ? "UP":"DOWN", event.code, keycode);
|
||||
}
|
||||
}
|
||||
|
|
28
src/rlgl.h
28
src/rlgl.h
|
@ -64,7 +64,7 @@
|
|||
#if defined(RLGL_STANDALONE)
|
||||
#define RAYMATH_STANDALONE
|
||||
#define RAYMATH_HEADER_ONLY
|
||||
|
||||
|
||||
#if defined(_WIN32) && defined(BUILD_LIBTYPE_SHARED)
|
||||
#define RLAPI __declspec(dllexport) // We are building raylib as a Win32 shared library (.dll)
|
||||
#elif defined(_WIN32) && defined(USE_LIBTYPE_SHARED)
|
||||
|
@ -72,7 +72,7 @@
|
|||
#else
|
||||
#define RLAPI // We are building or using raylib as a static library (or Linux shared library)
|
||||
#endif
|
||||
|
||||
|
||||
// Allow custom memory allocators
|
||||
#ifndef RL_MALLOC
|
||||
#define RL_MALLOC(sz) malloc(sz)
|
||||
|
@ -544,7 +544,7 @@ RLAPI void EndBlendMode(void); // End blending mode (re
|
|||
RLAPI void InitVrSimulator(void); // Init VR simulator for selected device parameters
|
||||
RLAPI void CloseVrSimulator(void); // Close VR simulator for current device
|
||||
RLAPI void UpdateVrTracking(Camera *camera); // Update VR tracking (position and orientation) and camera
|
||||
RLAPI void SetVrConfiguration(VrDeviceInfo info, Shader distortion); // Set stereo rendering configuration parameters
|
||||
RLAPI void SetVrConfiguration(VrDeviceInfo info, Shader distortion); // Set stereo rendering configuration parameters
|
||||
RLAPI bool IsVrSimulatorReady(void); // Detect if VR simulator is ready
|
||||
RLAPI void ToggleVrMode(void); // Enable/Disable VR experience
|
||||
RLAPI void BeginVrDrawing(void); // Begin VR simulator stereo rendering
|
||||
|
@ -1567,11 +1567,11 @@ void rlglInit(int width, int height)
|
|||
glBindVertexArray = (PFNGLBINDVERTEXARRAYOESPROC)eglGetProcAddress("glBindVertexArrayOES");
|
||||
glDeleteVertexArrays = (PFNGLDELETEVERTEXARRAYSOESPROC)eglGetProcAddress("glDeleteVertexArraysOES");
|
||||
//glIsVertexArray = (PFNGLISVERTEXARRAYOESPROC)eglGetProcAddress("glIsVertexArrayOES"); // NOTE: Fails in WebGL, omitted
|
||||
|
||||
|
||||
if (glGenVertexArrays == NULL) printf("glGenVertexArrays is NULL.\n"); // WEB: ISSUE FOUND! ...but why?
|
||||
if (glBindVertexArray == NULL) printf("glBindVertexArray is NULL.\n"); // WEB: ISSUE FOUND! ...but why?
|
||||
}
|
||||
|
||||
|
||||
// TODO: HACK REVIEW!
|
||||
// For some reason on raylib 2.5, VAO usage breaks the build
|
||||
// error seems related to function pointers but I can not get detailed info...
|
||||
|
@ -2488,19 +2488,19 @@ void rlLoadMesh(Mesh *mesh, bool dynamic)
|
|||
unsigned int rlLoadAttribBuffer(unsigned int vaoId, int shaderLoc, void *buffer, int size, bool dynamic)
|
||||
{
|
||||
unsigned int id = 0;
|
||||
|
||||
|
||||
#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2)
|
||||
int drawHint = GL_STATIC_DRAW;
|
||||
if (dynamic) drawHint = GL_DYNAMIC_DRAW;
|
||||
|
||||
|
||||
if (vaoSupported) glBindVertexArray(vaoId);
|
||||
|
||||
|
||||
glGenBuffers(1, &id);
|
||||
glBindBuffer(GL_ARRAY_BUFFER, id);
|
||||
glBufferData(GL_ARRAY_BUFFER, size, buffer, drawHint);
|
||||
glVertexAttribPointer(shaderLoc, 2, GL_FLOAT, 0, 0, 0);
|
||||
glEnableVertexAttribArray(shaderLoc);
|
||||
|
||||
|
||||
if (vaoSupported) glBindVertexArray(0);
|
||||
#endif
|
||||
|
||||
|
@ -3536,7 +3536,7 @@ void InitVrSimulator(void)
|
|||
// Initialize framebuffer and textures for stereo rendering
|
||||
// NOTE: Screen size should match HMD aspect ratio
|
||||
stereoFbo = rlLoadRenderTexture(screenWidth, screenHeight, UNCOMPRESSED_R8G8B8A8, 24, false);
|
||||
|
||||
|
||||
vrSimulatorReady = true;
|
||||
#else
|
||||
TraceLog(LOG_WARNING, "VR Simulator not supported on OpenGL 1.1");
|
||||
|
@ -3558,13 +3558,13 @@ void CloseVrSimulator(void)
|
|||
#endif
|
||||
}
|
||||
|
||||
// Set stereo rendering configuration parameters
|
||||
// Set stereo rendering configuration parameters
|
||||
void SetVrConfiguration(VrDeviceInfo hmd, Shader distortion)
|
||||
{
|
||||
#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2)
|
||||
// Reset vrConfig for a new values assignment
|
||||
memset(&vrConfig, 0, sizeof(vrConfig));
|
||||
|
||||
|
||||
// Assign distortion shader
|
||||
vrConfig.distortionShader = distortion;
|
||||
|
||||
|
@ -3620,7 +3620,7 @@ void SetVrConfiguration(VrDeviceInfo hmd, Shader distortion)
|
|||
// Compute eyes Viewports
|
||||
vrConfig.eyeViewportRight[2] = hmd.hResolution/2;
|
||||
vrConfig.eyeViewportRight[3] = hmd.vResolution;
|
||||
|
||||
|
||||
vrConfig.eyeViewportLeft[0] = hmd.hResolution/2;
|
||||
vrConfig.eyeViewportLeft[1] = 0;
|
||||
vrConfig.eyeViewportLeft[2] = hmd.hResolution/2;
|
||||
|
@ -3677,7 +3677,7 @@ void BeginVrDrawing(void)
|
|||
#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2)
|
||||
if (vrSimulatorReady)
|
||||
{
|
||||
|
||||
|
||||
rlEnableRenderTexture(stereoFbo.id); // Setup framebuffer for stereo rendering
|
||||
//glEnable(GL_FRAMEBUFFER_SRGB); // Enable SRGB framebuffer (only if required)
|
||||
|
||||
|
|
|
@ -777,9 +777,9 @@ void DrawRectangleRounded(Rectangle rec, float roundness, int segments, Color co
|
|||
|
||||
#if defined(SUPPORT_QUADS_DRAW_MODE)
|
||||
if (rlCheckBufferLimit(16*segments/2 + 5*4)) rlglDraw();
|
||||
|
||||
|
||||
rlEnableTexture(GetShapesTexture().id);
|
||||
|
||||
|
||||
rlBegin(RL_QUADS);
|
||||
// Draw all of the 4 corners: [1] Upper Left Corner, [3] Upper Right Corner, [5] Lower Right Corner, [7] Lower Left Corner
|
||||
for (int k = 0; k < 4; ++k) // Hope the compiler is smart enough to unroll this loop
|
||||
|
@ -1010,9 +1010,9 @@ void DrawRectangleRoundedLines(Rectangle rec, float roundness, int segments, int
|
|||
{
|
||||
#if defined(SUPPORT_QUADS_DRAW_MODE)
|
||||
if (rlCheckBufferLimit(4*4*segments + 4*4)) rlglDraw(); // 4 corners with 4 vertices for each segment + 4 rectangles with 4 vertices each
|
||||
|
||||
|
||||
rlEnableTexture(GetShapesTexture().id);
|
||||
|
||||
|
||||
rlBegin(RL_QUADS);
|
||||
// Draw all of the 4 corners first: Upper Left Corner, Upper Right Corner, Lower Right Corner, Lower Left Corner
|
||||
for (int k = 0; k < 4; ++k) // Hope the compiler is smart enough to unroll this loop
|
||||
|
|
|
@ -112,11 +112,11 @@
|
|||
defined(SUPPORT_FILEFORMAT_GIF) || \
|
||||
defined(SUPPORT_FILEFORMAT_PIC) || \
|
||||
defined(SUPPORT_FILEFORMAT_HDR))
|
||||
|
||||
|
||||
#define STBI_MALLOC RL_MALLOC
|
||||
#define STBI_FREE RL_FREE
|
||||
#define STBI_REALLOC(p,newsz) realloc(p,newsz)
|
||||
|
||||
|
||||
#define STB_IMAGE_IMPLEMENTATION
|
||||
#include "external/stb_image.h" // Required for: stbi_load_from_file()
|
||||
// NOTE: Used to read image data (multiple formats support)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue