POSITIVE-MENTAL-ATTITUDE 9 years ago
parent
commit
68c6f1ec2f

BIN
data/background/75pxjitter03.png


BIN
data/background/Foreground_normal.jpg


+ 0 - 4
data/hints.txt

@@ -1,4 +0,0 @@
-This is a hint. A placeholder.
-Each triangle has 45 degrees between its arms.
-Triangles do not have speed caps.
-[](){}

BIN
data/triangle/Illuminati-Reference-UNUSED.png


BIN
data/triangle/Nevermore.png


BIN
data/triangle/Texture-Reference-UNUSED.png


data/triangle/Texture.png → data/triangle/Tropical.png


+ 3 - 0
data/triangle/about.txt

@@ -7,6 +7,9 @@ I actually made a derivative work and I hope no one will murder me for that. Scr
 Illuminati.png and reference:
 Somewhere from the internet.
 
+Nevermore.png:
+It's a part of Nevermore's head texture; stolen from Valve.
+
 The rest is created by POSITIVE MENTAL ATTITUDE (https://github.com/POSITIVE-MENTAL-ATTITUDE)
 and licensed under Creative Commons: Attribution-ShareAlike 4.0 International License
 http://creativecommons.org/licenses/by-sa/4.0/

File diff suppressed because it is too large
+ 0 - 41
data/ttf/soria/SIL Open Font License.txt


BIN
data/ttf/soria/soria-font.ttf


+ 1 - 0
src/Circle.cpp

@@ -27,6 +27,7 @@ Circle::Circle(sf::Color color, float scale): _size(10)
 		_arc[i].setRotation(3.6f * i);
 		_arc[i].setScale(scale, scale);
 	}
+	_elapsedTime = sf::seconds(5.f);
 }
 
 Circle::~Circle()

+ 1 - 0
src/Context.hpp

@@ -30,6 +30,7 @@ struct Context
 	bool vsync;
 	bool needsUpdate;
 	bool running;
+	bool nevermore;
 	
 	Assets* assets;
 	TrianglesWindow* window;

+ 0 - 2
src/Foreground.cpp

@@ -152,7 +152,6 @@ void Foreground::create(sf::Image& foreground, sf::Image& normal, sf::Image& map
 				}
 			}
 		}
-	Echo::info(_starPosition.size());
 	for(unsigned i = 0; i < _tiles.size(); ++i)
 	{
 		_tiles[i].second.loadFromImage(_tiles[i].first);
@@ -237,6 +236,5 @@ const bool Foreground::getStarPosition(sf::Vector2f& starPosition)
 	
 	starPosition = sf::Vector2f(_starPosition.back());
 	_starPosition.pop_back();
-	Echo::debug(starPosition.x);
 	return true;
 }

+ 21 - 6
src/IngameState.cpp

@@ -51,9 +51,22 @@ void IngameState::init()
 	_context->assets->loadTexture("data/background/Background.jpg").setRepeated(true);
 
 	bool illuminati = (rand() % 10 == 0);
-	_player.setIlluminati(illuminati);
+	if(_context->nevermore)
+	{
+		_player.setType(Player::Nevermore);
+		_player.setTexture(_context->assets->loadTexture("data/triangle/Nevermore.png"));
+	}
+	else if(illuminati)
+	{
+		_player.setType(Player::Illuminati);
+		_player.setTexture(_context->assets->loadTexture("data/triangle/Illuminati.png"));
+	}
+	else
+	{
+		_player.setType(Player::Tropical);
+		_player.setTexture(_context->assets->loadTexture("data/triangle/Tropical.png"));
+	}
 	_player.setContext(_context); 
-	_player.setTexture(_context->assets->loadTexture(illuminati ? "data/triangle/Illuminati.png" : "data/triangle/Texture.png"));
 	_player.setPosition(556.f, 2200.f);
 	 
 	_foreground.create("data/background/Foreground.jpg", "data/background/Foreground_normal.jpg", "data/background/75pxjitter03.png");
@@ -136,7 +149,7 @@ void IngameState::coreThink(const sf::Event& event)
 		_status = State::Menu;
 	if(event.type == sf::Event::KeyPressed and event.key.code == sf::Keyboard::P and !_player.isDead())
 		_paused = !_paused;
