mirror of
https://github.com/raysan5/raylib.git
synced 2026-01-25 00:29:18 -05:00
Refactor int to float missing parse (#5503)
* refactor int to float parse * Reverting as requested --------- Co-authored-by: Maicon <maicon@thinkpad02.exads.com>
This commit is contained in:
@ -45,7 +45,7 @@ int main(void)
|
||||
for (int i = 0; i < MAX_COLORS_COUNT; i++)
|
||||
{
|
||||
colorsRecs[i].x = 20.0f + 100.0f *(i%7) + 10.0f *(i%7);
|
||||
colorsRecs[i].y = 80.0f + 100.0f *(i/7) + 10.0f *(i/7);
|
||||
colorsRecs[i].y = 80.0f + 100.0f *((float)i/7) + 10.0f *((float)i/7);
|
||||
colorsRecs[i].width = 100.0f;
|
||||
colorsRecs[i].height = 100.0f;
|
||||
}
|
||||
|
||||
@ -311,7 +311,7 @@ static void DrawDisplaySegment(Vector2 center, int length, int thick, bool verti
|
||||
(Vector2){ center.x + thick/2.0f, center.y - length/2.0f }, // Point 3
|
||||
(Vector2){ center.x - thick/2.0f, center.y + length/2.0f }, // Point 4
|
||||
(Vector2){ center.x + thick/2.0f, center.y + length/2.0f }, // Point 5
|
||||
(Vector2){ center.x, center.y + length/2 + thick/2.0f }, // Point 6
|
||||
(Vector2){ center.x, center.y + (float)length/2 + thick/2.0f }, // Point 6
|
||||
};
|
||||
|
||||
DrawTriangleStrip(segmentPointsV, 6, color);
|
||||
|
||||
@ -49,8 +49,8 @@ int main(void)
|
||||
float totalM = m1 + m2;
|
||||
|
||||
Vector2 previousPosition = CalculateDoublePendulumEndPoint(l1, theta1, l2, theta2);
|
||||
previousPosition.x += (screenWidth/2);
|
||||
previousPosition.y += (screenHeight/2 - 100);
|
||||
previousPosition.x += ((float)screenWidth/2);
|
||||
previousPosition.y += ((float)screenHeight/2 - 100);
|
||||
|
||||
// Scale length
|
||||
float L1 = l1*lengthScaler;
|
||||
@ -105,8 +105,8 @@ int main(void)
|
||||
|
||||
// Calculate position
|
||||
Vector2 currentPosition = CalculateDoublePendulumEndPoint(l1, theta1, l2, theta2);
|
||||
currentPosition.x += screenWidth/2;
|
||||
currentPosition.y += screenHeight/2 - 100;
|
||||
currentPosition.x += (float)screenWidth/2;
|
||||
currentPosition.y += (float)screenHeight/2 - 100;
|
||||
|
||||
// Draw to render texture
|
||||
BeginTextureMode(target);
|
||||
|
||||
Reference in New Issue
Block a user