mirror of
https://github.com/raysan5/raylib.git
synced 2026-04-27 00:57:25 -04:00
MSVC warnings (#5595)
This commit is contained in:
@ -60,7 +60,7 @@ int main(void)
|
|||||||
//----------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------
|
||||||
if (btnComputeHashes)
|
if (btnComputeHashes)
|
||||||
{
|
{
|
||||||
int textInputLen = strlen(textInput);
|
int textInputLen = (int)strlen(textInput);
|
||||||
|
|
||||||
// Encode data to Base64 string (includes NULL terminator), memory must be MemFree()
|
// Encode data to Base64 string (includes NULL terminator), memory must be MemFree()
|
||||||
base64Text = EncodeDataBase64((unsigned char *)textInput, textInputLen, &base64TextSize);
|
base64Text = EncodeDataBase64((unsigned char *)textInput, textInputLen, &base64TextSize);
|
||||||
|
|||||||
@ -78,7 +78,7 @@ int main(void)
|
|||||||
|
|
||||||
GuiSetStyle(LISTVIEW, TEXT_ALIGNMENT, TEXT_ALIGN_LEFT);
|
GuiSetStyle(LISTVIEW, TEXT_ALIGNMENT, TEXT_ALIGN_LEFT);
|
||||||
GuiSetStyle(LISTVIEW, TEXT_PADDING, 40);
|
GuiSetStyle(LISTVIEW, TEXT_PADDING, 40);
|
||||||
GuiListViewEx((Rectangle){ 0, 50, GetScreenWidth(), GetScreenHeight() - 50 },
|
GuiListViewEx((Rectangle){ 0, 50, (float)GetScreenWidth(), (float)GetScreenHeight() - 50 },
|
||||||
files.paths, files.count, &listScrollIndex, &listItemActive, &listItemFocused);
|
files.paths, files.count, &listScrollIndex, &listItemActive, &listItemFocused);
|
||||||
|
|
||||||
EndDrawing();
|
EndDrawing();
|
||||||
|
|||||||
@ -86,10 +86,10 @@ int main(void)
|
|||||||
|
|
||||||
// Draw mouse position
|
// Draw mouse position
|
||||||
DrawCircleV(GetMousePosition(), 20, MAROON);
|
DrawCircleV(GetMousePosition(), 20, MAROON);
|
||||||
DrawRectangle(mousePos.x - 25, mousePos.y, 50, 2, BLACK);
|
DrawRectangleRec((Rectangle) { mousePos.x - 25, mousePos.y, 50, 2 }, BLACK);
|
||||||
DrawRectangle(mousePos.x, mousePos.y - 25, 2, 50, BLACK);
|
DrawRectangleRec((Rectangle) { mousePos.x, mousePos.y - 25, 2, 50 }, BLACK);
|
||||||
DrawText(TextFormat("[%i,%i]", GetMouseX(), GetMouseY()), mousePos.x - 44,
|
DrawText(TextFormat("[%i,%i]", GetMouseX(), GetMouseY()), mousePos.x - 44,
|
||||||
(mousePos.y > GetScreenHeight() - 60)? mousePos.y - 46 : mousePos.y + 30, 20, BLACK);
|
(mousePos.y > GetScreenHeight() - 60)? (int)mousePos.y - 46 : (int)mousePos.y + 30, 20, BLACK);
|
||||||
|
|
||||||
EndDrawing();
|
EndDrawing();
|
||||||
//----------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------
|
||||||
|
|||||||
@ -177,10 +177,10 @@ int main(void)
|
|||||||
DrawRectangleRec(increaseTypeButton, SKYBLUE);
|
DrawRectangleRec(increaseTypeButton, SKYBLUE);
|
||||||
DrawRectangleRec(decreaseResolutionButton, SKYBLUE);
|
DrawRectangleRec(decreaseResolutionButton, SKYBLUE);
|
||||||
DrawRectangleRec(increaseResolutionButton, SKYBLUE);
|
DrawRectangleRec(increaseResolutionButton, SKYBLUE);
|
||||||
DrawText("<", decreaseTypeButton.x + 3, decreaseTypeButton.y + 1, 10, BLACK);
|
DrawText("<", (int)decreaseTypeButton.x + 3, (int)decreaseTypeButton.y + 1, 10, BLACK);
|
||||||
DrawText(">", increaseTypeButton.x + 3, increaseTypeButton.y + 1, 10, BLACK);
|
DrawText(">", (int)increaseTypeButton.x + 3, (int)increaseTypeButton.y + 1, 10, BLACK);
|
||||||
DrawText("<", decreaseResolutionButton.x + 3, decreaseResolutionButton.y + 1, 10, BLACK);
|
DrawText("<", (int)decreaseResolutionButton.x + 3, (int)decreaseResolutionButton.y + 1, 10, BLACK);
|
||||||
DrawText(">", increaseResolutionButton.x + 3, increaseResolutionButton.y + 1, 10, BLACK);
|
DrawText(">", (int)increaseResolutionButton.x + 3, (int)increaseResolutionButton.y + 1, 10, BLACK);
|
||||||
|
|
||||||
EndDrawing();
|
EndDrawing();
|
||||||
//----------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------
|
||||||
@ -308,7 +308,7 @@ static void ResizeRenderSize(ViewportType viewportType, int *screenWidth, int *s
|
|||||||
}
|
}
|
||||||
|
|
||||||
UnloadRenderTexture(*target);
|
UnloadRenderTexture(*target);
|
||||||
*target = LoadRenderTexture(sourceRect->width, -sourceRect->height);
|
*target = LoadRenderTexture((int)sourceRect->width, -(int)sourceRect->height);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Example how to calculate position on RenderTexture
|
// Example how to calculate position on RenderTexture
|
||||||
|
|||||||
@ -225,7 +225,7 @@ int main(void)
|
|||||||
NULL, TextFormat("x%.1f", animFrameSpeed0), &animFrameSpeed0, 0.1f, 2.0f);
|
NULL, TextFormat("x%.1f", animFrameSpeed0), &animFrameSpeed0, 0.1f, 2.0f);
|
||||||
GuiEnable();
|
GuiEnable();
|
||||||
if (dropdownEditMode1) GuiDisable();
|
if (dropdownEditMode1) GuiDisable();
|
||||||
GuiSlider((Rectangle){ GetScreenWidth() - 170, 38, 160, 12 },
|
GuiSlider((Rectangle){ GetScreenWidth() - 170.0f, 38, 160, 12 },
|
||||||
TextFormat("%.1fx", animFrameSpeed1), NULL, &animFrameSpeed1, 0.1f, 2.0f);
|
TextFormat("%.1fx", animFrameSpeed1), NULL, &animFrameSpeed1, 0.1f, 2.0f);
|
||||||
GuiEnable();
|
GuiEnable();
|
||||||
|
|
||||||
@ -241,23 +241,23 @@ int main(void)
|
|||||||
GuiProgressBar((Rectangle){ 180, 14, 440, 16 }, NULL, NULL, &animBlendProgress, 0.0f, 1.0f);
|
GuiProgressBar((Rectangle){ 180, 14, 440, 16 }, NULL, NULL, &animBlendProgress, 0.0f, 1.0f);
|
||||||
GuiSetStyle(PROGRESSBAR, PROGRESS_SIDE, 0); // Reset to Left-->Right
|
GuiSetStyle(PROGRESSBAR, PROGRESS_SIDE, 0); // Reset to Left-->Right
|
||||||
|
|
||||||
if (GuiDropdownBox((Rectangle){ GetScreenWidth() - 170, 10, 160, 24 }, TextJoin(animNames, animCount, ";"),
|
if (GuiDropdownBox((Rectangle){ GetScreenWidth() - 170.0f, 10, 160, 24 }, TextJoin(animNames, animCount, ";"),
|
||||||
&animIndex1, dropdownEditMode1)) dropdownEditMode1 = !dropdownEditMode1;
|
&animIndex1, dropdownEditMode1)) dropdownEditMode1 = !dropdownEditMode1;
|
||||||
|
|
||||||
// Draw playing timeline with keyframes for anim0[]
|
// Draw playing timeline with keyframes for anim0[]
|
||||||
GuiProgressBar((Rectangle){ 60, GetScreenHeight() - 60, GetScreenWidth() - 180, 20 }, "ANIM 0",
|
GuiProgressBar((Rectangle){ 60, GetScreenHeight() - 60.0f, GetScreenWidth() - 180.0f, 20 }, "ANIM 0",
|
||||||
TextFormat("FRAME: %.2f / %i", animFrameProgress0, anims[animIndex0].keyframeCount),
|
TextFormat("FRAME: %.2f / %i", animFrameProgress0, anims[animIndex0].keyframeCount),
|
||||||
&animFrameProgress0, 0.0f, (float)anims[animIndex0].keyframeCount);
|
&animFrameProgress0, 0.0f, (float)anims[animIndex0].keyframeCount);
|
||||||
for (int i = 0; i < anims[animIndex0].keyframeCount; i++)
|
for (int i = 0; i < anims[animIndex0].keyframeCount; i++)
|
||||||
DrawRectangle(60 + ((float)(GetScreenWidth() - 180)/(float)anims[animIndex0].keyframeCount)*(float)i,
|
DrawRectangle(60 + (int)(((float)(GetScreenWidth() - 180)/(float)anims[animIndex0].keyframeCount)*(float)i),
|
||||||
GetScreenHeight() - 60, 1, 20, BLUE);
|
GetScreenHeight() - 60, 1, 20, BLUE);
|
||||||
|
|
||||||
// Draw playing timeline with keyframes for anim1[]
|
// Draw playing timeline with keyframes for anim1[]
|
||||||
GuiProgressBar((Rectangle){ 60, GetScreenHeight() - 30, GetScreenWidth() - 180, 20 }, "ANIM 1",
|
GuiProgressBar((Rectangle){ 60, GetScreenHeight() - 30.0f, GetScreenWidth() - 180.0f, 20 }, "ANIM 1",
|
||||||
TextFormat("FRAME: %.2f / %i", animFrameProgress1, anims[animIndex1].keyframeCount),
|
TextFormat("FRAME: %.2f / %i", animFrameProgress1, anims[animIndex1].keyframeCount),
|
||||||
&animFrameProgress1, 0.0f, (float)anims[animIndex1].keyframeCount);
|
&animFrameProgress1, 0.0f, (float)anims[animIndex1].keyframeCount);
|
||||||
for (int i = 0; i < anims[animIndex1].keyframeCount; i++)
|
for (int i = 0; i < anims[animIndex1].keyframeCount; i++)
|
||||||
DrawRectangle(60 + ((float)(GetScreenWidth() - 180)/(float)anims[animIndex1].keyframeCount)*(float)i,
|
DrawRectangle(60 + (int)(((float)(GetScreenWidth() - 180)/(float)anims[animIndex1].keyframeCount)*(float)i),
|
||||||
GetScreenHeight() - 30, 1, 20, BLUE);
|
GetScreenHeight() - 30, 1, 20, BLUE);
|
||||||
//---------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|||||||
@ -108,12 +108,12 @@ int main(void)
|
|||||||
&animFrameSpeed, 0.1f, 2.0f);
|
&animFrameSpeed, 0.1f, 2.0f);
|
||||||
|
|
||||||
// Draw playing timeline with keyframes
|
// Draw playing timeline with keyframes
|
||||||
GuiLabel((Rectangle){ 10, GetScreenHeight() - 64, GetScreenWidth() - 20, 24 },
|
GuiLabel((Rectangle){ 10, GetScreenHeight() - 64.0f, GetScreenWidth() - 20.0f, 24 },
|
||||||
TextFormat("CURRENT FRAME: %.2f / %i", animFrameProgress, anims[animIndex].keyframeCount));
|
TextFormat("CURRENT FRAME: %.2f / %i", animFrameProgress, anims[animIndex].keyframeCount));
|
||||||
GuiProgressBar((Rectangle){ 10, GetScreenHeight() - 40, GetScreenWidth() - 20, 24 }, NULL, NULL,
|
GuiProgressBar((Rectangle){ 10, GetScreenHeight() - 40.0f, GetScreenWidth() - 20.0f, 24 }, NULL, NULL,
|
||||||
&animFrameProgress, 0.0f, (float)anims[animIndex].keyframeCount);
|
&animFrameProgress, 0.0f, (float)anims[animIndex].keyframeCount);
|
||||||
for (int i = 0; i < anims[animIndex].keyframeCount; i++)
|
for (int i = 0; i < anims[animIndex].keyframeCount; i++)
|
||||||
DrawRectangle(10 + ((float)(GetScreenWidth() - 20)/(float)anims[animIndex].keyframeCount)*(float)i,
|
DrawRectangle(10 + (int)(((float)(GetScreenWidth() - 20)/(float)anims[animIndex].keyframeCount)*(float)i),
|
||||||
GetScreenHeight() - 40, 1, 24, BLUE);
|
GetScreenHeight() - 40, 1, 24, BLUE);
|
||||||
|
|
||||||
EndDrawing();
|
EndDrawing();
|
||||||
|
|||||||
@ -116,7 +116,7 @@ int main(void)
|
|||||||
// Update model animation
|
// Update model animation
|
||||||
ModelAnimation anim = modelAnimations[animIndex];
|
ModelAnimation anim = modelAnimations[animIndex];
|
||||||
animCurrentFrame = (animCurrentFrame + 1)%anim.keyframeCount;
|
animCurrentFrame = (animCurrentFrame + 1)%anim.keyframeCount;
|
||||||
UpdateModelAnimation(characterModel, anim, animCurrentFrame);
|
UpdateModelAnimation(characterModel, anim, (float)animCurrentFrame);
|
||||||
//----------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------
|
||||||
|
|
||||||
// Draw
|
// Draw
|
||||||
@ -129,7 +129,7 @@ int main(void)
|
|||||||
// Draw character
|
// Draw character
|
||||||
Quaternion characterRotate = QuaternionFromAxisAngle((Vector3){ 0.0f, 1.0f, 0.0f }, angle*DEG2RAD);
|
Quaternion characterRotate = QuaternionFromAxisAngle((Vector3){ 0.0f, 1.0f, 0.0f }, angle*DEG2RAD);
|
||||||
characterModel.transform = MatrixMultiply(QuaternionToMatrix(characterRotate), MatrixTranslate(position.x, position.y, position.z));
|
characterModel.transform = MatrixMultiply(QuaternionToMatrix(characterRotate), MatrixTranslate(position.x, position.y, position.z));
|
||||||
UpdateModelAnimation(characterModel, anim, animCurrentFrame);
|
UpdateModelAnimation(characterModel, anim, (float)animCurrentFrame);
|
||||||
DrawMesh(characterModel.meshes[0], characterModel.materials[1], characterModel.transform);
|
DrawMesh(characterModel.meshes[0], characterModel.materials[1], characterModel.transform);
|
||||||
|
|
||||||
// Draw equipments (hat, sword, shield)
|
// Draw equipments (hat, sword, shield)
|
||||||
|
|||||||
@ -117,7 +117,7 @@ int main(void)
|
|||||||
|
|
||||||
frameCounter++;
|
frameCounter++;
|
||||||
frameCounter %= (anims[0].keyframeCount);
|
frameCounter %= (anims[0].keyframeCount);
|
||||||
UpdateModelAnimation(robot, anims[0], frameCounter);
|
UpdateModelAnimation(robot, anims[0], (float)frameCounter);
|
||||||
|
|
||||||
// Move light with arrow keys
|
// Move light with arrow keys
|
||||||
const float cameraSpeed = 0.05f;
|
const float cameraSpeed = 0.05f;
|
||||||
|
|||||||
@ -89,7 +89,7 @@ int main(void)
|
|||||||
|
|
||||||
// Cotangent (orange)
|
// Cotangent (orange)
|
||||||
DrawLineEx((Vector2){ center.x , limitMin.y }, (Vector2){ cotangentPoint.x, limitMin.y }, 2.0f, ORANGE);
|
DrawLineEx((Vector2){ center.x , limitMin.y }, (Vector2){ cotangentPoint.x, limitMin.y }, 2.0f, ORANGE);
|
||||||
DrawLineDashed(center, cotangentPoint, 10.0f, 4.0f, ORANGE);
|
DrawLineDashed(center, cotangentPoint, 10, 4, ORANGE);
|
||||||
|
|
||||||
// Side background
|
// Side background
|
||||||
DrawLine(580, 0, 580, GetScreenHeight(), (Color){ 218, 218, 218, 255 });
|
DrawLine(580, 0, 580, GetScreenHeight(), (Color){ 218, 218, 218, 255 });
|
||||||
@ -106,48 +106,48 @@ int main(void)
|
|||||||
DrawLineEx((Vector2){ start.x, start.y + start.height/2 }, (Vector2){ start.x + start.width, start.y + start.height/2 }, 2.0f, GRAY);
|
DrawLineEx((Vector2){ start.x, start.y + start.height/2 }, (Vector2){ start.x + start.width, start.y + start.height/2 }, 2.0f, GRAY);
|
||||||
|
|
||||||
// Wave graph axis labels
|
// Wave graph axis labels
|
||||||
DrawText("1", start.x - 8, start.y, 6, GRAY);
|
DrawText("1", (int)start.x - 8, (int)start.y, 6, GRAY);
|
||||||
DrawText("0", start.x - 8, start.y + start.height/2 - 6, 6, GRAY);
|
DrawText("0", (int)start.x - 8, (int)start.y + (int)start.height/2 - 6, 6, GRAY);
|
||||||
DrawText("-1", start.x - 12, start.y + start.height - 8, 6, GRAY);
|
DrawText("-1", (int)start.x - 12, (int)start.y + (int)start.height - 8, 6, GRAY);
|
||||||
DrawText("0", start.x - 2, start.y + start.height + 4, 6, GRAY);
|
DrawText("0", (int)start.x - 2, (int)start.y + (int)start.height + 4, 6, GRAY);
|
||||||
DrawText("360", start.x + start.width - 8, start.y + start.height + 4, 6, GRAY);
|
DrawText("360", (int)start.x + (int)start.width - 8, (int)start.y + (int)start.height + 4, 6, GRAY);
|
||||||
|
|
||||||
// Sine (red - vertical)
|
// Sine (red - vertical)
|
||||||
DrawLineEx((Vector2){ center.x, center.y }, (Vector2){ center.x, point.y }, 2.0f, RED);
|
DrawLineEx((Vector2){ center.x, center.y }, (Vector2){ center.x, point.y }, 2.0f, RED);
|
||||||
DrawLineDashed((Vector2){ point.x, center.y }, (Vector2){ point.x, point.y }, 10.0f, 4.0f, RED);
|
DrawLineDashed((Vector2){ point.x, center.y }, (Vector2){ point.x, point.y }, 10, 4, RED);
|
||||||
DrawText(TextFormat("Sine %.2f", sinRad), 640, 190, 6, RED);
|
DrawText(TextFormat("Sine %.2f", sinRad), 640, 190, 6, RED);
|
||||||
DrawCircleV((Vector2){ start.x + (angle/360.0f)*start.width, start.y + ((-sinRad + 1)*start.height/2.0f) }, 4.0f, RED);
|
DrawCircleV((Vector2){ start.x + (angle/360.0f)*start.width, start.y + ((-sinRad + 1)*start.height/2.0f) }, 4.0f, RED);
|
||||||
DrawSplineLinear(sinePoints, WAVE_POINTS, 1.0f, RED);
|
DrawSplineLinear(sinePoints, WAVE_POINTS, 1.0f, RED);
|
||||||
|
|
||||||
// Cosine (blue - horizontal)
|
// Cosine (blue - horizontal)
|
||||||
DrawLineEx((Vector2){ center.x, center.y }, (Vector2){ point.x, center.y }, 2.0f, BLUE);
|
DrawLineEx((Vector2){ center.x, center.y }, (Vector2){ point.x, center.y }, 2.0f, BLUE);
|
||||||
DrawLineDashed((Vector2){ center.x , point.y }, (Vector2){ point.x, point.y }, 10.0f, 4.0f, BLUE);
|
DrawLineDashed((Vector2){ center.x , point.y }, (Vector2){ point.x, point.y }, 10, 4, BLUE);
|
||||||
DrawText(TextFormat("Cosine %.2f", cosRad), 640, 210, 6, BLUE);
|
DrawText(TextFormat("Cosine %.2f", cosRad), 640, 210, 6, BLUE);
|
||||||
DrawCircleV((Vector2){ start.x + (angle/360.0f)*start.width, start.y + ((-cosRad + 1)*start.height/2.0f) }, 4.0f, BLUE);
|
DrawCircleV((Vector2){ start.x + (angle/360.0f)*start.width, start.y + ((-cosRad + 1)*start.height/2.0f) }, 4.0f, BLUE);
|
||||||
DrawSplineLinear(cosPoints, WAVE_POINTS, 1.0f, BLUE);
|
DrawSplineLinear(cosPoints, WAVE_POINTS, 1.0f, BLUE);
|
||||||
|
|
||||||
// Tangent (purple)
|
// Tangent (purple)
|
||||||
DrawLineEx((Vector2){ limitMax.x , center.y }, (Vector2){ limitMax.x, tangentPoint.y }, 2.0f, PURPLE);
|
DrawLineEx((Vector2){ limitMax.x , center.y }, (Vector2){ limitMax.x, tangentPoint.y }, 2.0f, PURPLE);
|
||||||
DrawLineDashed(center, tangentPoint, 10.0f, 4.0f, PURPLE);
|
DrawLineDashed(center, tangentPoint, 10, 4, PURPLE);
|
||||||
DrawText(TextFormat("Tangent %.2f", tangent), 640, 230, 6, PURPLE);
|
DrawText(TextFormat("Tangent %.2f", tangent), 640, 230, 6, PURPLE);
|
||||||
|
|
||||||
// Cotangent (orange)
|
// Cotangent (orange)
|
||||||
DrawText(TextFormat("Cotangent %.2f", cotangent), 640, 250, 6, ORANGE);
|
DrawText(TextFormat("Cotangent %.2f", cotangent), 640, 250, 6, ORANGE);
|
||||||
|
|
||||||
// Complementary angle (beige)
|
// Complementary angle (beige)
|
||||||
DrawCircleSectorLines(center, radius*0.6f , -angle, -90.0f , 36.0f, BEIGE);
|
DrawCircleSectorLines(center, radius*0.6f , -angle, -90.0f , 36, BEIGE);
|
||||||
DrawText(TextFormat("Complementary %0.f°",complementary), 640, 150, 6, BEIGE);
|
DrawText(TextFormat("Complementary %0.f°",complementary), 640, 150, 6, BEIGE);
|
||||||
|
|
||||||
// Supplementary angle (darkblue)
|
// Supplementary angle (darkblue)
|
||||||
DrawCircleSectorLines(center, radius*0.5f , -angle, -180.0f , 36.0f, DARKBLUE);
|
DrawCircleSectorLines(center, radius*0.5f , -angle, -180.0f , 36, DARKBLUE);
|
||||||
DrawText(TextFormat("Supplementary %0.f°",supplementary), 640, 130, 6, DARKBLUE);
|
DrawText(TextFormat("Supplementary %0.f°",supplementary), 640, 130, 6, DARKBLUE);
|
||||||
|
|
||||||
// Explementary angle (pink)
|
// Explementary angle (pink)
|
||||||
DrawCircleSectorLines(center, radius*0.4f , -angle, -360.0f , 36.0f, PINK);
|
DrawCircleSectorLines(center, radius*0.4f , -angle, -360.0f , 36, PINK);
|
||||||
DrawText(TextFormat("Explementary %0.f°",explementary), 640, 170, 6, PINK);
|
DrawText(TextFormat("Explementary %0.f°",explementary), 640, 170, 6, PINK);
|
||||||
|
|
||||||
// Current angle - arc (lime), radius (black), endpoint (black)
|
// Current angle - arc (lime), radius (black), endpoint (black)
|
||||||
DrawCircleSectorLines(center, radius*0.7f , -angle, 0.0f, 36.0f, LIME);
|
DrawCircleSectorLines(center, radius*0.7f , -angle, 0.0f, 36, LIME);
|
||||||
DrawLineEx((Vector2){ center.x , center.y }, point, 2.0f, BLACK);
|
DrawLineEx((Vector2){ center.x , center.y }, point, 2.0f, BLACK);
|
||||||
DrawCircleV(point, 4.0f, BLACK);
|
DrawCircleV(point, 4.0f, BLACK);
|
||||||
|
|
||||||
|
|||||||
@ -30,7 +30,7 @@
|
|||||||
//----------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------
|
||||||
typedef struct TurtleState {
|
typedef struct TurtleState {
|
||||||
Vector2 origin;
|
Vector2 origin;
|
||||||
double angle;
|
float angle;
|
||||||
} TurtleState;
|
} TurtleState;
|
||||||
|
|
||||||
typedef struct PenroseLSystem {
|
typedef struct PenroseLSystem {
|
||||||
|
|||||||
@ -160,7 +160,7 @@ int main(void)
|
|||||||
|
|
||||||
// Draw inner circle to create donut effect
|
// Draw inner circle to create donut effect
|
||||||
// TODO: This is a hacky solution, better use DrawRing()
|
// TODO: This is a hacky solution, better use DrawRing()
|
||||||
if (showDonut) DrawCircle(center.x, center.y, donutInnerRadius, RAYWHITE);
|
if (showDonut) DrawCircleV(center, donutInnerRadius, RAYWHITE);
|
||||||
|
|
||||||
startAngle += sweepAngle;
|
startAngle += sweepAngle;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -47,8 +47,8 @@ int main(void)
|
|||||||
// Setup the stars with a random position
|
// Setup the stars with a random position
|
||||||
for (int i = 0; i < STAR_COUNT; i++)
|
for (int i = 0; i < STAR_COUNT; i++)
|
||||||
{
|
{
|
||||||
stars[i].x = GetRandomValue(-screenWidth*0.5f, screenWidth*0.5f);
|
stars[i].x = (float)GetRandomValue(-screenWidth / 2, (int)screenWidth / 2);
|
||||||
stars[i].y = GetRandomValue(-screenHeight*0.5f, screenHeight*0.5f);
|
stars[i].y = (float)GetRandomValue(-screenHeight / 2, (int)screenHeight / 2);
|
||||||
stars[i].z = 1.0f;
|
stars[i].z = 1.0f;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -85,8 +85,8 @@ int main(void)
|
|||||||
if ((stars[i].z < 0.0f) || (starsScreenPos[i].x < 0) || (starsScreenPos[i].y < 0.0f) ||
|
if ((stars[i].z < 0.0f) || (starsScreenPos[i].x < 0) || (starsScreenPos[i].y < 0.0f) ||
|
||||||
(starsScreenPos[i].x > screenWidth) || (starsScreenPos[i].y > screenHeight))
|
(starsScreenPos[i].x > screenWidth) || (starsScreenPos[i].y > screenHeight))
|
||||||
{
|
{
|
||||||
stars[i].x = GetRandomValue(-screenWidth*0.5f, screenWidth*0.5f);
|
stars[i].x = (float)GetRandomValue(-screenWidth / 2, screenWidth / 2);
|
||||||
stars[i].y = GetRandomValue(-screenHeight*0.5f, screenHeight*0.5f);
|
stars[i].y = (float)GetRandomValue(-screenHeight / 2, screenHeight / 2);
|
||||||
stars[i].z = 1.0f;
|
stars[i].z = 1.0f;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -109,7 +109,7 @@ int main(void)
|
|||||||
DrawRectangleRec(textContainerRect, BLUE);
|
DrawRectangleRec(textContainerRect, BLUE);
|
||||||
|
|
||||||
// Get the size of the text to draw
|
// Get the size of the text to draw
|
||||||
Vector2 textSize = MeasureTextEx(font, words[wordIndex], fontSize, fontSize*.1f);
|
Vector2 textSize = MeasureTextEx(font, words[wordIndex], (float)fontSize, fontSize*.1f);
|
||||||
|
|
||||||
// Calculate the top-left text position based on the rectangle and alignment
|
// Calculate the top-left text position based on the rectangle and alignment
|
||||||
Vector2 textPos = (Vector2){
|
Vector2 textPos = (Vector2){
|
||||||
@ -118,7 +118,7 @@ int main(void)
|
|||||||
};
|
};
|
||||||
|
|
||||||
// Draw the text
|
// Draw the text
|
||||||
DrawTextEx(font, words[wordIndex], textPos, fontSize, fontSize*.1f, RAYWHITE);
|
DrawTextEx(font, words[wordIndex], textPos, (float)fontSize, fontSize*.1f, RAYWHITE);
|
||||||
|
|
||||||
EndDrawing();
|
EndDrawing();
|
||||||
//----------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------
|
||||||
|
|||||||
Reference in New Issue
Block a user