From c3518c883f2cef2b746777aa83662d1019f76ea7 Mon Sep 17 00:00:00 2001 From: incredibleLeitman Date: Sun, 29 Nov 2020 03:16:06 +0100 Subject: [PATCH] removed unused includes, minor refactoring --- main.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/main.cpp b/main.cpp index f6d3240..ba448d4 100644 --- a/main.cpp +++ b/main.cpp @@ -6,9 +6,7 @@ #include // TODO: or use arrays for maximum performance? #include "Display.h" -#include "Point.h" // TODO: check if there is a usable SFML or c++ class -#include "Timing.h" -#include "Utility.h" +#include "Point.h" // TODOs: // - use SFML vec2 instead of Point class @@ -80,6 +78,8 @@ int main (int argc, char **argv) std::string line; std::getline(in, line); // get first line for explizit valueCount valCount = std::stoi(line); + float x = 0; + float y = 0; for (int i = 0; i < valCount; ++i) { getline(in, line); @@ -87,8 +87,8 @@ int main (int argc, char **argv) size_t pos = line.find(','); if (pos != std::string::npos) { - float x = std::stof(line.substr(0, pos)); - float y = std::stof(line.substr(pos + 1)); + x = std::stof(line.substr(0, pos)); + y = std::stof(line.substr(pos + 1)); points.push_back(Point(x, y)); } else