-	#ifdef DEBUG
+	#ifdef TRIANGLES_DEBUG
 	if(event.type == sf::Event::JoystickButtonPressed)
 		Echo::debug("Joystick button pressed -- ", event.joystickButton.button);
 	#endif
@@ -145,7 +158,7 @@ void IngameState::coreThink(const sf::Event& event)
 void IngameState::coreInput()
 {
 	if(_paused)
-		return;
+		return; 
 
 	_player.think();
 }
@@ -170,7 +183,7 @@ void IngameState::coreUpdate(sf::Time delta)
 		_blurV.setParameter("blurSize", _blurSize / _context->window->getSize().y);
 		
 		if((_wasted.getPosition().y > _context->window->getSize().y / 2.f) 
-		|| (_wasted.getPosition().y < -_context->window->getSize().y / 2.f 
+		|| (_wasted.getPosition().y > -int(_context->window->getSize().y) / 2.f 
 		&& _marioSound.getStatus() == sf::Sound::Status::Stopped && !_player.hasWon()))
 		{
 			_wasted.move(0.f, -400.f * delta.asSeconds() * (_context->window->getSize().y / 1080.f));
@@ -181,12 +194,14 @@ void IngameState::coreUpdate(sf::Time delta)
 				_statsStars.setPosition(_wasted.getPosition().x, _wasted.getPosition().y + 100.f);
 			}
 		}
+		else if(_wasted.getPosition().y < -int(_context->window->getSize().y / 2.f))
+			_status = State::Menu;
 	}
 
 	if(_paused)
 		return;
 		
-	//if(sf::Joystick::isConnected(0))
+	if(sf::Joystick::isConnected(0))
 		_context->window->lockMouse();
 
 	const sf::Vector2f pos = _player.getPosition();

+ 2 - 2
src/MenuState.cpp

@@ -296,7 +296,7 @@ void MenuState::coreUpdate(sf::Time delta)
 	static sf::Clock clock;
 	_waterSine.setParameter("time", clock.getElapsedTime().asSeconds());
 	
-	/*if(sf::Joystick::isConnected(0))
+	if(sf::Joystick::isConnected(0))
 	{
 		sf::Vector2f v;
 		switch(_padSelection)
@@ -316,7 +316,7 @@ void MenuState::coreUpdate(sf::Time delta)
 				
 		}
 		_context->window->lockMouse(sf::Vector2i(v));
-	}*/
+	}
 	
 	_logo.update(_context->window->getMousePosition(), delta);
 	_play.update(_context->window->getMousePosition(), delta);

+ 23 - 123
src/Player.cpp

@@ -37,10 +37,11 @@ Player::Player():
 	_hit(false),
 	_dead(false),
 	_won(false),
-	_particleSystem(512, 512),
+	//_particleSystem(512, 512),
 	_ammo(4),
 	_life(sf::Color::Red, 1.f),
