aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLeandro Gabriel <45115495+VelocityIsNotSpeed@users.noreply.github.com>2019-08-03 06:07:41 -0300
committerRay <raysan5@gmail.com>2019-08-03 11:07:41 +0200
commit89c16baf182aed201b75b99a253c0b074ffffeed (patch)
tree90edca66ea7b4c9c83aab26daa2496b770206ab5 /src
parent68ffbc06c74b717946d1bcb3a7e433d5fb859c85 (diff)
downloadraylib-89c16baf182aed201b75b99a253c0b074ffffeed.tar.gz
raylib-89c16baf182aed201b75b99a253c0b074ffffeed.zip
Replace tabs with spaces and update year of copyright notices (#927)
* Update year of copyright notices * Fix mistake in comment * Fix typo ("algorythms") * Replace tabs with spaces * Remove trailing whitespace and fix mistake in comment * Fix ExportImageAsCode missing comment rectangle corner * Replace tab with spaces * Replace tabs with spaces
Diffstat (limited to 'src')
-rw-r--r--src/easings.h4
-rw-r--r--src/models.c8
-rw-r--r--src/raylib.h2
-rw-r--r--src/raymath.h76
-rw-r--r--src/rglfw.c2
-rw-r--r--src/textures.c5
6 files changed, 49 insertions, 48 deletions
diff --git a/src/easings.h b/src/easings.h
index 1b08af0a..f6c384b0 100644
--- a/src/easings.h
+++ b/src/easings.h
@@ -135,7 +135,7 @@ EASEDEF float EaseQuadOut(float t, float b, float c, float d) { t /= d; return (
EASEDEF float EaseQuadInOut(float t, float b, float c, float d)
{
if ((t/=d/2) < 1) return (((c/2)*(t*t)) + b);
- return (-c/2.0f*(((t - 1.0f)*(t - 3.0f)) - 1.0f) + b);
+ return (-c/2.0f*(((t - 1.0f)*(t - 3.0f)) - 1.0f) + b);
}
// Exponential Easing functions
@@ -147,7 +147,7 @@ EASEDEF float EaseExpoInOut(float t, float b, float c, float d)
if (t == d) return (b + c);
if ((t/=d/2.0f) < 1.0f) return (c/2.0f*pow(2.0f, 10.0f*(t - 1.0f)) + b);
- return (c/2.0f*(-pow(2.0f, -10.0f*(t - 1.0f)) + 2.0f) + b);
+ return (c/2.0f*(-pow(2.0f, -10.0f*(t - 1.0f)) + 2.0f) + b);
}
// Back Easing functions
diff --git a/src/models.c b/src/models.c
index 6110051c..ee625906 100644
--- a/src/models.c
+++ b/src/models.c
@@ -2480,11 +2480,11 @@ bool CheckCollisionSpheres(Vector3 centerA, float radiusA, Vector3 centerB, floa
// Simple way to check for collision, just checking distance between two points
// Unfortunately, sqrtf() is a costly operation, so we avoid it with following solution
/*
- float dx = centerA.x - centerB.x; // X distance between centers
- float dy = centerA.y - centerB.y; // Y distance between centers
- float dz = centerA.z - centerB.z; // Y distance between centers
+ float dx = centerA.x - centerB.x; // X distance between centers
+ float dy = centerA.y - centerB.y; // Y distance between centers
+ float dz = centerA.z - centerB.z; // Z distance between centers
- float distance = sqrtf(dx*dx + dy*dy + dz*dz); // Distance between centers
+ float distance = sqrtf(dx*dx + dy*dy + dz*dz); // Distance between centers
if (distance <= (radiusA + radiusB)) collision = true;
*/
diff --git a/src/raylib.h b/src/raylib.h
index 6180eb34..ec5dee83 100644
--- a/src/raylib.h
+++ b/src/raylib.h
@@ -33,7 +33,7 @@
* [core] rgif (Charlie Tangora, Ramon Santamaria) for GIF recording
* [textures] stb_image (Sean Barret) for images loading (BMP, TGA, PNG, JPEG, HDR...)
* [textures] stb_image_write (Sean Barret) for image writting (BMP, TGA, PNG, JPG)
-* [textures] stb_image_resize (Sean Barret) for image resizing algorythms
+* [textures] stb_image_resize (Sean Barret) for image resizing algorithms
* [textures] stb_perlin (Sean Barret) for Perlin noise image generation
* [text] stb_truetype (Sean Barret) for ttf fonts loading
* [text] stb_rect_pack (Sean Barret) for rectangles packing
diff --git a/src/raymath.h b/src/raymath.h
index b9dae554..d866ad82 100644
--- a/src/raymath.h
+++ b/src/raymath.h
@@ -20,7 +20,7 @@
*
* LICENSE: zlib/libpng
*
-* Copyright (c) 2015-2017 Ramon Santamaria (@raysan5)
+* Copyright (c) 2015-2019 Ramon Santamaria (@raysan5)
*
* This software is provided "as-is", without any express or implied warranty. In no event
* will the authors be held liable for any damages arising from the use of this software.
@@ -148,7 +148,7 @@ RMDEF float Clamp(float value, float min, float max)
return res > max ? max : res;
}
-// Calculate linear interpolation between two vectors
+// Calculate linear interpolation between two floats
RMDEF float Lerp(float start, float end, float amount)
{
return start + amount*(end - start);
@@ -225,8 +225,8 @@ RMDEF Vector2 Vector2Scale(Vector2 v, float scale)
// Multiply vector by vector
RMDEF Vector2 Vector2MultiplyV(Vector2 v1, Vector2 v2)
{
- Vector2 result = { v1.x*v2.x, v1.y*v2.y };
- return result;
+ Vector2 result = { v1.x*v2.x, v1.y*v2.y };
+ return result;
}
// Negate vector
@@ -246,8 +246,8 @@ RMDEF Vector2 Vector2Divide(Vector2 v, float div)
// Divide vector by vector
RMDEF Vector2 Vector2DivideV(Vector2 v1, Vector2 v2)
{
- Vector2 result = { v1.x/v2.x, v1.y/v2.y };
- return result;
+ Vector2 result = { v1.x/v2.x, v1.y/v2.y };
+ return result;
}
// Normalize provided vector
@@ -388,15 +388,15 @@ RMDEF Vector3 Vector3Negate(Vector3 v)
// Divide vector by a float value
RMDEF Vector3 Vector3Divide(Vector3 v, float div)
{
- Vector3 result = { v.x / div, v.y / div, v.z / div };
- return result;
+ Vector3 result = { v.x / div, v.y / div, v.z / div };
+ return result;
}
// Divide vector by vector
RMDEF Vector3 Vector3DivideV(Vector3 v1, Vector3 v2)
{
- Vector3 result = { v1.x/v2.x, v1.y/v2.y, v1.z/v2.z };
- return result;
+ Vector3 result = { v1.x/v2.x, v1.y/v2.y, v1.z/v2.z };
+ return result;
}
// Normalize provided vector
@@ -1159,7 +1159,7 @@ RMDEF Quaternion QuaternionFromVector3ToVector3(Vector3 from, Vector3 to)
// Above lines are equivalent to:
//Quaternion result = QuaternionNlerp(q, QuaternionIdentity(), 0.5f);
- return result;
+ return result;
}
// Returns a quaternion for a given rotation matrix
@@ -1320,21 +1320,21 @@ RMDEF void QuaternionToAxisAngle(Quaternion q, Vector3 *outAxis, float *outAngle
// Returns he quaternion equivalent to Euler angles
RMDEF Quaternion QuaternionFromEuler(float roll, float pitch, float yaw)
{
- Quaternion q = { 0 };
+ Quaternion q = { 0 };
- float x0 = cosf(roll*0.5f);
- float x1 = sinf(roll*0.5f);
- float y0 = cosf(pitch*0.5f);
- float y1 = sinf(pitch*0.5f);
- float z0 = cosf(yaw*0.5f);
- float z1 = sinf(yaw*0.5f);
+ float x0 = cosf(roll*0.5f);
+ float x1 = sinf(roll*0.5f);
+ float y0 = cosf(pitch*0.5f);
+ float y1 = sinf(pitch*0.5f);
+ float z0 = cosf(yaw*0.5f);
+ float z1 = sinf(yaw*0.5f);
- q.x = x1*y0*z0 - x0*y1*z1;
- q.y = x0*y1*z0 + x1*y0*z1;
- q.z = x0*y0*z1 - x1*y1*z0;
- q.w = x0*y0*z0 + x1*y1*z1;
+ q.x = x1*y0*z0 - x0*y1*z1;
+ q.y = x0*y1*z0 + x1*y0*z1;
+ q.z = x0*y0*z1 - x1*y1*z0;
+ q.w = x0*y0*z0 + x1*y1*z1;
- return q;
+ return q;
}
// Return the Euler angles equivalent to quaternion (roll, pitch, yaw)
@@ -1343,21 +1343,21 @@ RMDEF Vector3 QuaternionToEuler(Quaternion q)
{
Vector3 result = { 0 };
- // roll (x-axis rotation)
- float x0 = 2.0f*(q.w*q.x + q.y*q.z);
- float x1 = 1.0f - 2.0f*(q.x*q.x + q.y*q.y);
- result.x = atan2f(x0, x1)*RAD2DEG;
-
- // pitch (y-axis rotation)
- float y0 = 2.0f*(q.w*q.y - q.z*q.x);
- y0 = y0 > 1.0f ? 1.0f : y0;
- y0 = y0 < -1.0f ? -1.0f : y0;
- result.y = asinf(y0)*RAD2DEG;
-
- // yaw (z-axis rotation)
- float z0 = 2.0f*(q.w*q.z + q.x*q.y);
- float z1 = 1.0f - 2.0f*(q.y*q.y + q.z*q.z);
- result.z = atan2f(z0, z1)*RAD2DEG;
+ // roll (x-axis rotation)
+ float x0 = 2.0f*(q.w*q.x + q.y*q.z);
+ float x1 = 1.0f - 2.0f*(q.x*q.x + q.y*q.y);
+ result.x = atan2f(x0, x1)*RAD2DEG;
+
+ // pitch (y-axis rotation)
+ float y0 = 2.0f*(q.w*q.y - q.z*q.x);
+ y0 = y0 > 1.0f ? 1.0f : y0;
+ y0 = y0 < -1.0f ? -1.0f : y0;
+ result.y = asinf(y0)*RAD2DEG;
+
+ // yaw (z-axis rotation)
+ float z0 = 2.0f*(q.w*q.z + q.x*q.y);
+ float z1 = 1.0f - 2.0f*(q.y*q.y + q.z*q.z);
+ result.z = atan2f(z0, z1)*RAD2DEG;
return result;
}
diff --git a/src/rglfw.c b/src/rglfw.c
index 3463bb96..8d331f9c 100644
--- a/src/rglfw.c
+++ b/src/rglfw.c
@@ -46,7 +46,7 @@
#define _GLFW_USE_RETINA // To have windows use the full resolution of Retina displays
#endif
#if defined(__TINYC__)
- #define _WIN32_WINNT_WINXP 0x0501
+ #define _WIN32_WINNT_WINXP 0x0501
#endif
// NOTE: _GLFW_MIR experimental platform not supported at this moment
diff --git a/src/textures.c b/src/textures.c
index 53e22341..18021352 100644
--- a/src/textures.c
+++ b/src/textures.c
@@ -823,14 +823,15 @@ void ExportImageAsCode(Image image, const char *fileName)
FILE *txtFile = fopen(fileName, "wt");
- fprintf(txtFile, "\n//////////////////////////////////////////////////////////////////////////////////////\n");
+ fprintf(txtFile, "\n");
+ fprintf(txtFile, "////////////////////////////////////////////////////////////////////////////////////////\n");
fprintf(txtFile, "// //\n");
fprintf(txtFile, "// ImageAsCode exporter v1.0 - Image pixel data exported as an array of bytes //\n");
fprintf(txtFile, "// //\n");
fprintf(txtFile, "// more info and bugs-report: github.com/raysan5/raylib //\n");
fprintf(txtFile, "// feedback and support: ray[at]raylib.com //\n");
fprintf(txtFile, "// //\n");
- fprintf(txtFile, "// Copyright (c) 2018 Ramon Santamaria (@raysan5) //\n");
+ fprintf(txtFile, "// Copyright (c) 2019 Ramon Santamaria (@raysan5) //\n");
fprintf(txtFile, "// //\n");
fprintf(txtFile, "////////////////////////////////////////////////////////////////////////////////////////\n\n");