Skip to content

Commit

Permalink
Remove trail spaces
Browse files Browse the repository at this point in the history
  • Loading branch information
raysan5 committed May 8, 2019
1 parent ecea95f commit 97c8a28
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 29 deletions.
18 changes: 9 additions & 9 deletions src/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1302,7 +1302,7 @@ void EndTextureMode(void)

// Set viewport to default framebuffer size
SetupViewport(renderWidth, renderHeight);

// Reset current screen size
currentWidth = GetScreenWidth();
currentHeight = GetScreenHeight();
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand All @@ -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)
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)))
{
Expand All @@ -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);
}
}
Expand Down
28 changes: 14 additions & 14 deletions src/rlgl.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,15 +64,15 @@
#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)
#define RLAPI __declspec(dllimport) // We are using raylib as a Win32 shared library (.dll)
#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)
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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...
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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");
Expand All @@ -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;

Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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)

Expand Down
8 changes: 4 additions & 4 deletions src/shapes.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/textures.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 97c8a28

Please sign in to comment.