mirror of
https://github.com/raysan5/raylib.git
synced 2025-10-09 11:26:32 +00:00
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
This commit is contained in:
@@ -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
|
||||
|
@@ -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;
|
||||
*/
|
||||
|
@@ -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
|
||||
|
@@ -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;
|
||||
// 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;
|
||||
// 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;
|
||||
// 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;
|
||||
}
|
||||
|
@@ -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
|
||||
|
@@ -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");
|
||||
|
||||
|
Reference in New Issue
Block a user