Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

general syntax fixes #3319

Merged
merged 90 commits into from
Sep 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
90 commits
Select commit Hold shift + click to select a range
7f6239f
Prettified a comment
Aug 13, 2023
feaaf95
fixed broken indentation caused by another commit.
Aug 13, 2023
03567d2
Changed 0.001 and 0.00001 to EPSILON
Aug 13, 2023
c21d7b7
Prettied up indentation in a few places
Aug 13, 2023
f85f9d4
removed spacing around *, standardizing it.
Aug 13, 2023
10993c5
I may have gotten overboard with indentation
Aug 13, 2023
7b4d83f
removed a few useless parenthesis
Aug 13, 2023
35028b3
Added fortran-raylib
raysan5 Aug 14, 2023
92bf6e8
Fix examples/others/rlgl_standalone.c compilation issue (#3242)
Aug 14, 2023
45a099c
Update BINDINGS.md
raysan5 Aug 14, 2023
565790e
Ignore unused return value of GetCodepointNext in GetCodepointCount (…
ashn-dot-dev Aug 14, 2023
7e2c474
Fix #3246
raysan5 Aug 17, 2023
90afcda
Revert "Fix #3246"
raysan5 Aug 19, 2023
d3ebf8c
Fix text_unicode.c example crashing (#3250)
Aug 19, 2023
934cd6f
tweaks
raysan5 Aug 20, 2023
62c20df
add build.zig options for individual modules (#3254)
actondev Aug 20, 2023
952ebb5
Add `IsKeyPressedRepeat` (desktop only) (#3245)
actondev Aug 20, 2023
7190fac
Reviewed `IsKeyPressedRepeat()` #3248
raysan5 Aug 20, 2023
acc4ecb
Update rcore.c (#3255)
VitusVeit Aug 20, 2023
87c9ed4
Match CMakeOptions.txt options default values (#3258)
asdqwe Aug 26, 2023
9760208
Fix SetClipboardText for web (#3257)
Aug 26, 2023
81ec5f0
[Image] Validate that ImageDrawRectangleRec is drawing entirely insid…
JeffM2501 Aug 26, 2023
8744f45
Add Vector3 Projecting and Rejection to Raymath (#3263)
Dial0 Aug 26, 2023
2270798
[Feature] IsKey... safety checks and more (#3256)
nickyMcDonald Aug 26, 2023
1814fd6
Fix bug where default shaders was not linking. (#3261)
branc116 Aug 26, 2023
bfd9c4e
Formating review
raysan5 Aug 26, 2023
2931ba9
Add missing cmake options (#3267)
asdqwe Aug 27, 2023
fb0184a
Fix CMake extraneous -lglfw (#3266)
iacore Aug 27, 2023
7ed0fdb
Fix example/models/models_loading_gltf.c controls (#3268)
asdqwe Aug 27, 2023
1040852
Fix example/models/models_loading_m3d.c controls (#3269)
asdqwe Aug 27, 2023
c003815
Remove e from secondes (#3270)
IrishBruse Aug 28, 2023
7fd3a02
Fix example/audio/audio_module_player.c help instructions and small b…
asdqwe Aug 29, 2023
daeb2cc
Use type name instead of valid specifier
raysan5 Aug 29, 2023
c197cac
REVIEWED: `GetFileLength()`, added comment #3262
raysan5 Aug 29, 2023
5c51b0b
Update examples/models/models_loading_gltf.png;m3d.png screenshots (#…
asdqwe Aug 29, 2023
7cc7ab0
Remove a duplicated screenshot and add missing one (#3275)
asdqwe Aug 30, 2023
f54a12d
Add examples/shaders/shaders_lightmap.c to Makefiles (#3276)
asdqwe Aug 30, 2023
3b84ec7
Fix examples/others/easings_testbed.c help instructions and small twe…
asdqwe Aug 30, 2023
f26cb1f
Fix examples/shaders/shaders_texture_outline.c help instructions (#3278)
asdqwe Aug 30, 2023
5a6fbcf
Fix examples/shapes/shapes_collision_area.c help instructions (#3279)
asdqwe Aug 30, 2023
bc39770
RENAMED: LoadFont*() parameter names for consistency and coherence
raysan5 Sep 1, 2023
fc0c51d
Fix uninitialized thread-locals in stbi #3282 (#3283)
jbarthelmes Sep 2, 2023
650fbab
REVIEWED: Added `SetTextLineSpacing()` to multiline examples
raysan5 Sep 2, 2023
98a02e1
REVIEWED: Data size type consistency between functions #3168
raysan5 Sep 2, 2023
b0986cb
Some tweaks
raysan5 Sep 2, 2023
d79ec5c
Use internal default allocators, instead of user-exposed ones
raysan5 Sep 2, 2023
6527f61
Added rudimentary SVG support. (#2738)
bXi Sep 2, 2023
7016f32
REVIEWED: `LoadImageSvg()`
raysan5 Sep 2, 2023
0a5c476
REVIEWED: `LoadImageSvg()`
raysan5 Sep 2, 2023
fda2d0f
Add SUPPORT_FILEFORMAT_SVG to cmake (#3284)
asdqwe Sep 2, 2023
e330f7d
Fix examples/textures/textures_fog_of_war.c help instructions (#3285)
asdqwe Sep 2, 2023
100b303
Fix examples/textures/textures_image_rotate.c help instructions (#3286)
asdqwe Sep 3, 2023
b29284e
Update rtextures.c
raysan5 Sep 4, 2023
a0922a2
Fix #3247
raysan5 Sep 4, 2023
3ec569f
Update config.h
raysan5 Sep 4, 2023
224f0af
Fix #3293
raysan5 Sep 5, 2023
4ed1cae
Disable UBSAN in zig builds. (#3292)
Sep 5, 2023
c440a5e
Update README.md (#3290)
eltociear Sep 5, 2023
8a6c1b7
Update cmake SUPPORT_FILEFORMAT_SVG default value (#3291)
asdqwe Sep 5, 2023
3d92630
Mouse offset and scaling must be considered also on web!
raysan5 Sep 6, 2023
c0e5250
Update rcore.c
raysan5 Sep 6, 2023
7026ede
Update Makefile : clean raygui.c & physac.c (#3296)
SuperUserNameMan Sep 7, 2023
445f024
Remove PLATFORM_RPI (#3232)
michaelfiber Sep 7, 2023
140f624
Review to avoid UBSAN complaining #1891
raysan5 Sep 7, 2023
bcdd599
added raylib-raku to bindings (#3299)
vushu Sep 8, 2023
38b6950
examples: core: adds 2D camera two player split screen (#3298)
gabrielssanches Sep 8, 2023
8c2932b
Reviewed examples for consistency
raysan5 Sep 8, 2023
3c1331f
Update rtext.c
raysan5 Sep 8, 2023
f8e05e3
Some code restructuring for input functions, consistency review
raysan5 Sep 8, 2023
e6b645f
Remove unneeded #if (#3301)
michaelfiber Sep 9, 2023
f927b99
Revert "Disable UBSAN in zig builds. (#3292)" (#3303)
Sep 9, 2023
19cbdbb
rtextures: Fix ImageDraw() source clipping when drawing beyond top le…
RobLoach Sep 11, 2023
2917c52
REVIEWED: `TextToPascal()` issue when first char is uppercase
raysan5 Sep 11, 2023
330e701
Implement FLAG_WINDOW_RESIZABLE for web (#3305)
Peter0x44 Sep 11, 2023
45c3853
Update BINDINGS.md (#3307)
Its-Kenta Sep 11, 2023
e98bca6
Update webassembly.yml
raysan5 Sep 12, 2023
3ba12df
Add claw-raylib to BINDINGS.md (#3310)
bohonghuang Sep 13, 2023
ab1c437
Add SetWindowMaxSize for desktop and web (#3309)
Sep 13, 2023
20424f1
Update rtextures.c
raysan5 Sep 13, 2023
41ce1bf
Reviewed parameters for consistency
raysan5 Sep 13, 2023
605032c
Rename windowM* to screenM* (#3312)
Sep 14, 2023
60af376
Update BINDINGS.md (#3317)
turborium Sep 15, 2023
049d745
Update rmodels.c
raysan5 Sep 15, 2023
c6802c7
Update BINDINGS.md with vaiorabbit/raylib-bindings (#3318)
wilsonsilva Sep 16, 2023
6139721
fixed spelling mistake
Sep 16, 2023
712f456
Merge branch 'raysan5:master' into master
Brian-ED Sep 16, 2023
86f0cd8
put back parenthesis
Sep 17, 2023
1aea876
reverted major allignment changes
Sep 17, 2023
6d6ab7e
reverted parser output changes
Sep 17, 2023
fda8e51
reverted one more indentation change
Sep 17, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/raylib.h
Original file line number Diff line number Diff line change
Expand Up @@ -1093,7 +1093,7 @@ RLAPI const char *GetFileNameWithoutExt(const char *filePath); // Get filenam
RLAPI const char *GetDirectoryPath(const char *filePath); // Get full path for a given fileName with path (uses static string)
RLAPI const char *GetPrevDirectoryPath(const char *dirPath); // Get previous directory path for a given path (uses static string)
RLAPI const char *GetWorkingDirectory(void); // Get current working directory (uses static string)
RLAPI const char *GetApplicationDirectory(void); // Get the directory if the running application (uses static string)
RLAPI const char *GetApplicationDirectory(void); // Get the directory of the running application (uses static string)
RLAPI bool ChangeDirectory(const char *dir); // Change working directory, return true on success
RLAPI bool IsPathFile(const char *path); // Check if a given path is a file or a directory
RLAPI FilePathList LoadDirectoryFiles(const char *dirPath); // Load directory filepaths
Expand Down
67 changes: 33 additions & 34 deletions src/raymath.h
Original file line number Diff line number Diff line change
Expand Up @@ -820,7 +820,7 @@ RMAPI Vector3 Vector3RotateByAxisAngle(Vector3 v, Vector3 axis, float angle)
Vector3 result = v;

// Vector3Normalize(axis);
float length = sqrtf(axis.x * axis.x + axis.y * axis.y + axis.z * axis.z);
float length = sqrtf(axis.x*axis.x + axis.y*axis.y + axis.z*axis.z);
if (length == 0.0f) length = 1.0f;
float ilength = 1.0f / length;
axis.x *= ilength;
Expand All @@ -829,19 +829,19 @@ RMAPI Vector3 Vector3RotateByAxisAngle(Vector3 v, Vector3 axis, float angle)

angle /= 2.0f;
float a = sinf(angle);
float b = axis.x * a;
float c = axis.y * a;
float d = axis.z * a;
float b = axis.x*a;
float c = axis.y*a;
float d = axis.z*a;
a = cosf(angle);
Vector3 w = { b, c, d };

// Vector3CrossProduct(w, v)
Vector3 wv = { w.y * v.z - w.z * v.y, w.z * v.x - w.x * v.z, w.x * v.y - w.y * v.x };
Vector3 wv = { w.y*v.z - w.z*v.y, w.z*v.x - w.x*v.z, w.x*v.y - w.y*v.x };

// Vector3CrossProduct(w, wv)
Vector3 wwv = { w.y * wv.z - w.z * wv.y, w.z * wv.x - w.x * wv.z, w.x * wv.y - w.y * wv.x };
Vector3 wwv = { w.y*wv.z - w.z*wv.y, w.z*wv.x - w.x*wv.z, w.x*wv.y - w.y*wv.x };

// Vector3Scale(wv, 2 * a)
// Vector3Scale(wv, 2*a)
a *= 2;
wv.x *= a;
wv.y *= a;
Expand Down Expand Up @@ -1091,18 +1091,17 @@ RMAPI Vector3 Vector3ClampValue(Vector3 v, float min, float max)
RMAPI int Vector3Equals(Vector3 p, Vector3 q)
{
int result = ((fabsf(p.x - q.x)) <= (EPSILON*fmaxf(1.0f, fmaxf(fabsf(p.x), fabsf(q.x))))) &&
((fabsf(p.y - q.y)) <= (EPSILON*fmaxf(1.0f, fmaxf(fabsf(p.y), fabsf(q.y))))) &&
((fabsf(p.z - q.z)) <= (EPSILON*fmaxf(1.0f, fmaxf(fabsf(p.z), fabsf(q.z)))));
((fabsf(p.y - q.y)) <= (EPSILON*fmaxf(1.0f, fmaxf(fabsf(p.y), fabsf(q.y))))) &&
((fabsf(p.z - q.z)) <= (EPSILON*fmaxf(1.0f, fmaxf(fabsf(p.z), fabsf(q.z)))));

return result;
}

// Compute the direction of a refracted ray where v specifies the
// normalized direction of the incoming ray, n specifies the
// normalized normal vector of the interface of two optical media,
// and r specifies the ratio of the refractive index of the medium
// from where the ray comes to the refractive index of the medium
// on the other side of the surface
// Compute the direction of a refracted ray
// v: normalized direction of the incoming ray
// n: normalized normal vector of the interface of two optical media
// r: ratio of the refractive index of the medium from where the ray comes
// to the refractive index of the medium on the other side of the surface
RMAPI Vector3 Vector3Refract(Vector3 v, Vector3 n, float r)
{
Vector3 result = { 0 };
Expand Down Expand Up @@ -1862,7 +1861,7 @@ RMAPI Quaternion QuaternionSlerp(Quaternion q1, Quaternion q2, float amount)
float halfTheta = acosf(cosHalfTheta);
float sinHalfTheta = sqrtf(1.0f - cosHalfTheta*cosHalfTheta);

if (fabsf(sinHalfTheta) < 0.001f)
if (fabsf(sinHalfTheta) < EPSILON)
{
result.x = (q1.x*0.5f + q2.x*0.5f);
result.y = (q1.y*0.5f + q2.y*0.5f);
Expand Down Expand Up @@ -1917,9 +1916,9 @@ RMAPI Quaternion QuaternionFromMatrix(Matrix mat)
{
Quaternion result = { 0 };

float fourWSquaredMinus1 = mat.m0 + mat.m5 + mat.m10;
float fourXSquaredMinus1 = mat.m0 - mat.m5 - mat.m10;
float fourYSquaredMinus1 = mat.m5 - mat.m0 - mat.m10;
float fourWSquaredMinus1 = mat.m0 + mat.m5 + mat.m10;
float fourXSquaredMinus1 = mat.m0 - mat.m5 - mat.m10;
float fourYSquaredMinus1 = mat.m5 - mat.m0 - mat.m10;
float fourZSquaredMinus1 = mat.m10 - mat.m0 - mat.m5;

int biggestIndex = 0;
Expand All @@ -1942,34 +1941,34 @@ RMAPI Quaternion QuaternionFromMatrix(Matrix mat)
biggestIndex = 3;
}

float biggestVal = sqrtf(fourBiggestSquaredMinus1 + 1.0f) * 0.5f;
float biggestVal = sqrtf(fourBiggestSquaredMinus1 + 1.0f)*0.5f;
float mult = 0.25f / biggestVal;

switch (biggestIndex)
{
case 0:
result.w = biggestVal;
result.x = (mat.m6 - mat.m9) * mult;
result.y = (mat.m8 - mat.m2) * mult;
result.z = (mat.m1 - mat.m4) * mult;
result.x = (mat.m6 - mat.m9)*mult;
result.y = (mat.m8 - mat.m2)*mult;
result.z = (mat.m1 - mat.m4)*mult;
break;
case 1:
result.x = biggestVal;
result.w = (mat.m6 - mat.m9) * mult;
result.y = (mat.m1 + mat.m4) * mult;
result.z = (mat.m8 + mat.m2) * mult;
result.w = (mat.m6 - mat.m9)*mult;
result.y = (mat.m1 + mat.m4)*mult;
result.z = (mat.m8 + mat.m2)*mult;
break;
case 2:
result.y = biggestVal;
result.w = (mat.m8 - mat.m2) * mult;
result.x = (mat.m1 + mat.m4) * mult;
result.z = (mat.m6 + mat.m9) * mult;
result.w = (mat.m8 - mat.m2)*mult;
result.x = (mat.m1 + mat.m4)*mult;
result.z = (mat.m6 + mat.m9)*mult;
break;
case 3:
result.z = biggestVal;
result.w = (mat.m1 - mat.m4) * mult;
result.x = (mat.m8 + mat.m2) * mult;
result.y = (mat.m6 + mat.m9) * mult;
result.w = (mat.m1 - mat.m4)*mult;
result.x = (mat.m8 + mat.m2)*mult;
result.y = (mat.m6 + mat.m9)*mult;
break;
}

Expand Down Expand Up @@ -2075,7 +2074,7 @@ RMAPI void QuaternionToAxisAngle(Quaternion q, Vector3 *outAxis, float *outAngle
float resAngle = 2.0f*acosf(q.w);
float den = sqrtf(1.0f - q.w*q.w);

if (den > 0.0001f)
if (den > EPSILON)
{
resAxis.x = q.x/den;
resAxis.y = q.y/den;
Expand Down Expand Up @@ -2158,7 +2157,7 @@ RMAPI int QuaternionEquals(Quaternion p, Quaternion q)
((fabsf(p.y - q.y)) <= (EPSILON*fmaxf(1.0f, fmaxf(fabsf(p.y), fabsf(q.y))))) &&
((fabsf(p.z - q.z)) <= (EPSILON*fmaxf(1.0f, fmaxf(fabsf(p.z), fabsf(q.z))))) &&
((fabsf(p.w - q.w)) <= (EPSILON*fmaxf(1.0f, fmaxf(fabsf(p.w), fabsf(q.w)))))) ||
(((fabsf(p.x + q.x)) <= (EPSILON*fmaxf(1.0f, fmaxf(fabsf(p.x), fabsf(q.x))))) &&
(((fabsf(p.x + q.x)) <= (EPSILON*fmaxf(1.0f, fmaxf(fabsf(p.x), fabsf(q.x))))) &&
((fabsf(p.y + q.y)) <= (EPSILON*fmaxf(1.0f, fmaxf(fabsf(p.y), fabsf(q.y))))) &&
((fabsf(p.z + q.z)) <= (EPSILON*fmaxf(1.0f, fmaxf(fabsf(p.z), fabsf(q.z))))) &&
((fabsf(p.w + q.w)) <= (EPSILON*fmaxf(1.0f, fmaxf(fabsf(p.w), fabsf(q.w))))));
Expand Down