-	_mana(sf::Color::Blue, 0.942f)
+	_mana(sf::Color::Blue, 0.942f),
+	_type(Type::Tropical)
 {
 	/**
 	 *  Default binding
@@ -63,7 +64,6 @@ Player::Player():
 		_inputMap.map(5, Input(sf::Keyboard::Space));
 		_inputMap.map(6, Input(sf::Keyboard::LControl, Input::Type::Pressed));
 	 }
-	_inputMap.map(40, Input(sf::Keyboard::F9, Input::Type::Pressed));
 	
 	/**
 	 *  Input lambdas
@@ -111,27 +111,22 @@ Player::Player():
 		{
 			case 0: 
 				light()->_emissionSprite.setTexture(_context->assets->loadTexture("data/background/Light_Alt.png"));
-				light()->_emissionSprite.setOrigin(sf::Vector2f(_context->assets->loadTexture("data/background/Light_Alt.png").getSize().x / 2u, _context->assets->loadTexture("data/background/Light_Alt.png").getSize().y - (_illuminati ? 71 : 0)));
+				light()->_emissionSprite.setOrigin(sf::Vector2f(_context->assets->loadTexture("data/background/Light_Alt.png").getSize().x / 2u, _context->assets->loadTexture("data/background/Light_Alt.png").getSize().y - (_type == Illuminati ? 71 : 0)));
 				break;
 			case 1: 
 				light()->_emissionSprite.setTexture(_context->assets->loadTexture("data/background/Light.png"));
-				light()->_emissionSprite.setOrigin(sf::Vector2f(_context->assets->loadTexture("data/background/Light.png").getSize().x / 2u, _context->assets->loadTexture("data/background/Light.png").getSize().y / 2u - (_illuminati ? 30 : 0)));
+				light()->_emissionSprite.setOrigin(sf::Vector2f(_context->assets->loadTexture("data/background/Light.png").getSize().x / 2u, _context->assets->loadTexture("data/background/Light.png").getSize().y / 2u - (_type == Illuminati ? 30 : 0)));
 				break;
 			default: 
 				break;
 		}
 	});
 	
-	bind(40, [this](const sf::Event&, float)
-	{
-		_particleSystem.enable(!_particleSystem.isEnabled());
-	});
-	
 	/**
 	*  Particles
 	*/
 
-    _particleSystem.setDissolutionRate(255.f);
+   // _particleSystem.setDissolutionRate(255.f);
 
 	/**
 	 *  Technical
@@ -139,7 +134,7 @@ Player::Player():
 	
 	genCollisionBox("data/hitbox/Player.png", sf::Vector2f(71.f, 100.f));
 	
-	_particleSystem.setOrigin(256.f, 256.f);
+	//_particleSystem.setOrigin(256.f, 256.f);
 	
 	_bullets.reserve(10);
 	_bulletTimer.restart();
@@ -159,15 +154,15 @@ void Player::setContext(Context* context)
 	_mana.setTexture(_context->assets->loadTexture("data/triangle/Arc.png"));
 	_lightType = 0;
 	light()->_emissionSprite.setTexture(_context->assets->loadTexture("data/background/Light_Alt.png"));
-	light()->_emissionSprite.setOrigin(sf::Vector2f(_context->assets->loadTexture("data/background/Light_Alt.png").getSize().x / 2u, _context->assets->loadTexture("data/background/Light_Alt.png").getSize().y - (_illuminati ? 71 : 0)));
+	light()->_emissionSprite.setOrigin(sf::Vector2f(_context->assets->loadTexture("data/background/Light_Alt.png").getSize().x / 2u, _context->assets->loadTexture("data/background/Light_Alt.png").getSize().y - (_type == Illuminati ? 71 : 0)));
 }
 
-bool Player::isDead()
+const bool Player::isDead() const
 {
 	return _dead;
 }
 
-bool Player::hasWon()
+const bool Player::hasWon() const
 {
 	return _won;
 }
@@ -176,7 +171,7 @@ void Player::setTexture(sf::Texture& texture)
 {
 	_innerTexture = texture;
 	_image = texture.copyToImage();
-	_particleSystem.loadColors(_image);
+	//_particleSystem.loadColors(_image);
 	_texture = &_innerTexture;
 	vertexFit();
 	
@@ -188,9 +183,9 @@ void Player::setTexture(sf::Texture& texture)
 	setPointCount(pointCount);
 }
 
-void Player::setIlluminati(bool illuminati)
+void Player::setType(Type type)
 {
-	_illuminati = illuminati;
+	_type = type;
 }
 
 bool Player::checkCollision(Foreground& foreground, bool pixel)
@@ -285,8 +280,8 @@ void Player::keyboardControls(sf::Time delta)
 	
 	move(movement);
 
-	_particleSystem.fuel(movement.x * 20.f, getRotation());
-	_particleSystem.fuel(movement.y * 20.f, getRotation());
+	//_particleSystem.fuel(movement.x * 20.f, getRotation());
+	//_particleSystem.fuel(movement.y * 20.f, getRotation());
 
 	_movement = 0.f;
 
@@ -305,104 +300,9 @@ void Player::keyboardControls(sf::Time delta)
 	_rotation = 0.f;
 }
 
-void Player::padControls(sf::Time delta)
-{
-	float seconds = delta.asSeconds();
-	const double degree = 3.14159265358 / 180.;
-	
-	sf::Vector2f v = sf::Vector2f(
-	sf::Joystick::getAxisPosition(0, sf::Joystick::Axis::X) / 100.f, 
-	sf::Joystick::getAxisPosition(0, sf::Joystick::Axis::Y) / 100.f);
-	
-	float curr = getRotation();
-	static float supposed;
-	if(v.x != 0 or v.y != 0)
-		supposed = atan2(v.x, -v.y) / degree;
-
-	if(supposed < 0.f) 
-		supposed += 360.f;
-
-	float c = supposed - curr;
-	if(curr > 180.f && supposed < 180.f)
-	{
-		float a = (supposed - curr);
-		float b = (supposed - curr + 360.f);
-		if(std::fabs(a) < std::fabs(b))
-			c = a;
-		else
-			c = b;
-	}
-	if(curr < 180.f && supposed > 180.f)
-	{
-		float a = (supposed - curr);
-		float b = (supposed - curr - 360.f);
-		if(std::fabs(a) < std::fabs(b))
-			c = a;
-		else
-			c = b;
-	}
-	
-	if(v.x != 0 or v.y != 0) 
-	{
-		if(c > 0.f)
-			_rotationMomentum += _rotationAcceleration * seconds;
-		else if(c < 0.f)
-			_rotationMomentum -= _rotationAcceleration * seconds; 
-	}
-		
-	if(_rotationMomentum > _rotationSuppresion * seconds)
-		_rotationMomentum -= _rotationSuppresion * seconds;
-	else if(_rotationMomentum < -_rotationSuppresion * seconds)
-		_rotationMomentum += _rotationSuppresion * seconds;
-	else
-		_rotationMomentum = 0.f;
-		
-	float rotation = 90.f * _rotationSpeed * _rotationMomentum * seconds;
-	
-	rotate(rotation);
-	
-	if((v.x != 0 || v.y != 0) && c < 1.f)
-		_movement = std::fabs(v.x + v.y);
-	
-	if(_hit)
-	{
-		if(_movement > 0 || _movementMomentum > 0)
-			_movementMomentum -= seconds * 15.f;
-		if(_movement < 0 || _movementMomentum < 0)
-			_movementMomentum += seconds * 15.f;
-		_movement *= 0.6f;
-	}
-
-	_movementMomentum += _movementAcceleration * seconds * _movement;
-
-	if(_movement == 0.f)
-	{
-		if(_movementMomentum > _movementSuppresion * seconds)
-			_movementMomentum -= _movementSuppresion * seconds;
-		else if(_movementMomentum < -_movementSuppresion * seconds)
-			_movementMomentum += _movementSuppresion * seconds;
-		else
-			_movementMomentum = 0.f;
-	}
-
-	sf::Vector2f movement;
-	movement.x = std::sin(getRotation() * degree) * 60.f * _movementSpeed * _movementMomentum * seconds;
-	movement.y = -std::cos(getRotation() * degree) * 60.f * _movementSpeed * _movementMomentum * seconds;
-	
-	move(movement);
-	
-	_particleSystem.fuel(movement.x * 20.f, getRotation());
-	_particleSystem.fuel(movement.y * 20.f, getRotation());
-
-	_movement = 0.f;
-}
-
 void Player::update(sf::Time delta)
 {	
-	//if(sf::Joystick::isConnected(0))
-		//padControls(delta);
-	//else
-		keyboardControls(delta);
+	keyboardControls(delta);
 		
 	sf::Vector2f position = getPosition();
 	
@@ -417,7 +317,7 @@ void Player::update(sf::Time delta)
 	if(!all)
 		_bullets.clear();
 
-	_particleSystem.setPosition(position);
+	//_particleSystem.setPosition(position);
 	
 	sf::Listener::setPosition(position.x, position.y, 0);
 	
@@ -432,9 +332,9 @@ void Player::update(sf::Time delta)
 	
 	if(getScale().x == 1.f)
 	{
-		_particleSystem.clear();
-		_particleSystem.update(delta);
-		_particleSystem.render();
+		//_particleSystem.clear();
+		//_particleSystem.update(delta);
+		//_particleSystem.render();
 	}
 	if(getScale().x < 0.1f)
 	{
@@ -446,15 +346,15 @@ void Player::update(sf::Time delta)
 	light()->_emissionSprite.setRotation(getRotation());
 }
 
-float Player::getHullLeft()
+const float Player::getHullLeft() const
 {
 	return ((_pointCount * _durability - _cbanned.size()) / (_pointCount *  _durability)) * 100.f;
 }
 
 void Player::draw(sf::RenderTarget& target, sf::RenderStates states) const
 {
-	if(_particleSystem.isEnabled())
-		target.draw(_particleSystem);
+	//if(_particleSystem.isEnabled())
+		//target.draw(_particleSystem);
 	
 	for(unsigned i = 0; i < _bullets.size(); ++i)
 		target.draw(_bullets[i]);

+ 9 - 7
src/Player.hpp

@@ -40,6 +40,9 @@
 class Player: public Triangle, public InputTarget<int>, public Collidable, public Lantern
 {
 	public:
+		enum Type {
+			Tropical = 0, Illuminati, Nevermore
+		};
 		Player();
 		void update(sf::Time delta);
 		void setTexture(sf::Texture& texture) override;
@@ -50,18 +53,17 @@ class Player: public Triangle, public InputTarget<int>, public Collidable, publi
 		 */
 		
 		bool checkCollision(Foreground& foreground, bool pixel = true);
-		bool isDead();
-		bool hasWon();
+		const bool isDead() const;
+		const bool hasWon() const;
 		Rect getBounds();
 		sf::Image _image;
 		sf::Texture _innerTexture;
 		void setContext(Context* context);
-		float getHullLeft();
-		void setIlluminati(bool illuminati);
+		const float getHullLeft() const;
+		void setType(Type type);
 
 	private:
 		void keyboardControls(sf::Time delta);
-		void padControls(sf::Time delta);
 		Context* _context;
 		std::vector<Bullet> _bullets;
 		sf::Clock _bulletTimer;
@@ -76,9 +78,9 @@ class Player: public Triangle, public InputTarget<int>, public Collidable, publi
 		virtual void draw(sf::RenderTarget& target, sf::RenderStates states) const final override;
 		sf::Sound _glass;
 		sf::Sound _deathSound;
-		ParticleSystem _particleSystem;
+		//ParticleSystem _particleSystem;
 		int _ammo;
-		bool _illuminati;
+		Type _type;
 		Circle _life;
 		Circle _mana;
 		int _lightType;

+ 46 - 35
src/Triangles.cpp

@@ -19,6 +19,7 @@
 #include <thread>
 #include <fstream>
 #include <iomanip>
+#include <codecvt>
 #include "Triangles.hpp"
 #include "IngameState.hpp"
 #include "MenuState.hpp"
@@ -36,6 +37,7 @@ Triangles::Triangles(int argc, char** argv):
 	_variables.running = true;
 	_variables.needsUpdate = false;
 	_variables.shaders = true;
+	_variables.nevermore = false;
 	_variables.window = &_window; 
 	_variables.assets = &_assets;
 	_variables.core = this;
@@ -72,20 +74,23 @@ void Triangles::init()
 	_loadingHint.setColor(sf::Color::White);
 	_loadingText.setColor(sf::Color::White);
 	_loadingTriangle.setColor(sf::Color::White);
-	
-	std::ifstream ifs;
-	ifs.open("data/hints.txt");
-	while(ifs.good())
-	{
-		std::string s;
-		std::getline(ifs, s);
-		if(s.size() > 1)
-			_loadingHints.push_back(sf::String(s));
-	}
-	ifs.close();
-		
-	if(_loadingHints.empty())
-		_loadingHints.push_back(sf::String(""));
+
+	_loadingHints.push_back(L"This is a hint. A placeholder.");
+	_loadingHints.push_back(L"There are two perfect things: chocolate and 45° isosceles triangle.");
+	_loadingHints.push_back(L"Si les trangles faisaient un dieu, ils lui donneraient trois cótés. — Montesquieu");
+	_loadingHints.push_back(L"Triangles do not have speed caps, but you will hit the wall eventually.");
+	_loadingHints.push_back(L"when patafour pls owocek you lazy piece of shit");
+	_loadingHints.push_back(L"Hit left control to switch light types.");
+	_loadingHints.push_back(L"S=√(p(p-a)(p-b)(p-c))");
+	_loadingHints.push_back(L"S=12141px²");
+	_loadingHints.push_back(L"Positive vibes. PMA. Positive mental attitude.");
+	_loadingHints.push_back(L"You can lose up to 4856.4px.");
+	_loadingHints.push_back(L"Wasted.");
+	_loadingHints.push_back(L"Ah, the Scalene Triangle");
+	_loadingHints.push_back(L"Δ");
+	_loadingHints.push_back(L"Δ\nΔ Δ");
+	_loadingHints.push_back(L"The stars act as consolation prizes if you go in the wrong direction.");
+	_loadingHints.push_back(L"[](){}(); [](){}(); [](){}();");
 }
 
 void Triangles::passArguments(int argc, char** argv)
