Remove trailing spaces

This commit is contained in:
Ray 2020-11-03 23:47:33 +01:00
parent f46514b855
commit 3e1cd487df
11 changed files with 337 additions and 325 deletions

View file

@ -834,7 +834,7 @@ void CloseWindow(void)
CORE.Window.gbmDevice = NULL; CORE.Window.gbmDevice = NULL;
} }
if(CORE.Window.crtc) if (CORE.Window.crtc)
{ {
if (CORE.Window.connector) if (CORE.Window.connector)
{ {
@ -5253,7 +5253,7 @@ static void *EventThread(void *arg)
while (!CORE.Window.shouldClose) while (!CORE.Window.shouldClose)
{ {
// Try to read data from the device and only continue if successful // Try to read data from the device and only continue if successful
while(read(worker->fd, &event, sizeof(event)) == (int)sizeof(event)) while (read(worker->fd, &event, sizeof(event)) == (int)sizeof(event))
{ {
// Relative movement parsing // Relative movement parsing
if (event.type == EV_REL) if (event.type == EV_REL)

View file

@ -1178,13 +1178,15 @@ void DrawRectangleRoundedLines(Rectangle rec, float roundness, int segments, int
angle += stepLength; angle += stepLength;
} }
} }
// And now the remaining 4 lines // And now the remaining 4 lines
for(int i = 0; i < 8; i += 2) for (int i = 0; i < 8; i += 2)
{ {
rlColor4ub(color.r, color.g, color.b, color.a); rlColor4ub(color.r, color.g, color.b, color.a);
rlVertex2f(point[i].x, point[i].y); rlVertex2f(point[i].x, point[i].y);
rlVertex2f(point[i + 1].x, point[i + 1].y); rlVertex2f(point[i + 1].x, point[i + 1].y);
} }
rlEnd(); rlEnd();
} }
} }

View file

@ -3072,39 +3072,43 @@ void DrawTextureQuad(Texture2D texture, Vector2 tiling, Vector2 offset, Rectangl
// NOTE: For tilling a whole texture DrawTextureQuad() is better // NOTE: For tilling a whole texture DrawTextureQuad() is better
void DrawTextureTiled(Texture2D texture, Rectangle sourceRec, Rectangle destRec, Vector2 origin, float rotation, float scale, Color tint) void DrawTextureTiled(Texture2D texture, Rectangle sourceRec, Rectangle destRec, Vector2 origin, float rotation, float scale, Color tint)
{ {
if(texture.id <= 0 || scale <= 0.0f) return; // Wanna see a infinite loop?!...just delete this line! if (texture.id <= 0 || scale <= 0.0f) return; // Wanna see a infinite loop?!...just delete this line!
int tileWidth = sourceRec.width*scale, tileHeight = sourceRec.height*scale; int tileWidth = sourceRec.width*scale, tileHeight = sourceRec.height*scale;
if(destRec.width < tileWidth && destRec.height < tileHeight) if (destRec.width < tileWidth && destRec.height < tileHeight)
{ {
// Can fit only one tile // Can fit only one tile
DrawTexturePro(texture, (Rectangle){sourceRec.x, sourceRec.y, ((float)destRec.width/tileWidth)*sourceRec.width, ((float)destRec.height/tileHeight)*sourceRec.height}, DrawTexturePro(texture, (Rectangle){sourceRec.x, sourceRec.y, ((float)destRec.width/tileWidth)*sourceRec.width, ((float)destRec.height/tileHeight)*sourceRec.height},
(Rectangle){destRec.x, destRec.y, destRec.width, destRec.height}, origin, rotation, tint); (Rectangle){destRec.x, destRec.y, destRec.width, destRec.height}, origin, rotation, tint);
} }
else if(destRec.width <= tileWidth) else if (destRec.width <= tileWidth)
{ {
// Tiled vertically (one column) // Tiled vertically (one column)
int dy = 0; int dy = 0;
for(;dy+tileHeight < destRec.height; dy += tileHeight) { for (;dy+tileHeight < destRec.height; dy += tileHeight)
{
DrawTexturePro(texture, (Rectangle){sourceRec.x, sourceRec.y, ((float)destRec.width/tileWidth)*sourceRec.width, sourceRec.height}, (Rectangle){destRec.x, destRec.y + dy, destRec.width, tileHeight}, origin, rotation, tint); DrawTexturePro(texture, (Rectangle){sourceRec.x, sourceRec.y, ((float)destRec.width/tileWidth)*sourceRec.width, sourceRec.height}, (Rectangle){destRec.x, destRec.y + dy, destRec.width, tileHeight}, origin, rotation, tint);
} }
// Fit last tile // Fit last tile
if(dy < destRec.height) { if (dy < destRec.height)
{
DrawTexturePro(texture, (Rectangle){sourceRec.x, sourceRec.y, ((float)destRec.width/tileWidth)*sourceRec.width, ((float)(destRec.height - dy)/tileHeight)*sourceRec.height}, DrawTexturePro(texture, (Rectangle){sourceRec.x, sourceRec.y, ((float)destRec.width/tileWidth)*sourceRec.width, ((float)(destRec.height - dy)/tileHeight)*sourceRec.height},
(Rectangle){destRec.x, destRec.y + dy, destRec.width, destRec.height - dy}, origin, rotation, tint); (Rectangle){destRec.x, destRec.y + dy, destRec.width, destRec.height - dy}, origin, rotation, tint);
} }
} }
else if(destRec.height <= tileHeight) else if (destRec.height <= tileHeight)
{ {
// Tiled horizontally (one row) // Tiled horizontally (one row)
int dx = 0; int dx = 0;
for(;dx+tileWidth < destRec.width; dx += tileWidth) { for (;dx+tileWidth < destRec.width; dx += tileWidth)
{
DrawTexturePro(texture, (Rectangle){sourceRec.x, sourceRec.y, sourceRec.width, ((float)destRec.height/tileHeight)*sourceRec.height}, (Rectangle){destRec.x + dx, destRec.y, tileWidth, destRec.height}, origin, rotation, tint); DrawTexturePro(texture, (Rectangle){sourceRec.x, sourceRec.y, sourceRec.width, ((float)destRec.height/tileHeight)*sourceRec.height}, (Rectangle){destRec.x + dx, destRec.y, tileWidth, destRec.height}, origin, rotation, tint);
} }
// Fit last tile // Fit last tile
if(dx < destRec.width) { if (dx < destRec.width)
{
DrawTexturePro(texture, (Rectangle){sourceRec.x, sourceRec.y, ((float)(destRec.width - dx)/tileWidth)*sourceRec.width, ((float)destRec.height/tileHeight)*sourceRec.height}, DrawTexturePro(texture, (Rectangle){sourceRec.x, sourceRec.y, ((float)(destRec.width - dx)/tileWidth)*sourceRec.width, ((float)destRec.height/tileHeight)*sourceRec.height},
(Rectangle){destRec.x + dx, destRec.y, destRec.width - dx, destRec.height}, origin, rotation, tint); (Rectangle){destRec.x + dx, destRec.y, destRec.width - dx, destRec.height}, origin, rotation, tint);
} }
@ -3113,28 +3117,34 @@ void DrawTextureTiled(Texture2D texture, Rectangle sourceRec, Rectangle destRec,
{ {
// Tiled both horizontally and vertically (rows and columns) // Tiled both horizontally and vertically (rows and columns)
int dx = 0; int dx = 0;
for(;dx+tileWidth < destRec.width; dx += tileWidth) { for (;dx+tileWidth < destRec.width; dx += tileWidth)
{
int dy = 0; int dy = 0;
for(;dy+tileHeight < destRec.height; dy += tileHeight) { for (;dy+tileHeight < destRec.height; dy += tileHeight)
{
DrawTexturePro(texture, sourceRec, (Rectangle){destRec.x + dx, destRec.y + dy, tileWidth, tileHeight}, origin, rotation, tint); DrawTexturePro(texture, sourceRec, (Rectangle){destRec.x + dx, destRec.y + dy, tileWidth, tileHeight}, origin, rotation, tint);
} }
if(dy < destRec.height) { if (dy < destRec.height)
{
DrawTexturePro(texture, (Rectangle){sourceRec.x, sourceRec.y, sourceRec.width, ((float)(destRec.height - dy)/tileHeight)*sourceRec.height}, DrawTexturePro(texture, (Rectangle){sourceRec.x, sourceRec.y, sourceRec.width, ((float)(destRec.height - dy)/tileHeight)*sourceRec.height},
(Rectangle){destRec.x + dx, destRec.y + dy, tileWidth, destRec.height - dy}, origin, rotation, tint); (Rectangle){destRec.x + dx, destRec.y + dy, tileWidth, destRec.height - dy}, origin, rotation, tint);
} }
} }
// Fit last column of tiles // Fit last column of tiles
if(dx < destRec.width) { if (dx < destRec.width)
{
int dy = 0; int dy = 0;
for(;dy+tileHeight < destRec.height; dy += tileHeight) { for (;dy+tileHeight < destRec.height; dy += tileHeight)
{
DrawTexturePro(texture, (Rectangle){sourceRec.x, sourceRec.y, ((float)(destRec.width - dx)/tileWidth)*sourceRec.width, sourceRec.height}, DrawTexturePro(texture, (Rectangle){sourceRec.x, sourceRec.y, ((float)(destRec.width - dx)/tileWidth)*sourceRec.width, sourceRec.height},
(Rectangle){destRec.x + dx, destRec.y + dy, destRec.width - dx, tileHeight}, origin, rotation, tint); (Rectangle){destRec.x + dx, destRec.y + dy, destRec.width - dx, tileHeight}, origin, rotation, tint);
} }
// Draw final tile in the bottom right corner // Draw final tile in the bottom right corner
if(dy < destRec.height) { if (dy < destRec.height)
{
DrawTexturePro(texture, (Rectangle){sourceRec.x, sourceRec.y, ((float)(destRec.width - dx)/tileWidth)*sourceRec.width, ((float)(destRec.height - dy)/tileHeight)*sourceRec.height}, DrawTexturePro(texture, (Rectangle){sourceRec.x, sourceRec.y, ((float)(destRec.width - dx)/tileWidth)*sourceRec.width, ((float)(destRec.height - dy)/tileHeight)*sourceRec.height},
(Rectangle){destRec.x + dx, destRec.y + dy, destRec.width - dx, destRec.height - dy}, origin, rotation, tint); (Rectangle){destRec.x + dx, destRec.y + dy, destRec.width - dx, destRec.height - dy}, origin, rotation, tint);
} }