From b022dfa6e8baecd865eeada9f5fc6f01bdfc3201 Mon Sep 17 00:00:00 2001 From: John McCardle Date: Sat, 12 Aug 2023 15:07:48 -0400 Subject: [PATCH] Cleanup: remove VectorShape class (it'll return, someday...) --- src/UITestScene.h | 4 ++-- src/VectorShape.cpp | 48 --------------------------------------------- src/VectorShape.h | 16 --------------- 3 files changed, 2 insertions(+), 66 deletions(-) delete mode 100644 src/VectorShape.cpp delete mode 100644 src/VectorShape.h diff --git a/src/UITestScene.h b/src/UITestScene.h index 539d934..4621e41 100644 --- a/src/UITestScene.h +++ b/src/UITestScene.h @@ -5,7 +5,7 @@ #include "GameEngine.h" #include "Button.h" #include "UIMenu.h" -#include "VectorShape.h" +//#include "VectorShape.h" #include "Grid.h" class UITestScene: public Scene @@ -16,7 +16,7 @@ class UITestScene: public Scene //UIMenu test_menu; //UIMenu test_menu2; std::vector menus; - VectorShape test_ship; + //VectorShape test_ship; float desired_angle = 0; sf::View viewport; float zoom = 1; diff --git a/src/VectorShape.cpp b/src/VectorShape.cpp deleted file mode 100644 index 7c4b805..0000000 --- a/src/VectorShape.cpp +++ /dev/null @@ -1,48 +0,0 @@ -#include "VectorShape.h" - -VectorShape::VectorShape() -{ - sf::Vector2f p(0, 0); - points.push_back(sf::Vector2f(0, 40)); - points.push_back(sf::Vector2f(-30, -30)); - points.push_back(sf::Vector2f(0, -20)); - points.push_back(sf::Vector2f(30, -30)); -} - -void VectorShape::render(sf::RenderWindow & window) -{ - sf::Transform t; - //t.scale(sf::Vector2f(0.5, 0.5)); - //t.scale(sf::Vector2f(3, 3)); - t.translate(position); - t.rotate(angle); - - sf::VertexArray lines(sf::LineStrip, int(points.size())+1); - for ( int i = 0; i < points.size(); i++) - { - lines[i] = points[i]; - } - lines[points.size()] = points[0]; - - window.draw(lines, t); -} - -void VectorShape::miner() -{ - points.clear(); - points.push_back(sf::Vector2f(0, -40)); - - float mirror_x[12] = {-1, -1, -.5, -.5, -2, -2, -3, -3, -2, -2, -1.5, -0.5}; - float fixed_y[12] = {-3, -2, -1.5, -1, -1, -.5, 0, 1, 1.5, 2, 3, 3}; - - for (int i = 0; i < 12; i++) - { - points.push_back(sf::Vector2f(mirror_x[i] * 10, fixed_y[i] * 10)); - } - points.push_back(sf::Vector2f(0, 20)); - - for (int i = 11; i >= 0; i--) - { - points.push_back(sf::Vector2f(mirror_x[i] * -10, fixed_y[i] * 10)); - } -} diff --git a/src/VectorShape.h b/src/VectorShape.h deleted file mode 100644 index 75e188d..0000000 --- a/src/VectorShape.h +++ /dev/null @@ -1,16 +0,0 @@ -#pragma once -#include "Common.h" - -class VectorShape -{ - public: - VectorShape(); - std::vector points; - void render(sf::RenderWindow & window); - float angle; - sf::Vector2f position; - void miner(); - protected: - - private: -};