From 22e299ed3d9f2ab3f399b365f351867e5785c855 Mon Sep 17 00:00:00 2001 From: codyr Date: Mon, 19 Sep 2022 18:21:36 -0500 Subject: [PATCH 1/2] Added two names --- PR_Practice.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/PR_Practice.txt b/PR_Practice.txt index da6acba..7a1608f 100644 --- a/PR_Practice.txt +++ b/PR_Practice.txt @@ -1 +1,3 @@ -Sahil Jain \ No newline at end of file +Sahil Jain +Cody Rushing +Mehul Murali \ No newline at end of file From 285a5d954a13f9b4d449d9ff0236946848fdf601 Mon Sep 17 00:00:00 2001 From: codyr Date: Mon, 3 Oct 2022 19:45:24 -0500 Subject: [PATCH 2/2] Macbook code its kinda broken but thanks to vivek we chillin --- graphics-service/inc/WeatherWidget.h | 45 ++++++++++++++-------------- graphics-service/src/Utility.cpp | 2 +- 2 files changed, 23 insertions(+), 24 deletions(-) diff --git a/graphics-service/inc/WeatherWidget.h b/graphics-service/inc/WeatherWidget.h index bae6b0c..5ed3435 100644 --- a/graphics-service/inc/WeatherWidget.h +++ b/graphics-service/inc/WeatherWidget.h @@ -20,7 +20,7 @@ class WeatherWidget : public Widget { Widget (x, y, w, h, n) { Image weatherIcons = LoadImage("../resources/Adjusted-Weather-Icons.png"); - ImageResize(&weatherIcons, IMAGE_SIZE_X, IMAGE_SIZE_Y); + ImageResize(&weatherIcons, 50, 50); icons = LoadTextureFromImage(weatherIcons); UnloadImage(weatherIcons); @@ -60,7 +60,7 @@ class WeatherWidget : public Widget { // Obtains rectangle for weather icon Rectangle rect = iconMap["Clear"]; // Position for icon on screen - Vector2 icon_pos {pos_x, pos_y + 30}; + Vector2 icon_pos {(float) pos_x, (float) (pos_y) + 30}; DrawTextureRec(icons, rect, icon_pos, WHITE); DrawText(temperature.c_str(), pos_x + 80, pos_y + 60, 30, SKYBLUE); @@ -74,32 +74,31 @@ class WeatherWidget : public Widget { bool retrievedStrings = false; bool isCelsius = false; Json::Value informations = new Json::Value(); - const int IMAGE_SIZE_X = MONITOR_SIZE_X / 2; - const int IMAGE_SIZE_Y = MONITOR_SIZE_Y / 1.5; - const int ICON_SIZE_X = IMAGE_SIZE_X / 8.5; - const int ICON_SIZE_Y = IMAGE_SIZE_Y / 6; + std::string temperature; std::string city; std::string weatherConditions; + std::map iconMap = { - {"Clouds", {IMAGE_SIZE_X/10, IMAGE_SIZE_Y/7, ICON_SIZE_X, ICON_SIZE_Y}}, /* Cloudy */ - {"Thunderstorm", {IMAGE_SIZE_X/10, IMAGE_SIZE_Y/2.3, ICON_SIZE_X, ICON_SIZE_Y}}, /* Thunderstorm */ - {"Clear", {IMAGE_SIZE_X/3.8, IMAGE_SIZE_Y/6.3, ICON_SIZE_X, ICON_SIZE_Y}}, /* Sunny/Clear */ - {"Rain", {IMAGE_SIZE_X/3.8, IMAGE_SIZE_Y/2.3, ICON_SIZE_X, ICON_SIZE_Y}}, /* Rain */ - {"Drizzle", {IMAGE_SIZE_X/3.8, IMAGE_SIZE_Y/2.3, ICON_SIZE_X, ICON_SIZE_Y}}, /* Drizzle */ - {"Snow", {IMAGE_SIZE_X/2.3, IMAGE_SIZE_Y/2.3, ICON_SIZE_X, ICON_SIZE_Y}}, /* Snow */ - {"Mist", {IMAGE_SIZE_X/1.63, IMAGE_SIZE_Y/2.3, ICON_SIZE_X, ICON_SIZE_Y}}, /* Mist */ - {"Smoke", {IMAGE_SIZE_X/1.63, IMAGE_SIZE_Y/2.3, ICON_SIZE_X, ICON_SIZE_Y}}, /* Smoke */ - {"Haze", {IMAGE_SIZE_X/1.63, IMAGE_SIZE_Y/2.3, ICON_SIZE_X, ICON_SIZE_Y}}, /* Haze */ - {"Dust", {IMAGE_SIZE_X/1.63, IMAGE_SIZE_Y/2.3, ICON_SIZE_X, ICON_SIZE_Y}}, /* Dust */ - {"Fog", {IMAGE_SIZE_X/1.63, IMAGE_SIZE_Y/2.3, ICON_SIZE_X, ICON_SIZE_Y}}, /* Fog */ - {"Sand", {IMAGE_SIZE_X/1.63, IMAGE_SIZE_Y/2.3, ICON_SIZE_X, ICON_SIZE_Y}}, /* Sand */ - {"Dust", {IMAGE_SIZE_X/1.63, IMAGE_SIZE_Y/2.3, ICON_SIZE_X, ICON_SIZE_Y}}, /* Dust */ - {"Ash", {IMAGE_SIZE_X/1.63, IMAGE_SIZE_Y/2.3, ICON_SIZE_X, ICON_SIZE_Y}}, /* Ash */ - {"Squall", {IMAGE_SIZE_X/1.63, IMAGE_SIZE_Y/2.3, ICON_SIZE_X, ICON_SIZE_Y}}, /* Squall */ - {"Tornado", {IMAGE_SIZE_X/1.63, IMAGE_SIZE_Y/2.3, ICON_SIZE_X, ICON_SIZE_Y}}, /* Tornado */ - {"Loading...", {IMAGE_SIZE_X/1.63, IMAGE_SIZE_Y/2.3, ICON_SIZE_X, ICON_SIZE_Y}} /* Default */ + {"Clouds", {50, 50, 50, 50}}, /* Cloudy */ + {"Thunderstorm", {50/10, 50/2.3, 50, 50}}, /* Thunderstorm */ + {"Clear", {50/3.8, 50/6.3, 50, 50}}, /* Sunny/Clear */ + {"Rain", {50/3.8, 50/2.3, 50, 50}}, /* Rain */ + {"Drizzle", {50/3.8, 50/2.3, 50, 50}}, /* Drizzle */ + {"Snow", {50/2.3, 50/2.3, 50, 50}}, /* Snow */ + {"Mist", {50/1.63, 50/2.3, 50, 50}}, /* Mist */ + {"Smoke", {50/1.63, 50/2.3, 50, 50}}, /* Smoke */ + {"Haze", {50/1.63, 50/2.3, 50, 50}}, /* Haze */ + {"Dust", {50/1.63, 50/2.3, 50, 50}}, /* Dust */ + {"Fog", {50/1.63, 50/2.3, 50, 50}}, /* Fog */ + {"Sand", {50/1.63, 50/2.3, 50, 50}}, /* Sand */ + {"Dust", {50/1.63, 50/2.3, 50, 50}}, /* Dust */ + {"Ash", {50/1.63, 50/2.3, 50, 50}}, /* Ash */ + {"Squall", {50/1.63, 50/2.3, 50, 50}}, /* Squall */ + {"Tornado", {50/1.63, 50/2.3, 50, 50}}, /* Tornado */ + {"Loading...", {50/1.63, 50/2.3, 50, 50}} /* Default */ }; }; + #endif \ No newline at end of file diff --git a/graphics-service/src/Utility.cpp b/graphics-service/src/Utility.cpp index 4194431..899336d 100644 --- a/graphics-service/src/Utility.cpp +++ b/graphics-service/src/Utility.cpp @@ -67,6 +67,6 @@ void get_http_request(bool* finished, const string url, Json::Value* storage) { void draw_loading_wheel(uint32_t x, uint32_t y, uint32_t r) { DrawCircleSectorLines( - Vector2{x, y}, r, 0.0, 0.5, 1, MAIN_COLOR + Vector2{(float) x, (float) y}, r, 0.0, 0.5, 1, MAIN_COLOR ); }