Cleanup: remove VectorShape class (it'll return, someday...)
This commit is contained in:
parent
232ce34d54
commit
b022dfa6e8
|
@ -5,7 +5,7 @@
|
||||||
#include "GameEngine.h"
|
#include "GameEngine.h"
|
||||||
#include "Button.h"
|
#include "Button.h"
|
||||||
#include "UIMenu.h"
|
#include "UIMenu.h"
|
||||||
#include "VectorShape.h"
|
//#include "VectorShape.h"
|
||||||
#include "Grid.h"
|
#include "Grid.h"
|
||||||
|
|
||||||
class UITestScene: public Scene
|
class UITestScene: public Scene
|
||||||
|
@ -16,7 +16,7 @@ class UITestScene: public Scene
|
||||||
//UIMenu test_menu;
|
//UIMenu test_menu;
|
||||||
//UIMenu test_menu2;
|
//UIMenu test_menu2;
|
||||||
std::vector<UIMenu> menus;
|
std::vector<UIMenu> menus;
|
||||||
VectorShape test_ship;
|
//VectorShape test_ship;
|
||||||
float desired_angle = 0;
|
float desired_angle = 0;
|
||||||
sf::View viewport;
|
sf::View viewport;
|
||||||
float zoom = 1;
|
float zoom = 1;
|
||||||
|
|
|
@ -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));
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,16 +0,0 @@
|
||||||
#pragma once
|
|
||||||
#include "Common.h"
|
|
||||||
|
|
||||||
class VectorShape
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
VectorShape();
|
|
||||||
std::vector<sf::Vector2f> points;
|
|
||||||
void render(sf::RenderWindow & window);
|
|
||||||
float angle;
|
|
||||||
sf::Vector2f position;
|
|
||||||
void miner();
|
|
||||||
protected:
|
|
||||||
|
|
||||||
private:
|
|
||||||
};
|
|
Loading…
Reference in New Issue