mirror of
https://github.com/raysan5/raylib.git
synced 2026-05-25 14:10:27 -04:00
Compare commits
10 Commits
b48933b096
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| 34b06ca587 | |||
| 4d845608b8 | |||
| eaf32c83bf | |||
| 808e6b9b20 | |||
| 7dd72e7328 | |||
| f8270483e1 | |||
| f17babfe8a | |||
| f65d5ad7a9 | |||
| 0d78f10161 | |||
| 7d5b61ce01 |
@ -11,7 +11,7 @@ Some people ported raylib to other languages in the form of bindings or wrappers
|
|||||||
| [raylib-beef](https://github.com/Starpelly/raylib-beef) | **5.5** | [Beef](https://www.beeflang.org) | MIT |
|
| [raylib-beef](https://github.com/Starpelly/raylib-beef) | **5.5** | [Beef](https://www.beeflang.org) | MIT |
|
||||||
| [raybit](https://github.com/Alex-Velez/raybit) | **5.0** | [Brainfuck](https://en.wikipedia.org/wiki/Brainfuck) | MIT |
|
| [raybit](https://github.com/Alex-Velez/raybit) | **5.0** | [Brainfuck](https://en.wikipedia.org/wiki/Brainfuck) | MIT |
|
||||||
| [raylib-c3](https://github.com/c3lang/vendor/tree/main/libraries/raylib6.c3l) | **6** | [C3](https://c3-lang.org) | MIT |
|
| [raylib-c3](https://github.com/c3lang/vendor/tree/main/libraries/raylib6.c3l) | **6** | [C3](https://c3-lang.org) | MIT |
|
||||||
| [raylib-cs](https://github.com/raylib-cs/raylib-cs) | **5.5** | [C#](https://en.wikipedia.org/wiki/C_Sharp_(programming_language)) | Zlib |
|
| [raylib-cs](https://github.com/raylib-cs/raylib-cs) | **6.0** | [C#](https://en.wikipedia.org/wiki/C_Sharp_(programming_language)) | Zlib |
|
||||||
| [Raylib-CsLo](https://github.com/NotNotTech/Raylib-CsLo) | 4.2 | [C#](https://en.wikipedia.org/wiki/C_Sharp_(programming_language)) | MPL-2.0 |
|
| [Raylib-CsLo](https://github.com/NotNotTech/Raylib-CsLo) | 4.2 | [C#](https://en.wikipedia.org/wiki/C_Sharp_(programming_language)) | MPL-2.0 |
|
||||||
| [Raylib-CSharp-Vinculum](https://github.com/ZeroElectric/Raylib-CSharp-Vinculum) | **5.0** | [C#](https://en.wikipedia.org/wiki/C_Sharp_(programming_language)) | MPL-2.0 |
|
| [Raylib-CSharp-Vinculum](https://github.com/ZeroElectric/Raylib-CSharp-Vinculum) | **5.0** | [C#](https://en.wikipedia.org/wiki/C_Sharp_(programming_language)) | MPL-2.0 |
|
||||||
| [Raylib-CSharp](https://github.com/MrScautHD/Raylib-CSharp) | **5.5** | [C#](https://en.wikipedia.org/wiki/C_Sharp_(programming_language)) | MIT |
|
| [Raylib-CSharp](https://github.com/MrScautHD/Raylib-CSharp) | **5.5** | [C#](https://en.wikipedia.org/wiki/C_Sharp_(programming_language)) | MIT |
|
||||||
@ -49,7 +49,7 @@ Some people ported raylib to other languages in the form of bindings or wrappers
|
|||||||
| [Raylib.jl](https://github.com/chengchingwen/Raylib.jl) | 4.2 | [Julia](https://julialang.org) | Zlib |
|
| [Raylib.jl](https://github.com/chengchingwen/Raylib.jl) | 4.2 | [Julia](https://julialang.org) | Zlib |
|
||||||
| [kaylib](https://github.com/electronstudio/kaylib) | 3.7 | [Kotlin/native](https://kotlinlang.org) | **???** |
|
| [kaylib](https://github.com/electronstudio/kaylib) | 3.7 | [Kotlin/native](https://kotlinlang.org) | **???** |
|
||||||
| [KaylibKit](https://codeberg.org/Kenta/KaylibKit) | 4.5 | [Kotlin/native](https://kotlinlang.org) | Zlib |
|
| [KaylibKit](https://codeberg.org/Kenta/KaylibKit) | 4.5 | [Kotlin/native](https://kotlinlang.org) | Zlib |
|
||||||
| [raylib-lua](https://github.com/TSnake41/raylib-lua) | 5.0 | [Lua](http://www.lua.org) | ISC |
|
| [raylib-lua](https://github.com/TSnake41/raylib-lua) | 5.5 | [Lua](http://www.lua.org) | ISC |
|
||||||
| [raylib-lua-bindings (WIP)](https://github.com/legendaryredfox/raylib-lua-bindings) | 5.5 | [Lua](http://www.lua.org) | ISC |
|
| [raylib-lua-bindings (WIP)](https://github.com/legendaryredfox/raylib-lua-bindings) | 5.5 | [Lua](http://www.lua.org) | ISC |
|
||||||
| [ReiLua](https://github.com/nullstare/ReiLua) | 5.5 | [Lua](http://www.lua.org) | MIT |
|
| [ReiLua](https://github.com/nullstare/ReiLua) | 5.5 | [Lua](http://www.lua.org) | MIT |
|
||||||
| [raylib-lua-sol](https://github.com/RobLoach/raylib-lua-sol) | 5.5 | [Lua](http://www.lua.org) | Zlib |
|
| [raylib-lua-sol](https://github.com/RobLoach/raylib-lua-sol) | 5.5 | [Lua](http://www.lua.org) | Zlib |
|
||||||
@ -90,7 +90,7 @@ Some people ported raylib to other languages in the form of bindings or wrappers
|
|||||||
| [raylib-vapi](https://github.com/lxmcf/raylib-vapi) | **6.0** | [Vala](https://vala.dev) | Zlib |
|
| [raylib-vapi](https://github.com/lxmcf/raylib-vapi) | **6.0** | [Vala](https://vala.dev) | Zlib |
|
||||||
| [raylib-wave](https://github.com/wavefnd/raylib-wave) | **auto** |[Wave](http://wave-lang.dev) | Zlib |
|
| [raylib-wave](https://github.com/wavefnd/raylib-wave) | **auto** |[Wave](http://wave-lang.dev) | Zlib |
|
||||||
| [raylib-wren](https://github.com/TSnake41/raylib-wren) | 4.5 | [Wren](http://wren.io) | ISC |
|
| [raylib-wren](https://github.com/TSnake41/raylib-wren) | 4.5 | [Wren](http://wren.io) | ISC |
|
||||||
| [raylib-zig](https://github.com/raylib-zig/raylib-zig) | **5.6-dev** | [Zig](https://ziglang.org) | MIT |
|
| [raylib-zig](https://github.com/raylib-zig/raylib-zig) | **6.0** | [Zig](https://ziglang.org) | MIT |
|
||||||
| [raylib.zig](https://github.com/ryupold/raylib.zig) | **5.1-dev** | [Zig](https://ziglang.org) | MIT |
|
| [raylib.zig](https://github.com/ryupold/raylib.zig) | **5.1-dev** | [Zig](https://ziglang.org) | MIT |
|
||||||
| [raylib-zig-bindings](https://github.com/L-Briand/raylib-zig-bindings) | **5.0** | [Zig](https://ziglang.org) | Zlib |
|
| [raylib-zig-bindings](https://github.com/L-Briand/raylib-zig-bindings) | **5.0** | [Zig](https://ziglang.org) | Zlib |
|
||||||
| [hare-raylib](https://git.sr.ht/~evantj/hare-raylib) | **auto** | [Hare](https://harelang.org) | Zlib |
|
| [hare-raylib](https://git.sr.ht/~evantj/hare-raylib) | **auto** | [Hare](https://harelang.org) | Zlib |
|
||||||
|
|||||||
81
src/external/rlsw.h
vendored
81
src/external/rlsw.h
vendored
@ -5385,6 +5385,16 @@ static void SW_RASTER_TRIANGLE_SPAN(const sw_vertex_t *start, const sw_vertex_t
|
|||||||
int xEnd = (int)end->position[0];
|
int xEnd = (int)end->position[0];
|
||||||
if (xStart == xEnd) return;
|
if (xStart == xEnd) return;
|
||||||
|
|
||||||
|
// Intercept the span bounds to ensure to not write before the framebuffer
|
||||||
|
int xLoopStart = (xStart >= 0)? xStart : 0;
|
||||||
|
int xLoopEnd = (xEnd <= RLSW.colorBuffer->width)? xEnd : RLSW.colorBuffer->width;
|
||||||
|
if (xLoopStart >= xLoopEnd) return; // Nothing to draw
|
||||||
|
|
||||||
|
// Get the current row and skip if outside the framebuffer
|
||||||
|
// Maybe this check is better suited elsewhere?
|
||||||
|
int y = (int)start->position[1];
|
||||||
|
if (y < 0 || y >= RLSW.colorBuffer->height) return;
|
||||||
|
|
||||||
// Compute the inverse horizontal distance along the X axis
|
// Compute the inverse horizontal distance along the X axis
|
||||||
float dxRcp = sw_rcp(end->position[0] - start->position[0]);
|
float dxRcp = sw_rcp(end->position[0] - start->position[0]);
|
||||||
|
|
||||||
@ -5405,27 +5415,29 @@ static void SW_RASTER_TRIANGLE_SPAN(const sw_vertex_t *start, const sw_vertex_t
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Compute the subpixel distance to traverse before the first pixel
|
// Compute the subpixel distance to traverse before the first pixel
|
||||||
|
// Also step further into them to move away from the colorbuffer edge
|
||||||
float xSubstep = 1.0f - sw_fract(start->position[0]);
|
float xSubstep = 1.0f - sw_fract(start->position[0]);
|
||||||
|
float dxStart = (float)(xLoopStart - xStart);
|
||||||
|
float xOffset = xSubstep + dxStart;
|
||||||
|
|
||||||
// Initializing the interpolation starting values
|
// Initializing the interpolation starting values
|
||||||
float w = start->position[3] + dWdx*xSubstep;
|
float w = start->position[3] + dWdx*xOffset;
|
||||||
float color[4] = {
|
float color[4] = {
|
||||||
start->color[0] + dCdx[0]*xSubstep,
|
start->color[0] + dCdx[0]*xOffset,
|
||||||
start->color[1] + dCdx[1]*xSubstep,
|
start->color[1] + dCdx[1]*xOffset,
|
||||||
start->color[2] + dCdx[2]*xSubstep,
|
start->color[2] + dCdx[2]*xOffset,
|
||||||
start->color[3] + dCdx[3]*xSubstep
|
start->color[3] + dCdx[3]*xOffset
|
||||||
};
|
};
|
||||||
#ifdef SW_ENABLE_DEPTH_TEST
|
#ifdef SW_ENABLE_DEPTH_TEST
|
||||||
float z = start->position[2] + dZdx*xSubstep;
|
float z = start->position[2] + dZdx*xOffset;
|
||||||
#endif
|
#endif
|
||||||
#ifdef SW_ENABLE_TEXTURE
|
#ifdef SW_ENABLE_TEXTURE
|
||||||
float u = start->texcoord[0] + dUdx*xSubstep;
|
float u = start->texcoord[0] + dUdx*xOffset;
|
||||||
float v = start->texcoord[1] + dVdx*xSubstep;
|
float v = start->texcoord[1] + dVdx*xOffset;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Pre-calculate the starting pointers for the framebuffer row
|
// Pre-calculate the starting pointers for the framebuffer row
|
||||||
int y = (int)start->position[1];
|
int baseOffset = y*RLSW.colorBuffer->width + xLoopStart;
|
||||||
int baseOffset = y*RLSW.colorBuffer->width + xStart;
|
|
||||||
uint8_t *cPtr = (uint8_t *)(RLSW.colorBuffer->pixels) + baseOffset*SW_FRAMEBUFFER_COLOR_SIZE;
|
uint8_t *cPtr = (uint8_t *)(RLSW.colorBuffer->pixels) + baseOffset*SW_FRAMEBUFFER_COLOR_SIZE;
|
||||||
#ifdef SW_ENABLE_DEPTH_TEST
|
#ifdef SW_ENABLE_DEPTH_TEST
|
||||||
uint8_t *dPtr = (uint8_t *)(RLSW.depthBuffer->pixels) + baseOffset*SW_FRAMEBUFFER_DEPTH_SIZE;
|
uint8_t *dPtr = (uint8_t *)(RLSW.depthBuffer->pixels) + baseOffset*SW_FRAMEBUFFER_DEPTH_SIZE;
|
||||||
@ -5433,12 +5445,12 @@ static void SW_RASTER_TRIANGLE_SPAN(const sw_vertex_t *start, const sw_vertex_t
|
|||||||
|
|
||||||
#define SW_AFFINE_BLOCK 16
|
#define SW_AFFINE_BLOCK 16
|
||||||
|
|
||||||
int x = xStart;
|
int x = xLoopStart;
|
||||||
while (x < xEnd)
|
while (x < xLoopEnd)
|
||||||
{
|
{
|
||||||
// Clamp last block to remaining pixels
|
// Clamp last block to remaining pixels
|
||||||
int blockEnd = x + SW_AFFINE_BLOCK;
|
int blockEnd = x + SW_AFFINE_BLOCK;
|
||||||
if (blockEnd > xEnd) blockEnd = xEnd;
|
if (blockEnd > xLoopEnd) blockEnd = xLoopEnd;
|
||||||
float blockLenF = (float)(blockEnd - x);
|
float blockLenF = (float)(blockEnd - x);
|
||||||
float blockLenRcp = sw_rcp(blockLenF);
|
float blockLenRcp = sw_rcp(blockLenF);
|
||||||
|
|
||||||
@ -5673,6 +5685,14 @@ static void SW_RASTER_QUAD(const sw_vertex_t *a, const sw_vertex_t *b,
|
|||||||
int xMax = (int)br->position[0];
|
int xMax = (int)br->position[0];
|
||||||
int yMax = (int)br->position[1];
|
int yMax = (int)br->position[1];
|
||||||
|
|
||||||
|
// Exit early if no pixels to draw. Use these later for loop boundaries
|
||||||
|
int yLoopMin = (yMin >= 0)? yMin : 0;
|
||||||
|
int xLoopMin = (xMin >= 0)? xMin : 0;
|
||||||
|
int yLoopMax = (yMax <= RLSW.colorBuffer->height)? yMax : RLSW.colorBuffer->height;
|
||||||
|
int xLoopMax = (xMax <= RLSW.colorBuffer->width)? xMax : RLSW.colorBuffer->width;
|
||||||
|
|
||||||
|
if (yLoopMin >= yLoopMax || xLoopMin >= xLoopMax) return;
|
||||||
|
|
||||||
float w = (float)(xMax - xMin);
|
float w = (float)(xMax - xMin);
|
||||||
float h = (float)(yMax - yMin);
|
float h = (float)(yMax - yMin);
|
||||||
if ((w <= 0) || (h <= 0)) return;
|
if ((w <= 0) || (h <= 0)) return;
|
||||||
@ -5726,21 +5746,44 @@ static void SW_RASTER_QUAD(const sw_vertex_t *a, const sw_vertex_t *b,
|
|||||||
uint8_t *dPixels = RLSW.depthBuffer->pixels;
|
uint8_t *dPixels = RLSW.depthBuffer->pixels;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
for (int y = yMin; y < yMax; y++)
|
// Calculate the distance the in-bounds boundary is from the quad's edges, only on the left and top
|
||||||
|
float dxMin = (float)(xLoopMin - xMin);
|
||||||
|
float dyMin = (float)(yLoopMin - yMin);
|
||||||
|
|
||||||
|
// Correct our start by how far it's clipped outside the framebuffer
|
||||||
|
cRow[0] += dCdx[0]*dxMin + dCdy[0]*dyMin;
|
||||||
|
cRow[1] += dCdx[1]*dxMin + dCdy[1]*dyMin;
|
||||||
|
cRow[2] += dCdx[2]*dxMin + dCdy[2]*dyMin;
|
||||||
|
cRow[3] += dCdx[3]*dxMin + dCdy[3]*dyMin;
|
||||||
|
#ifdef SW_ENABLE_DEPTH_TEST
|
||||||
|
zRow += dZdy*dyMin + dZdx*dxMin;
|
||||||
|
#endif
|
||||||
|
#ifdef SW_ENABLE_TEXTURE
|
||||||
|
uRow += dUdy*dyMin + dUdx*dxMin;
|
||||||
|
vRow += dVdy*dyMin + dVdx*dxMin;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
for (int y = yLoopMin; y < yLoopMax; y++)
|
||||||
{
|
{
|
||||||
int baseOffset = y*stride + xMin;
|
int baseOffset = y*stride + xLoopMin;
|
||||||
uint8_t *cPtr = cPixels + baseOffset*SW_FRAMEBUFFER_COLOR_SIZE;
|
uint8_t *cPtr = cPixels + baseOffset*SW_FRAMEBUFFER_COLOR_SIZE;
|
||||||
#ifdef SW_ENABLE_DEPTH_TEST
|
#ifdef SW_ENABLE_DEPTH_TEST
|
||||||
uint8_t *dPtr = dPixels + baseOffset*SW_FRAMEBUFFER_DEPTH_SIZE;
|
uint8_t *dPtr = dPixels + baseOffset*SW_FRAMEBUFFER_DEPTH_SIZE;
|
||||||
|
// Copy the cursors without destroying the offset maths
|
||||||
float z = zRow;
|
float z = zRow;
|
||||||
#endif
|
#endif
|
||||||
#ifdef SW_ENABLE_TEXTURE
|
#ifdef SW_ENABLE_TEXTURE
|
||||||
float u = uRow;
|
float u = uRow;
|
||||||
float v = vRow;
|
float v = vRow;
|
||||||
#endif
|
#endif
|
||||||
float color[4] = { cRow[0], cRow[1], cRow[2], cRow[3] };
|
float color[4] = {
|
||||||
|
cRow[0],
|
||||||
|
cRow[1],
|
||||||
|
cRow[2],
|
||||||
|
cRow[3]
|
||||||
|
};
|
||||||
|
|
||||||
for (int x = xMin; x < xMax; x++)
|
for (int x = xLoopMin; x < xLoopMax; x++)
|
||||||
{
|
{
|
||||||
float srcColor[4] = { color[0], color[1], color[2], color[3] };
|
float srcColor[4] = { color[0], color[1], color[2], color[3] };
|
||||||
|
|
||||||
@ -5779,6 +5822,7 @@ static void SW_RASTER_QUAD(const sw_vertex_t *a, const sw_vertex_t *b,
|
|||||||
#ifdef SW_ENABLE_DEPTH_TEST
|
#ifdef SW_ENABLE_DEPTH_TEST
|
||||||
discard:
|
discard:
|
||||||
#endif
|
#endif
|
||||||
|
// Move one pixel over without touching the original "start offset"
|
||||||
color[0] += dCdx[0];
|
color[0] += dCdx[0];
|
||||||
color[1] += dCdx[1];
|
color[1] += dCdx[1];
|
||||||
color[2] += dCdx[2];
|
color[2] += dCdx[2];
|
||||||
@ -5801,6 +5845,9 @@ static void SW_RASTER_QUAD(const sw_vertex_t *a, const sw_vertex_t *b,
|
|||||||
cPtr += SW_FRAMEBUFFER_COLOR_SIZE;
|
cPtr += SW_FRAMEBUFFER_COLOR_SIZE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// The for loop is clamped to the right side of the screen
|
||||||
|
// However, these cursor start vars are still on the left
|
||||||
|
// That's fine, advancing to the next row
|
||||||
cRow[0] += dCdy[0];
|
cRow[0] += dCdy[0];
|
||||||
cRow[1] += dCdy[1];
|
cRow[1] += dCdy[1];
|
||||||
cRow[2] += dCdy[2];
|
cRow[2] += dCdy[2];
|
||||||
|
|||||||
@ -1164,7 +1164,7 @@ RLAPI bool ChangeDirectory(const char *dirPath); // Change wo
|
|||||||
RLAPI bool IsPathFile(const char *path); // Check if a given path is a file or a directory
|
RLAPI bool IsPathFile(const char *path); // Check if a given path is a file or a directory
|
||||||
RLAPI bool IsFileNameValid(const char *fileName); // Check if fileName is valid for the platform/OS
|
RLAPI bool IsFileNameValid(const char *fileName); // Check if fileName is valid for the platform/OS
|
||||||
RLAPI FilePathList LoadDirectoryFiles(const char *dirPath); // Load directory filepaths, files and directories, no subdirs scan
|
RLAPI FilePathList LoadDirectoryFiles(const char *dirPath); // Load directory filepaths, files and directories, no subdirs scan
|
||||||
RLAPI FilePathList LoadDirectoryFilesEx(const char *basePath, const char *filter, bool scanSubdirs); // Load directory filepaths with extension filtering and subdir scan; some filters available: `*.*`,`FILES*`,`DIRS*`
|
RLAPI FilePathList LoadDirectoryFilesEx(const char *basePath, const char *filter, bool scanSubdirs); // Load directory filepaths with extension filtering and subdir scan; some filters available: '*.*','FILES*','DIRS*'
|
||||||
RLAPI void UnloadDirectoryFiles(FilePathList files); // Unload filepaths
|
RLAPI void UnloadDirectoryFiles(FilePathList files); // Unload filepaths
|
||||||
RLAPI bool IsFileDropped(void); // Check if a file has been dropped into window
|
RLAPI bool IsFileDropped(void); // Check if a file has been dropped into window
|
||||||
RLAPI FilePathList LoadDroppedFiles(void); // Load dropped filepaths
|
RLAPI FilePathList LoadDroppedFiles(void); // Load dropped filepaths
|
||||||
|
|||||||
@ -361,7 +361,7 @@ void DrawCircleSector(Vector2 center, float radius, float startAngle, float endA
|
|||||||
{
|
{
|
||||||
// Calculate the maximum angle between segments based on the error rate (usually 0.5f)
|
// Calculate the maximum angle between segments based on the error rate (usually 0.5f)
|
||||||
float th = acosf(2*powf(1 - SMOOTH_CIRCLE_ERROR_RATE/radius, 2) - 1);
|
float th = acosf(2*powf(1 - SMOOTH_CIRCLE_ERROR_RATE/radius, 2) - 1);
|
||||||
segments = (int)((endAngle - startAngle)*ceilf(2*PI/th)/360);
|
segments = (int)ceilf((endAngle - startAngle)*(2*PI/th)/360.0f);
|
||||||
|
|
||||||
if (segments <= 0) segments = minSegments;
|
if (segments <= 0) segments = minSegments;
|
||||||
}
|
}
|
||||||
@ -453,7 +453,7 @@ void DrawCircleSectorLines(Vector2 center, float radius, float startAngle, float
|
|||||||
{
|
{
|
||||||
// Calculate the maximum angle between segments based on the error rate (usually 0.5f)
|
// Calculate the maximum angle between segments based on the error rate (usually 0.5f)
|
||||||
float th = acosf(2*powf(1 - SMOOTH_CIRCLE_ERROR_RATE/radius, 2) - 1);
|
float th = acosf(2*powf(1 - SMOOTH_CIRCLE_ERROR_RATE/radius, 2) - 1);
|
||||||
segments = (int)((endAngle - startAngle)*ceilf(2*PI/th)/360);
|
segments = (int)ceilf((endAngle - startAngle)*(2*PI/th)/360.0f);
|
||||||
|
|
||||||
if (segments <= 0) segments = minSegments;
|
if (segments <= 0) segments = minSegments;
|
||||||
}
|
}
|
||||||
@ -579,7 +579,7 @@ void DrawRing(Vector2 center, float innerRadius, float outerRadius, float startA
|
|||||||
{
|
{
|
||||||
// Calculate the maximum angle between segments based on the error rate (usually 0.5f)
|
// Calculate the maximum angle between segments based on the error rate (usually 0.5f)
|
||||||
float th = acosf(2*powf(1 - SMOOTH_CIRCLE_ERROR_RATE/outerRadius, 2) - 1);
|
float th = acosf(2*powf(1 - SMOOTH_CIRCLE_ERROR_RATE/outerRadius, 2) - 1);
|
||||||
segments = (int)((endAngle - startAngle)*ceilf(2*PI/th)/360);
|
segments = (int)ceilf((endAngle - startAngle)*(2*PI/th)/360.0f);
|
||||||
|
|
||||||
if (segments <= 0) segments = minSegments;
|
if (segments <= 0) segments = minSegments;
|
||||||
}
|
}
|
||||||
@ -670,7 +670,7 @@ void DrawRingLines(Vector2 center, float innerRadius, float outerRadius, float s
|
|||||||
{
|
{
|
||||||
// Calculate the maximum angle between segments based on the error rate (usually 0.5f)
|
// Calculate the maximum angle between segments based on the error rate (usually 0.5f)
|
||||||
float th = acosf(2*powf(1 - SMOOTH_CIRCLE_ERROR_RATE/outerRadius, 2) - 1);
|
float th = acosf(2*powf(1 - SMOOTH_CIRCLE_ERROR_RATE/outerRadius, 2) - 1);
|
||||||
segments = (int)((endAngle - startAngle)*ceilf(2*PI/th)/360);
|
segments = (int)ceilf((endAngle - startAngle)*(2*PI/th)/360.0f);
|
||||||
|
|
||||||
if (segments <= 0) segments = minSegments;
|
if (segments <= 0) segments = minSegments;
|
||||||
}
|
}
|
||||||
@ -960,7 +960,7 @@ void DrawRectangleRounded(Rectangle rec, float roundness, int segments, Color co
|
|||||||
{
|
{
|
||||||
// Calculate the maximum angle between segments based on the error rate (usually 0.5f)
|
// Calculate the maximum angle between segments based on the error rate (usually 0.5f)
|
||||||
float th = acosf(2*powf(1 - SMOOTH_CIRCLE_ERROR_RATE/radius, 2) - 1);
|
float th = acosf(2*powf(1 - SMOOTH_CIRCLE_ERROR_RATE/radius, 2) - 1);
|
||||||
segments = (int)(ceilf(2*PI/th)/2.0f);
|
segments = (int)ceilf((2*PI/th)/4.0f);
|
||||||
if (segments <= 0) segments = 4;
|
if (segments <= 0) segments = 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1195,7 +1195,7 @@ void DrawRectangleRoundedLinesEx(Rectangle rec, float roundness, int segments, f
|
|||||||
{
|
{
|
||||||
// Calculate the maximum angle between segments based on the error rate (usually 0.5f)
|
// Calculate the maximum angle between segments based on the error rate (usually 0.5f)
|
||||||
float th = acosf(2*powf(1 - SMOOTH_CIRCLE_ERROR_RATE/radius, 2) - 1);
|
float th = acosf(2*powf(1 - SMOOTH_CIRCLE_ERROR_RATE/radius, 2) - 1);
|
||||||
segments = (int)(ceilf(2*PI/th)/2.0f);
|
segments = (int)ceilf((2*PI/th)/4.0f);
|
||||||
if (segments <= 0) segments = 4;
|
if (segments <= 0) segments = 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -675,13 +675,12 @@ int main(int argc, char *argv[])
|
|||||||
// WARNING 2: raylib.a and raylib.web.a must be available when compiling locally
|
// WARNING 2: raylib.a and raylib.web.a must be available when compiling locally
|
||||||
#if defined(_WIN32)
|
#if defined(_WIN32)
|
||||||
LOG("INFO: [%s] Building example for PLATFORM_WEB (Host: Win32)\n", GetFileNameWithoutExt(inFileName));
|
LOG("INFO: [%s] Building example for PLATFORM_WEB (Host: Win32)\n", GetFileNameWithoutExt(inFileName));
|
||||||
//putenv("RAYLIB_DIR=C:\\GitHub\\raylib");
|
|
||||||
_putenv("PATH=%PATH%;C:\\raylib\\w64devkit\\bin");
|
_putenv("PATH=%PATH%;C:\\raylib\\w64devkit\\bin");
|
||||||
system(TextFormat("mingw32-make -C %s -f Makefile.Web %s/%s PLATFORM=PLATFORM_WEB -B", exBasePath, exCategory, exName));
|
|
||||||
#else
|
#else
|
||||||
LOG("INFO: [%s] Building example for PLATFORM_WEB (Host: POSIX)\n", GetFileNameWithoutExt(inFileName));
|
LOG("INFO: [%s] Building example for PLATFORM_WEB (Host: POSIX)\n", GetFileNameWithoutExt(inFileName));
|
||||||
system(TextFormat("make -C %s -f Makefile.Web %s/%s PLATFORM=PLATFORM_WEB -B", exBasePath, exCategory, exName));
|
|
||||||
#endif
|
#endif
|
||||||
|
system(TextFormat("make -C %s -f Makefile.Web %s/%s PLATFORM=PLATFORM_WEB -B", exBasePath, exCategory, exName));
|
||||||
|
|
||||||
// Update generated .html metadata
|
// Update generated .html metadata
|
||||||
LOG("INFO: [%s] Updating HTML Metadata...\n", TextFormat("%s.html", exName));
|
LOG("INFO: [%s] Updating HTML Metadata...\n", TextFormat("%s.html", exName));
|
||||||
UpdateWebMetadata(TextFormat("%s/%s/%s.html", exBasePath, exCategory, exName),
|
UpdateWebMetadata(TextFormat("%s/%s/%s.html", exBasePath, exCategory, exName),
|
||||||
@ -778,10 +777,9 @@ int main(int argc, char *argv[])
|
|||||||
// WARNING: EMSDK_PATH must be set to proper location when calling from GitHub Actions
|
// WARNING: EMSDK_PATH must be set to proper location when calling from GitHub Actions
|
||||||
#if defined(_WIN32)
|
#if defined(_WIN32)
|
||||||
_putenv("PATH=%PATH%;C:\\raylib\\w64devkit\\bin");
|
_putenv("PATH=%PATH%;C:\\raylib\\w64devkit\\bin");
|
||||||
system(TextFormat("mingw32-make -C %s -f Makefile.Web %s/%s PLATFORM=PLATFORM_WEB -B", exBasePath, exRecategory, exRename));
|
|
||||||
#else
|
|
||||||
system(TextFormat("make -C %s -f Makefile.Web %s/%s PLATFORM=PLATFORM_WEB -B", exBasePath, exRecategory, exRename));
|
|
||||||
#endif
|
#endif
|
||||||
|
system(TextFormat("make -C %s -f Makefile.Web %s/%s PLATFORM=PLATFORM_WEB -B", exBasePath, exRecategory, exRename));
|
||||||
|
|
||||||
// Update generated .html metadata
|
// Update generated .html metadata
|
||||||
UpdateWebMetadata(TextFormat("%s/%s/%s.html", exBasePath, exCategory, exRename),
|
UpdateWebMetadata(TextFormat("%s/%s/%s.html", exBasePath, exCategory, exRename),
|
||||||
TextFormat("%s/%s/%s.c", exBasePath, exCategory, exRename));
|
TextFormat("%s/%s/%s.c", exBasePath, exCategory, exRename));
|
||||||
@ -917,7 +915,7 @@ int main(int argc, char *argv[])
|
|||||||
// Set required environment variables
|
// Set required environment variables
|
||||||
//putenv(TextFormat("RAYLIB_DIR=%s\\..", exBasePath));
|
//putenv(TextFormat("RAYLIB_DIR=%s\\..", exBasePath));
|
||||||
_putenv("PATH=%PATH%;C:\\raylib\\w64devkit\\bin");
|
_putenv("PATH=%PATH%;C:\\raylib\\w64devkit\\bin");
|
||||||
//putenv("MAKE=mingw32-make");
|
//putenv("MAKE=make");
|
||||||
//ChangeDirectory(exBasePath);
|
//ChangeDirectory(exBasePath);
|
||||||
#endif
|
#endif
|
||||||
for (int i = 0; i < exBuildListCount; i++)
|
for (int i = 0; i < exBuildListCount; i++)
|
||||||
@ -933,7 +931,7 @@ int main(int argc, char *argv[])
|
|||||||
// Build example for PLATFORM_DESKTOP
|
// Build example for PLATFORM_DESKTOP
|
||||||
#if defined(_WIN32)
|
#if defined(_WIN32)
|
||||||
LOG("INFO: [%s] Building example for PLATFORM_DESKTOP (Host: Win32)\n", exName);
|
LOG("INFO: [%s] Building example for PLATFORM_DESKTOP (Host: Win32)\n", exName);
|
||||||
system(TextFormat("mingw32-make -C %s %s/%s PLATFORM=PLATFORM_DESKTOP -B", exBasePath, exCategory, exName));
|
system(TextFormat("make -C %s %s/%s PLATFORM=PLATFORM_DESKTOP -B", exBasePath, exCategory, exName));
|
||||||
#elif defined(PLATFORM_DRM)
|
#elif defined(PLATFORM_DRM)
|
||||||
LOG("INFO: [%s] Building example for PLATFORM_DRM (Host: POSIX)\n", exName);
|
LOG("INFO: [%s] Building example for PLATFORM_DRM (Host: POSIX)\n", exName);
|
||||||
system(TextFormat("make -C %s %s/%s PLATFORM=PLATFORM_DRM -B > %s/%s/logs/%s.build.log 2>&1",
|
system(TextFormat("make -C %s %s/%s PLATFORM=PLATFORM_DRM -B > %s/%s/logs/%s.build.log 2>&1",
|
||||||
@ -949,13 +947,9 @@ int main(int argc, char *argv[])
|
|||||||
// Build: raylib.com/examples/<category>/<category>_example_name.data
|
// Build: raylib.com/examples/<category>/<category>_example_name.data
|
||||||
// Build: raylib.com/examples/<category>/<category>_example_name.wasm
|
// Build: raylib.com/examples/<category>/<category>_example_name.wasm
|
||||||
// Build: raylib.com/examples/<category>/<category>_example_name.js
|
// Build: raylib.com/examples/<category>/<category>_example_name.js
|
||||||
#if defined(_WIN32)
|
LOG("INFO: [%s] Building example for PLATFORM_WEB\n", exName);
|
||||||
LOG("INFO: [%s] Building example for PLATFORM_WEB (Host: Win32)\n", exName);
|
|
||||||
system(TextFormat("mingw32-make -C %s -f Makefile.Web %s/%s PLATFORM=PLATFORM_WEB -B", exBasePath, exCategory, exName));
|
|
||||||
#else
|
|
||||||
LOG("INFO: [%s] Building example for PLATFORM_WEB (Host: POSIX)\n", exName);
|
|
||||||
system(TextFormat("make -C %s -f Makefile.Web %s/%s PLATFORM=PLATFORM_WEB -B", exBasePath, exCategory, exName));
|
system(TextFormat("make -C %s -f Makefile.Web %s/%s PLATFORM=PLATFORM_WEB -B", exBasePath, exCategory, exName));
|
||||||
#endif
|
|
||||||
// Update generated .html metadata
|
// Update generated .html metadata
|
||||||
LOG("INFO: [%s] Updating HTML Metadata...\n", TextFormat("%s.html", exName));
|
LOG("INFO: [%s] Updating HTML Metadata...\n", TextFormat("%s.html", exName));
|
||||||
UpdateWebMetadata(TextFormat("%s/%s/%s.html", exBasePath, exCategory, exName),
|
UpdateWebMetadata(TextFormat("%s/%s/%s.html", exBasePath, exCategory, exName),
|
||||||
@ -1312,11 +1306,10 @@ int main(int argc, char *argv[])
|
|||||||
#if defined(_WIN32)
|
#if defined(_WIN32)
|
||||||
LOG("INFO: [%s] Building example for PLATFORM_WEB (Host: Win32)\n", exInfo->name);
|
LOG("INFO: [%s] Building example for PLATFORM_WEB (Host: Win32)\n", exInfo->name);
|
||||||
_putenv("PATH=%PATH%;C:\\raylib\\w64devkit\\bin");
|
_putenv("PATH=%PATH%;C:\\raylib\\w64devkit\\bin");
|
||||||
system(TextFormat("mingw32-make -C %s -f Makefile.Web %s/%s PLATFORM=PLATFORM_WEB -B", exBasePath, exInfo->category, exInfo->name));
|
|
||||||
#else
|
#else
|
||||||
LOG("INFO: [%s] Building example for PLATFORM_WEB (Host: POSIX)\n", exInfo->name);
|
LOG("INFO: [%s] Building example for PLATFORM_WEB (Host: POSIX)\n", exInfo->name);
|
||||||
system(TextFormat("make -C %s -f Makefile.Web %s/%s PLATFORM=PLATFORM_WEB -B", exBasePath, exInfo->category, exInfo->name));
|
|
||||||
#endif
|
#endif
|
||||||
|
system(TextFormat("make -C %s -f Makefile.Web %s/%s PLATFORM=PLATFORM_WEB -B", exBasePath, exInfo->category, exInfo->name));
|
||||||
|
|
||||||
// Update generated .html metadata
|
// Update generated .html metadata
|
||||||
LOG("INFO: [%s.html] Updating HTML Metadata...\n", exInfo->name);
|
LOG("INFO: [%s.html] Updating HTML Metadata...\n", exInfo->name);
|
||||||
@ -1495,7 +1488,7 @@ int main(int argc, char *argv[])
|
|||||||
// Set required environment variables
|
// Set required environment variables
|
||||||
//putenv(TextFormat("RAYLIB_DIR=%s\\..", exBasePath));
|
//putenv(TextFormat("RAYLIB_DIR=%s\\..", exBasePath));
|
||||||
//_putenv("PATH=%PATH%;C:\\raylib\\w64devkit\\bin");
|
//_putenv("PATH=%PATH%;C:\\raylib\\w64devkit\\bin");
|
||||||
//putenv("MAKE=mingw32-make");
|
//putenv("MAKE=make");
|
||||||
//ChangeDirectory(exBasePath);
|
//ChangeDirectory(exBasePath);
|
||||||
//_putenv("MAKE_PATH=C:\\raylib\\w64devkit\\bin");
|
//_putenv("MAKE_PATH=C:\\raylib\\w64devkit\\bin");
|
||||||
//_putenv("EMSDK_PATH = C:\\raylib\\emsdk");
|
//_putenv("EMSDK_PATH = C:\\raylib\\emsdk");
|
||||||
@ -1592,7 +1585,7 @@ int main(int argc, char *argv[])
|
|||||||
// Build: raylib.com/examples/<category>/<category>_example_name.js
|
// Build: raylib.com/examples/<category>/<category>_example_name.js
|
||||||
#if defined(_WIN32)
|
#if defined(_WIN32)
|
||||||
LOG("INFO: [%s] Building example for PLATFORM_WEB (Host: Win32)\n", exName);
|
LOG("INFO: [%s] Building example for PLATFORM_WEB (Host: Win32)\n", exName);
|
||||||
system(TextFormat("mingw32-make -C %s -f Makefile.Web %s/%s PLATFORM=PLATFORM_WEB -B > %s/%s/logs/%s.build.log 2>&1",
|
system(TextFormat("make -C %s -f Makefile.Web %s/%s PLATFORM=PLATFORM_WEB -B > %s/%s/logs/%s.build.log 2>&1",
|
||||||
exBasePath, exCategory, exName, exBasePath, exCategory, exName));
|
exBasePath, exCategory, exName, exBasePath, exCategory, exName));
|
||||||
#else
|
#else
|
||||||
LOG("INFO: [%s] Building example for PLATFORM_WEB (Host: POSIX)\n", exName);
|
LOG("INFO: [%s] Building example for PLATFORM_WEB (Host: POSIX)\n", exName);
|
||||||
@ -1641,13 +1634,13 @@ int main(int argc, char *argv[])
|
|||||||
// Set required environment variables
|
// Set required environment variables
|
||||||
//putenv(TextFormat("RAYLIB_DIR=%s\\..", exBasePath));
|
//putenv(TextFormat("RAYLIB_DIR=%s\\..", exBasePath));
|
||||||
_putenv("PATH=%PATH%;C:\\raylib\\w64devkit\\bin");
|
_putenv("PATH=%PATH%;C:\\raylib\\w64devkit\\bin");
|
||||||
//putenv("MAKE=mingw32-make");
|
//putenv("MAKE=make");
|
||||||
//ChangeDirectory(exBasePath);
|
//ChangeDirectory(exBasePath);
|
||||||
#endif
|
#endif
|
||||||
// Build example for PLATFORM_DESKTOP
|
// Build example for PLATFORM_DESKTOP
|
||||||
#if defined(_WIN32)
|
#if defined(_WIN32)
|
||||||
LOG("INFO: [%s] Building example for PLATFORM_DESKTOP (Host: Win32)\n", exName);
|
LOG("INFO: [%s] Building example for PLATFORM_DESKTOP (Host: Win32)\n", exName);
|
||||||
system(TextFormat("mingw32-make -C %s %s/%s PLATFORM=PLATFORM_DESKTOP -B > %s/%s/logs/%s.build.log 2>&1",
|
system(TextFormat("make -C %s %s/%s PLATFORM=PLATFORM_DESKTOP -B > %s/%s/logs/%s.build.log 2>&1",
|
||||||
exBasePath, exCategory, exName, exBasePath, exCategory, exName));
|
exBasePath, exCategory, exName, exBasePath, exCategory, exName));
|
||||||
#elif defined(PLATFORM_DRM)
|
#elif defined(PLATFORM_DRM)
|
||||||
LOG("INFO: [%s] Building example for PLATFORM_DRM (Host: POSIX)\n", exName);
|
LOG("INFO: [%s] Building example for PLATFORM_DRM (Host: POSIX)\n", exName);
|
||||||
|
|||||||
@ -4696,7 +4696,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "LoadDirectoryFilesEx",
|
"name": "LoadDirectoryFilesEx",
|
||||||
"description": "Load directory filepaths with extension filtering and subdir scan; some filters available: `*.*`,`FILES*`,`DIRS*`",
|
"description": "Load directory filepaths with extension filtering and subdir scan; some filters available: '*.*','FILES*','DIRS*'",
|
||||||
"returnType": "FilePathList",
|
"returnType": "FilePathList",
|
||||||
"params": [
|
"params": [
|
||||||
{
|
{
|
||||||
|
|||||||
@ -4207,7 +4207,7 @@ return {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
name = "LoadDirectoryFilesEx",
|
name = "LoadDirectoryFilesEx",
|
||||||
description = "Load directory filepaths with extension filtering and subdir scan; some filters available: `*.*`,`FILES*`,`DIRS*`",
|
description = "Load directory filepaths with extension filtering and subdir scan; some filters available: '*.*','FILES*','DIRS*'",
|
||||||
returnType = "FilePathList",
|
returnType = "FilePathList",
|
||||||
params = {
|
params = {
|
||||||
{type = "const char *", name = "basePath"},
|
{type = "const char *", name = "basePath"},
|
||||||
|
|||||||
@ -1789,7 +1789,7 @@ Function 146: LoadDirectoryFiles() (1 input parameters)
|
|||||||
Function 147: LoadDirectoryFilesEx() (3 input parameters)
|
Function 147: LoadDirectoryFilesEx() (3 input parameters)
|
||||||
Name: LoadDirectoryFilesEx
|
Name: LoadDirectoryFilesEx
|
||||||
Return type: FilePathList
|
Return type: FilePathList
|
||||||
Description: Load directory filepaths with extension filtering and subdir scan; some filters available: `*.*`,`FILES*`,`DIRS*`
|
Description: Load directory filepaths with extension filtering and subdir scan; some filters available: '*.*','FILES*','DIRS*'
|
||||||
Param[1]: basePath (type: const char *)
|
Param[1]: basePath (type: const char *)
|
||||||
Param[2]: filter (type: const char *)
|
Param[2]: filter (type: const char *)
|
||||||
Param[3]: scanSubdirs (type: bool)
|
Param[3]: scanSubdirs (type: bool)
|
||||||
|
|||||||
@ -1125,7 +1125,7 @@
|
|||||||
<Function name="LoadDirectoryFiles" retType="FilePathList" paramCount="1" desc="Load directory filepaths, files and directories, no subdirs scan">
|
<Function name="LoadDirectoryFiles" retType="FilePathList" paramCount="1" desc="Load directory filepaths, files and directories, no subdirs scan">
|
||||||
<Param type="const char *" name="dirPath" desc="" />
|
<Param type="const char *" name="dirPath" desc="" />
|
||||||
</Function>
|
</Function>
|
||||||
<Function name="LoadDirectoryFilesEx" retType="FilePathList" paramCount="3" desc="Load directory filepaths with extension filtering and subdir scan; some filters available: `*.*`,`FILES*`,`DIRS*`">
|
<Function name="LoadDirectoryFilesEx" retType="FilePathList" paramCount="3" desc="Load directory filepaths with extension filtering and subdir scan; some filters available: '*.*','FILES*','DIRS*'">
|
||||||
<Param type="const char *" name="basePath" desc="" />
|
<Param type="const char *" name="basePath" desc="" />
|
||||||
<Param type="const char *" name="filter" desc="" />
|
<Param type="const char *" name="filter" desc="" />
|
||||||
<Param type="bool" name="scanSubdirs" desc="" />
|
<Param type="bool" name="scanSubdirs" desc="" />
|
||||||
|
|||||||
Reference in New Issue
Block a user