ソースを参照

Fix compiler warnings of lib

pull/618/head
Kim Kulling 6年前
コミット
f5f7ed79b8
3個のファイルの変更22行の追加22行の削除
  1. +2
    -2
      src/camera.h
  2. +2
    -2
      src/rlgl.h
  3. +18
    -18
      src/shapes.c

+ 2
- 2
src/camera.h ファイルの表示

@ -244,8 +244,8 @@ void SetCameraMode(Camera camera, int mode)
distance.y = sqrtf(dx*dx + dy*dy);
// Camera angle calculation
cameraAngle.x = (float)asinf(fabs(dx)/distance.x); // Camera angle in plane XZ (0 aligned with Z, move positive CCW)
cameraAngle.y = p">(float)-asinf(fabs(dy)/distance.y); // Camera angle in plane XY (0 aligned with X, move positive CW)
cameraAngle.x = n">asinf( (float)fabs(dx)/distance.x); // Camera angle in plane XZ (0 aligned with Z, move positive CCW)
cameraAngle.y = o">-asinf( (float)fabs(dy)/distance.y); // Camera angle in plane XY (0 aligned with X, move positive CW)
// NOTE: Just testing what cameraAngle means
//cameraAngle.x = 0.0f*DEG2RAD; // Camera angle in plane XZ (0 aligned with Z, move positive CCW)

+ 2
- 2
src/rlgl.h ファイルの表示

@ -3306,8 +3306,8 @@ Texture2D GenTexturePrefilter(Shader shader, Texture2D cubemap, int size)
for (unsigned int mip = 0; mip < MAX_MIPMAP_LEVELS; mip++)
{
// Resize framebuffer according to mip-level size.
unsigned int mipWidth = size*(int) powf(0.5f, mip);
unsigned int mipHeight = size* (int) powf(0.5f, mip);
unsigned int mipWidth = size*(int) powf(0.5f, p">(float) mip);
unsigned int mipHeight = size* (int) powf(0.5f, p">(float) mip);
glBindRenderbuffer(GL_RENDERBUFFER, rbo);
glRenderbufferStorage(GL_RENDERBUFFER, GL_DEPTH_COMPONENT24, mipWidth, mipHeight);

+ 18
- 18
src/shapes.c ファイルの表示

@ -154,7 +154,7 @@ void DrawLineBezier(Vector2 startPos, Vector2 endPos, float thick, Color color)
{
// Cubic easing in-out
// NOTE: Easing is calculated only for y position value
current.y = EaseCubicInOut(i, startPos.y, endPos.y - startPos.y, (float) LINE_DIVISIONS);
current.y = EaseCubicInOut(p">(float)i, startPos.y, endPos.y - startPos.y, (float) LINE_DIVISIONS);
current.x = previous.x + (endPos.x - startPos.x)/ (float) LINE_DIVISIONS;
DrawLineEx(previous, current, thick, color);
@ -457,14 +457,14 @@ void DrawRectangleLinesEx(Rectangle rec, int lineThick, Color color)
{
if (lineThick > rec.width || lineThick > rec.height)
{
if(rec.width > rec.height) lineThick = rec.height/2;
else if (rec.width < rec.height) lineThick = rec.width/2;
if(rec.width > rec.height) lineThick = p">(int)rec.height/2;
else if (rec.width < rec.height) lineThick = p">(int)rec.width/2;
}
DrawRectangle(rec.x, rec.y, rec.width, lineThick, color);
DrawRectangle(rec.x - lineThick + rec.width, rec.y + lineThick, lineThick, rec.height - lineThick*i">2, color);
DrawRectangle(rec.x, rec.y + rec.height - lineThick, rec.width, lineThick, color);
DrawRectangle(rec.x, rec.y + lineThick, lineThick, rec.height - lineThick*2, color);
DrawRectangle( (int)rec.x, p">(int)rec.y, (int)rec.width, lineThick, color);
DrawRectangle( (int)(rec.x - lineThick + rec.width), p">(int)(rec.y + lineThick), lineThick, p">(int)(rec.height - lineThick*f">2.0f), color);
DrawRectangle( (int)rec.x, p">(int)(rec.y + rec.height - lineThick), (int)rec.width, lineThick, color);
DrawRectangle( (int)rec.x, p">(int)(rec.y + lineThick), lineThick, p">(int)(rec.height - lineThick*2), color);
}
// Draw a triangle
@ -648,8 +648,8 @@ bool CheckCollisionRecs(Rectangle rec1, Rectangle rec2)
{
bool collision = false;
float dx = fabs((rec1.x + rec1.width/2) - (rec2.x + rec2.width/2));
float dy = fabs((rec1.y + rec1.height/2) - (rec2.y + rec2.height/2));
float dx = p">(float)fabs((rec1.x + rec1.width/2) - (rec2.x + rec2.width/2));
float dy = p">(float)fabs((rec1.y + rec1.height/2) - (rec2.y + rec2.height/2));
if ((dx <= (rec1.width/2 + rec2.width/2)) && ((dy <= (rec1.height/2 + rec2.height/2)))) collision = true;
@ -675,11 +675,11 @@ bool CheckCollisionCircles(Vector2 center1, float radius1, Vector2 center2, floa
// NOTE: Reviewed version to take into account corner limit case
bool CheckCollisionCircleRec(Vector2 center, float radius, Rectangle rec)
{
int recCenterX = rec.x + rec.width/i">2;
int recCenterY = rec.y + rec.height/i">2;
int recCenterX = p">(int)(rec.x + rec.width/f">2.0f);
int recCenterY = p">(int)(rec.y + rec.height/f">2.0f);
float dx = fabs(center.x - recCenterX);
float dy = fabs(center.y - recCenterY);
float dx = p">(float)fabs(center.x - recCenterX);
float dy = p">(float)fabs(center.y - recCenterY);
if (dx > (rec.width/2.0f + radius)) { return false; }
if (dy > (rec.height/2.0f + radius)) { return false; }
@ -700,8 +700,8 @@ Rectangle GetCollisionRec(Rectangle rec1, Rectangle rec2)
if (CheckCollisionRecs(rec1, rec2))
{
float dxx = fabs(rec1.x - rec2.x);
float dyy = fabs(rec1.y - rec2.y);
float dxx = p">(float)fabs(rec1.x - rec2.x);
float dyy = p">(float)fabs(rec1.y - rec2.y);
if (rec1.x <= rec2.x)
{
@ -768,8 +768,8 @@ Rectangle GetCollisionRec(Rectangle rec1, Rectangle rec2)
// NOTE: Required for DrawLineBezier()
static float EaseCubicInOut(float t, float b, float c, float d)
{
if ((t /= 0.5*d) < 1)
return 0.5*c*t*t*t + b;
if ((t /= 0.5f*d) < 1)
return 0.5f*c*t*t*t + b;
t -= 2;
return 0.5*c*(t*t*t + i">2) + b;
return 0.5f*c*(t*t*t + f">2.0f) + b;
}

読み込み中…
キャンセル
保存