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

@ -1178,6 +1178,7 @@ 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)
{ {
@ -1185,6 +1186,7 @@ void DrawRectangleRoundedLines(Rectangle rec, float roundness, int segments, int
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

@ -3085,12 +3085,14 @@ void DrawTextureTiled(Texture2D texture, Rectangle sourceRec, Rectangle destRec,
{ {
// 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);
} }
@ -3099,12 +3101,14 @@ void DrawTextureTiled(Texture2D texture, Rectangle sourceRec, Rectangle destRec,
{ {
// 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);
} }