@@ -97,27 +102,33 @@ void Triangles::passArguments(int argc, char** argv)
 		if(argvStr[i].size() < 2)
 			argvStr[i] = "--kaczka";
 	}
-	searchArgument(argc, argvStr, 'f', "fullscreen", [this]()
+	searchArgument(argc, argvStr, "f", "fullscreen", [this]()
 	{
 		_variables.fullscreen = true;
 	});
-	searchArgument(argc, argvStr, 'w', "window", [this]()
+	searchArgument(argc, argvStr, "w", "window", [this]()
 	{
 		_variables.fullscreen = false;
 	});
-	searchArgument(argc, argvStr, 'b', "borderlesswindow", [this]()
+	searchArgument(argc, argvStr, "b", "borderlesswindow", [this]()
 	{
 		_variables.borderless = true;
 	});
-	searchArgument(argc, argvStr, 'v', "vsync", [this]()
+	searchArgument(argc, argvStr, "v", "vsync", [this]()
 	{
 		_variables.vsync = true;
 	});
-	searchArgument(argc, argvStr, 's', "skip", [this]()
+	searchArgument(argc, argvStr, "s", "skip", [this]()
+	{
+		_initialState = State::Ingame;
+	});
+	searchArgument(argc, argvStr, "sf", "skipfullscreen", [this]()
 	{
 		_initialState = State::Ingame;
+		_variables.fullscreen = true;
+		_variables.nevermore = true;
 	});
-	searchArgument(argc, argvStr, 'r', "resolution", [this](std::string param)
+	searchArgument(argc, argvStr, "r", "resolution", [this](std::string param)
 	{
 		if(param == "640x480")
 		{
@@ -147,7 +158,7 @@ void Triangles::passArguments(int argc, char** argv)
 		
 		_window.setSize(w, h);
 	});
-	searchArgument(argc, argvStr, 'h', "help", [this]()
+	searchArgument(argc, argvStr, "h", "help", [this]()
 	{
 		std::cout << "triangles: triangles [OPTION]..." << std::endl;
 		std::cout << "A pseudogame not meant to be run by sane people." << std::endl << std::endl;
@@ -155,32 +166,36 @@ void Triangles::passArguments(int argc, char** argv)
 		std::cout << "This program comes with ABSOLUTELY NO WARRANTY;" << std::endl;
 		std::cout << "This is free software, and you are welcome to redistribute it" << std::endl;
 		std::cout << "under certain conditions; see LICENSE.md" << std::endl << std::endl;
-		std::cout << std::setw(8) << "-f" << " or " << std::setw(16) << "--fullscreen" << "    prevents from playing in windowed mode; try F11" << std::endl;
-		std::cout << std::setw(8) << "-w" << " or " << std::setw(16) << "--window" << "    prevents from playing in fullscreen mode; try F11" << std::endl;
 		std::cout << std::setw(8) << "-v" << " or " << std::setw(16) << "--vsync" << "    prevents from playing without vertical synchronization; try F10" << std::endl;
 		std::cout << std::setw(8) << "-s" << " or " << std::setw(16) << "--skip" << "    prevents from going to the main menu; try Escape" << std::endl;
+		std::cout << std::setw(8) << "-f" << " or " << std::setw(16) << "--fullscreen" << "    prevents from playing in windowed mode; try F11" << std::endl;
+		std::cout << std::setw(8) << "-sf" << " or " << std::setw(16) << "--skipfullscreen" << "    combines --fullscreen and --skip" << std::endl;
+		std::cout << std::setw(8) << "-w" << " or " << std::setw(16) << "--window" << "    prevents from playing in fullscreen mode; try F11" << std::endl;
 		std::cout << std::setw(8) << "-h" << " or " << std::setw(16) << "--help" << "    prevents from running the actual game" << std::endl;
 		std::cout << std::setw(8) << "-r WxH" << " or " << std::setw(16) << "--resolution=WxH" << "    prevents from running at 640x480" << std::endl;
 		_variables.running = false;
 	});
 }
 
-void Triangles::searchArgument(int argc, std::string argvStr[], char callShort, std::string callLong, std::function<void()> lambda)
+void Triangles::searchArgument(int argc, std::string argvStr[], std::string callShort, std::string callLong, std::function<void()> lambda)
 {
 	for(int i = 1; i < argc; ++i)
 	{
-		if((argvStr[i][0] == '-' and argvStr[i][1] == callShort) or argvStr[i] == "--" + callLong)
+		if((argvStr[i][0] == '-' && argvStr[i][1] == callShort[0]) || argvStr[i] == "--" + callLong)
 		{
-			lambda();
-			break;
+			if((callShort.size() == 1 && argvStr[i].size() == 2) || argvStr[i][2] == callShort[1])
+			{
+				lambda();
+				break;
+			}
 		}
 	}
 }
-void Triangles::searchArgument(int argc, std::string argvStr[], char callShort, std::string callLong, std::function<void(std::string param)> lambda)
+void Triangles::searchArgument(int argc, std::string argvStr[], std::string callShort, std::string callLong, std::function<void(std::string param)> lambda)
 {
 	for(int i = 1; i < argc; ++i)
 	{
-		if(argvStr[i][0] == '-' and argvStr[i][1] == callShort and i < argc - 1)
+		if(argvStr[i][0] == '-' && argvStr[i][1] == callShort[0] && i < argc - 1)
 		{
 			lambda(argvStr[i + 1]);
 			break;
@@ -263,7 +278,7 @@ int Triangles::run()
 	
 	if(_context.running)
 	{
-		Echo::out(Echo::Empty, "Triangles version -0.8.9");
+		Echo::out(Echo::Empty, "Triangles version -0.8.8");
 		Echo::out(Echo::Empty, "Copyright (C) 2016 POSITIVE MENTAL ATTITUDE");
 		Echo::out(Echo::Empty, "This program comes with ABSOLUTELY NO WARRANTY;");
 		Echo::out(Echo::Empty, "This is free software, and you are welcome to redistribute it");
@@ -313,10 +328,6 @@ void Triangles::coreThink()
 		if(_current->status())
 			_current->coreThink(event);
 		_window.think(event);
-		if(event.type == sf::Event::KeyPressed and event.key.code == sf::Keyboard::F11)
-			_context.fullscreen = !_context.fullscreen, _variables.fullscreen = _context.fullscreen, _window.recreate();
-		if(event.type == sf::Event::KeyPressed and event.key.code == sf::Keyboard::F10)
-			_context.vsync = !_context.vsync, _variables.vsync = _context.vsync, _window.recreate();
 	}
 }
 
@@ -389,7 +400,7 @@ void Triangles::coreRender()
 {
 	_window.clear();
 	_current->coreRender(_variables.shaders);
-	#ifdef DEBUG
+	#ifdef TRIANGLES_DEBUG 
 	_window.draw(_fpsRect);
 	_window.draw(_fps);
 	#endif

+ 2 - 2
src/Triangles.hpp

@@ -43,8 +43,8 @@ class Triangles
 		 * @param argv Argument vector
 		 */
 		void passArguments(int argc, char** argv);
-		void searchArgument(int argc, std::string argvStr[], char callShort, std::string callLong, std::function<void()> lambda);
-		void searchArgument(int argc, std::string argvStr[], char callShort, std::string callLong, std::function<void(std::string param)> lambda);
+		void searchArgument(int argc, std::string argvStr[], std::string callShort, std::string callLong, std::function<void()> lambda);
+		void searchArgument(int argc, std::string argvStr[], std::string callShort, std::string callLong, std::function<void(std::string param)> lambda);
 		/**
 		 * @brief Changes gamestate.
 		 * @param stateType The type of state that is about to be loaded (takes flags from the enum of State class).

+ 32 - 10
src/TrianglesWindow.cpp

@@ -17,7 +17,7 @@
 
 #include "TrianglesWindow.hpp"
 #include "InputTarget.hpp"
-
+#include "Utility.hpp"
 TrianglesWindow::TrianglesWindow(const std::string& title, sf::Vector2u size):
 	InputTarget(_inputMap),
 	_size(size),
@@ -25,15 +25,37 @@ TrianglesWindow::TrianglesWindow(const std::string& title, sf::Vector2u size):
 	_mouseLocked(false)
 {
 	_context = nullptr;
-	_inputMap.map(0, Input(sf::Keyboard::R, Input::Type::Pressed));
+	_inputMap.map(0, Input(sf::Keyboard::F9, Input::Type::Pressed));
+	_inputMap.map(1, Input(sf::Keyboard::F10, Input::Type::Pressed));
+	_inputMap.map(2, Input(sf::Keyboard::F11, Input::Type::Pressed));
 	bind(0, [this](const sf::Event&, float)
 	{
-		if(_size == sf::Vector2u(640u, 480u))
-			_size = sf::Vector2u(1366u, 768u);
-		else
-			_size = sf::Vector2u(640u, 480u);
-		close();
-		open();
+		unsigned s = sf::VideoMode::getFullscreenModes().size();
+		for(unsigned i = 0; i < s; ++i)
+		{
+			sf::VideoMode vm = sf::VideoMode::getFullscreenModes()[i];
+			if(vm.width < 640 || vm.height < 480)
+				break;
+			else if(vm.width == _size.x && vm.height == _size.y)
+			{
+				if(i + 1 < s && sf::VideoMode::getFullscreenModes()[i + 1].width >= 640 && sf::VideoMode::getFullscreenModes()[i + 1].height >= 480)
+					_size = sf::Vector2u(sf::VideoMode::getFullscreenModes()[i + 1].width, sf::VideoMode::getFullscreenModes()[i + 1].height);
+				else
+					_size = sf::Vector2u(sf::VideoMode::getFullscreenModes()[0].width, sf::VideoMode::getFullscreenModes()[0].height);
+				break;
+			}
+		}
+		recreate();
+	});
+	bind(1, [this](const sf::Event&, float) 
+	{
+		_context->fullscreen = !_context->fullscreen;
+		recreate();
+	});
+	bind(2, [this](const sf::Event&, float)
+	{
+		_context->vsync = !_context->vsync;
+		recreate();
 	});
 	
 	_textures.reserve(2000);
@@ -153,8 +175,8 @@ const sf::View& TrianglesWindow::getDefaultView()
 void TrianglesWindow::open()
 {
 	sf::ContextSettings settings;
-	settings.majorVersion = 3;
-	settings.minorVersion = 0;
+	settings.majorVersion = 1;
+	settings.minorVersion = 1;
 	//settings.antialiasingLevel = 8;
 	_window.create(sf::VideoMode(_size.x, _size.y), _title, (_context->fullscreen ? sf::Style::Fullscreen : (_context->borderless ? sf::Style::None : (sf::Style::Titlebar | sf::Style::Close))), settings);
 	_window.setKeyRepeatEnabled(false);

+ 2 - 2
src/Utility.cpp

@@ -18,10 +18,10 @@
 #include <cstdio>
 #include "Utility.hpp"
  
-#ifdef DEBUG
+#ifdef TRIANGLES_DEBUG
 int Echo::_loglevel = 4;
 #else
-int Echo::_loglevel = 1;
+int Echo::_loglevel = 1;  
 #endif
 
 bool Echo::printType(int order)