mirror of
https://github.com/raysan5/raylib.git
synced 2025-12-25 10:22:33 -05:00
Compare commits
5 Commits
ad17af57e9
...
d7a7eda959
| Author | SHA1 | Date | |
|---|---|---|---|
| d7a7eda959 | |||
| 2a324ace27 | |||
| 8b3ea995f9 | |||
| d8da443604 | |||
| 4ff296bf0b |
4
.github/workflows/parse_api.yml
vendored
4
.github/workflows/parse_api.yml
vendored
@ -22,7 +22,7 @@ jobs:
|
|||||||
- name: Diff parse files
|
- name: Diff parse files
|
||||||
id: diff
|
id: diff
|
||||||
run: |
|
run: |
|
||||||
git add -N tools/rlparser
|
git add -N tools/rlparser/output
|
||||||
git diff --name-only --exit-code
|
git diff --name-only --exit-code
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
|
|
||||||
@ -32,6 +32,6 @@ jobs:
|
|||||||
set -x
|
set -x
|
||||||
git config user.name "github-actions[bot]"
|
git config user.name "github-actions[bot]"
|
||||||
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
||||||
git add tools/rlparser
|
git add tools/rlparser/output
|
||||||
git commit -m "rlparser: update raylib_api.* by CI"
|
git commit -m "rlparser: update raylib_api.* by CI"
|
||||||
git push
|
git push
|
||||||
|
|||||||
@ -69,18 +69,19 @@ int main(void)
|
|||||||
DrawText(directory, 100, 40, 20, DARKGRAY);
|
DrawText(directory, 100, 40, 20, DARKGRAY);
|
||||||
|
|
||||||
btnBackPressed = GuiButton((Rectangle){ 40.0f, 40.0f, 20, 20 }, "<");
|
btnBackPressed = GuiButton((Rectangle){ 40.0f, 40.0f, 20, 20 }, "<");
|
||||||
|
|
||||||
for (int i = 0; i < (int)files.count; i++)
|
for (int i = 0; i < (int)files.count; i++)
|
||||||
{
|
{
|
||||||
Color color = Fade(LIGHTGRAY, 0.3f);
|
Color color = Fade(LIGHTGRAY, 0.3f);
|
||||||
|
|
||||||
if (!IsPathFile(files.paths[i]))
|
if (!IsPathFile(files.paths[i]) && DirectoryExists(files.paths[i]))
|
||||||
{
|
{
|
||||||
if (GuiButton((Rectangle){0.0f, 85.0f + 40.0f*(float)i, screenWidth, 40}, ""))
|
if (GuiButton((Rectangle){0.0f, 85.0f + 40.0f*(float)i, screenWidth, 40}, ""))
|
||||||
{
|
{
|
||||||
strcpy(directory, files.paths[i]);
|
strcpy(directory, files.paths[i]);
|
||||||
UnloadDirectoryFiles(files);
|
UnloadDirectoryFiles(files);
|
||||||
files = LoadDirectoryFiles(directory);
|
files = LoadDirectoryFiles(directory);
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -19,6 +19,8 @@
|
|||||||
|
|
||||||
#include "raymath.h" // Required for: Lerp()
|
#include "raymath.h" // Required for: Lerp()
|
||||||
|
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
//------------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------------
|
||||||
// Program main entry point
|
// Program main entry point
|
||||||
//------------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------------
|
||||||
@ -59,10 +61,11 @@ int main(void)
|
|||||||
int lastSpace = 0; // Keeping track of last valid space to insert '\n'
|
int lastSpace = 0; // Keeping track of last valid space to insert '\n'
|
||||||
int lastWrapStart = 0; // Keeping track of the start of this wrapped line.
|
int lastWrapStart = 0; // Keeping track of the start of this wrapped line.
|
||||||
|
|
||||||
while (lines[i][j] != '\0')
|
while (j <= strlen(lines[i]))
|
||||||
{
|
{
|
||||||
if (lines[i][j] == ' ')
|
if (lines[i][j] == ' ' || lines[i][j] == '\0')
|
||||||
{
|
{
|
||||||
|
char before = lines[i][j];
|
||||||
// Making a C Style string by adding a '\0' at the required location so that we can use the MeasureText function
|
// Making a C Style string by adding a '\0' at the required location so that we can use the MeasureText function
|
||||||
lines[i][j] = '\0';
|
lines[i][j] = '\0';
|
||||||
|
|
||||||
@ -75,7 +78,7 @@ int main(void)
|
|||||||
lastWrapStart = lastSpace + 1;
|
lastWrapStart = lastSpace + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
lines[i][j] = ' '; // Resetting the space back
|
if(before != '\0') lines[i][j] = ' '; // Resetting the space back
|
||||||
lastSpace = j; // Since we encountered a new space we update our last encountered space location
|
lastSpace = j; // Since we encountered a new space we update our last encountered space location
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -92,7 +95,7 @@ int main(void)
|
|||||||
textHeight += (int)size.y + 10;
|
textHeight += (int)size.y + 10;
|
||||||
}
|
}
|
||||||
|
|
||||||
// A simple scrollbar on the side to show how far we have red into the file
|
// A simple scrollbar on the side to show how far we have read into the file
|
||||||
Rectangle scrollBar = {
|
Rectangle scrollBar = {
|
||||||
.x = (float)screenWidth - 5,
|
.x = (float)screenWidth - 5,
|
||||||
.y = 0,
|
.y = 0,
|
||||||
@ -132,7 +135,13 @@ int main(void)
|
|||||||
for (int i = 0, t = textTop; i < lineCount; i++)
|
for (int i = 0, t = textTop; i < lineCount; i++)
|
||||||
{
|
{
|
||||||
// Each time we go through and calculate the height of the text to move the cursor appropriately
|
// Each time we go through and calculate the height of the text to move the cursor appropriately
|
||||||
Vector2 size = MeasureTextEx(GetFontDefault(), lines[i], (float)fontSize, 2);
|
Vector2 size;
|
||||||
|
if(strcmp(lines[i], "")){
|
||||||
|
// Fix for empty line in the text file
|
||||||
|
size = MeasureTextEx( GetFontDefault(), lines[i], (float)fontSize, 2);
|
||||||
|
}else{
|
||||||
|
size = MeasureTextEx( GetFontDefault(), " ", (float)fontSize, 2);
|
||||||
|
}
|
||||||
|
|
||||||
DrawText(lines[i], 10, t, fontSize, RED);
|
DrawText(lines[i], 10, t, fontSize, RED);
|
||||||
|
|
||||||
|
|||||||
12
src/external/rlsw.h
vendored
12
src/external/rlsw.h
vendored
@ -2118,12 +2118,12 @@ static inline int sw_clip_##name(
|
|||||||
// Frustum cliping functions
|
// Frustum cliping functions
|
||||||
//-------------------------------------------------------------------------------------------
|
//-------------------------------------------------------------------------------------------
|
||||||
#define IS_INSIDE_PLANE_W(h) ((h)[3] >= SW_CLIP_EPSILON)
|
#define IS_INSIDE_PLANE_W(h) ((h)[3] >= SW_CLIP_EPSILON)
|
||||||
#define IS_INSIDE_PLANE_X_POS(h) ((h)[0] <= (h)[3])
|
#define IS_INSIDE_PLANE_X_POS(h) ( (h)[0] < (h)[3]) // Exclusive for +X
|
||||||
#define IS_INSIDE_PLANE_X_NEG(h) (-(h)[0] <= (h)[3])
|
#define IS_INSIDE_PLANE_X_NEG(h) (-(h)[0] < (h)[3]) // Exclusive for -X
|
||||||
#define IS_INSIDE_PLANE_Y_POS(h) ((h)[1] <= (h)[3])
|
#define IS_INSIDE_PLANE_Y_POS(h) ( (h)[1] < (h)[3]) // Exclusive for +Y
|
||||||
#define IS_INSIDE_PLANE_Y_NEG(h) (-(h)[1] <= (h)[3])
|
#define IS_INSIDE_PLANE_Y_NEG(h) (-(h)[1] < (h)[3]) // Exclusive for -Y
|
||||||
#define IS_INSIDE_PLANE_Z_POS(h) ((h)[2] <= (h)[3])
|
#define IS_INSIDE_PLANE_Z_POS(h) ( (h)[2] <= (h)[3]) // Inclusive for +Z
|
||||||
#define IS_INSIDE_PLANE_Z_NEG(h) (-(h)[2] <= (h)[3])
|
#define IS_INSIDE_PLANE_Z_NEG(h) (-(h)[2] <= (h)[3]) // Inclusive for -Z
|
||||||
|
|
||||||
#define COMPUTE_T_PLANE_W(hPrev, hCurr) ((SW_CLIP_EPSILON - (hPrev)[3])/((hCurr)[3] - (hPrev)[3]))
|
#define COMPUTE_T_PLANE_W(hPrev, hCurr) ((SW_CLIP_EPSILON - (hPrev)[3])/((hCurr)[3] - (hPrev)[3]))
|
||||||
#define COMPUTE_T_PLANE_X_POS(hPrev, hCurr) (((hPrev)[3] - (hPrev)[0])/(((hPrev)[3] - (hPrev)[0]) - ((hCurr)[3] - (hCurr)[0])))
|
#define COMPUTE_T_PLANE_X_POS(hPrev, hCurr) (((hPrev)[3] - (hPrev)[0])/(((hPrev)[3] - (hPrev)[0]) - ((hCurr)[3] - (hCurr)[0])))
|
||||||
|
|||||||
Reference in New Issue
Block a user