Align game clock and fix crafting table textures - v1.5.2
|
Before Width: | Height: | Size: 477 KiB After Width: | Height: | Size: 738 KiB |
|
Before Width: | Height: | Size: 328 KiB After Width: | Height: | Size: 597 KiB |
|
Before Width: | Height: | Size: 477 KiB After Width: | Height: | Size: 738 KiB |
|
Before Width: | Height: | Size: 328 KiB After Width: | Height: | Size: 597 KiB |
|
Before Width: | Height: | Size: 477 KiB After Width: | Height: | Size: 738 KiB |
|
Before Width: | Height: | Size: 328 KiB After Width: | Height: | Size: 597 KiB |
10
src/main.cpp
|
|
@ -986,8 +986,8 @@ int main(void)
|
||||||
DrawTexturePro(titleTexture, sourceRec, destRec, origin, 0.0f, WHITE);
|
DrawTexturePro(titleTexture, sourceRec, destRec, origin, 0.0f, WHITE);
|
||||||
EndMode2D();
|
EndMode2D();
|
||||||
|
|
||||||
// Show Version Number (v1.5.1) in Red
|
// Show Version Number (v1.5.2) in Red
|
||||||
DrawTextEx(customFont, "v1.5.1", (Vector2){ (float)currentWidth - 140, (float)currentHeight - 40 }, 22, 1.0f, RED);
|
DrawTextEx(customFont, "v1.5.2", (Vector2){ (float)currentWidth - 140, (float)currentHeight - 40 }, 22, 1.0f, RED);
|
||||||
}
|
}
|
||||||
|
|
||||||
Vector2 mousePos = GetMousePosition();
|
Vector2 mousePos = GetMousePosition();
|
||||||
|
|
@ -1421,7 +1421,8 @@ int main(void)
|
||||||
// ---- Day / Night Cycle Calculations ----
|
// ---- Day / Night Cycle Calculations ----
|
||||||
float cycleLength = 300.0f; // 5 minutes
|
float cycleLength = 300.0f; // 5 minutes
|
||||||
float timeOfDay = fmodf(gameTime, cycleLength) / cycleLength;
|
float timeOfDay = fmodf(gameTime, cycleLength) / cycleLength;
|
||||||
float sunAngle = timeOfDay * 2.0f * PI - PI/2.0f; // Offset so it starts at sunrise
|
// timeOfDay: 0.0 = Midnight, 0.25 = 6am (Sunrise), 0.5 = Noon, 0.75 = 6pm (Sunset)
|
||||||
|
float sunAngle = timeOfDay * 2.0f * PI - PI/2.0f;
|
||||||
|
|
||||||
float dayFactor = (sinf(sunAngle) + 1.0f) / 2.0f; // 0 (night) to 1 (day)
|
float dayFactor = (sinf(sunAngle) + 1.0f) / 2.0f; // 0 (night) to 1 (day)
|
||||||
float lightLevel = 0.2f + 0.8f * dayFactor; // Ambient light multiplier
|
float lightLevel = 0.2f + 0.8f * dayFactor; // Ambient light multiplier
|
||||||
|
|
@ -1576,8 +1577,7 @@ int main(void)
|
||||||
(Vector2){ 10, 80 }, 16, 1.0f, DARKGRAY);
|
(Vector2){ 10, 80 }, 16, 1.0f, DARKGRAY);
|
||||||
|
|
||||||
// --- In-Game Clock ---
|
// --- In-Game Clock ---
|
||||||
float clockTime = fmodf(timeOfDay + 0.25f, 1.0f); // Offset so 0.5 is noon
|
int totalMinutes = (int)(timeOfDay * 24 * 60);
|
||||||
int totalMinutes = (int)(clockTime * 24 * 60);
|
|
||||||
int hours = (totalMinutes / 60) % 24;
|
int hours = (totalMinutes / 60) % 24;
|
||||||
int minutes = totalMinutes % 60;
|
int minutes = totalMinutes % 60;
|
||||||
const char* ampm = (hours >= 12) ? "PM" : "AM";
|
const char* ampm = (hours >= 12) ? "PM" : "AM";
|
||||||
|
|
|
||||||