diff --git a/src/main.cpp b/src/main.cpp index a4d0e15..9503899 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -13,6 +13,9 @@ #include "rlgl.h" #define CHUNK_SIZE 32 +#ifndef PI +#define PI 3.1415926535f +#endif #define CHUNK_HEIGHT 128 #define RENDER_DISTANCE 1 // 3x3 chunks visible for performance @@ -1260,11 +1263,11 @@ int main(void) // --- PLAYER NAME POPUP (IF MISSING) --- if (playerName == "") { DrawRectangle(0, 0, currentWidth, currentHeight, (Color){ 0, 0, 0, 200 }); - int pw = 400, ph = 200; - Rectangle pBox = { (float)currentWidth/2 - pw/2, (float)currentHeight/2 - ph/2, (float)pw, (float)ph }; - DrawRectangleRec(pBox, (Color){ 40, 40, 40, 255 }); - DrawRectangleLinesEx(pBox, 2.0f, WHITE); - DrawTextEx(customFont, "Enter Your Name", (Vector2){ pBox.x + 20, pBox.y + 20 }, 24, 1.0f, WHITE); + int nw = 400, nh = 200; + Rectangle nBox = { (float)currentWidth/2 - nw/2, (float)currentHeight/2 - nh/2, (float)nw, (float)nh }; + DrawRectangleRec(nBox, (Color){ 40, 40, 40, 255 }); + DrawRectangleLinesEx(nBox, 2.0f, WHITE); + DrawTextEx(customFont, "Enter Your Name", (Vector2){ nBox.x + 20, nBox.y + 20 }, 24, 1.0f, WHITE); static char inputName[32] = {0}; int c = GetCharPressed(); @@ -1281,8 +1284,8 @@ int main(void) if (len > 0) inputName[len-1] = '\0'; } - DrawRectangle(pBox.x + 20, pBox.y + 60, pw - 40, 40, BLACK); - DrawTextEx(customFont, inputName, (Vector2){ pBox.x + 30, pBox.y + 70 }, 20, 1.0f, WHITE); + DrawRectangle(nBox.x + 20, nBox.y + 60, nw - 40, 40, BLACK); + DrawTextEx(customFont, inputName, (Vector2){ nBox.x + 30, nBox.y + 70 }, 20, 1.0f, WHITE); if (IsKeyPressed(KEY_ENTER) && strlen(inputName) > 0) { playerName = inputName;