Refactoring per inserimento texture
This commit is contained in:
@@ -3,13 +3,14 @@
|
||||
#ifndef CAVIGLIA_H
|
||||
#define CAVIGLIA_H
|
||||
|
||||
|
||||
class Caviglia : public PieceInterface{
|
||||
private:
|
||||
const sf::Vector3f caviglia_Dim = {60, 200, 60};
|
||||
const sf::Color caviglia_Col = sf::Color(230,160,11,255);
|
||||
const sf::Texture TextureF = sf::Texture(TEXTUREPATH + "cavigliaF.png");
|
||||
const sf::Texture TextureL = sf::Texture(TEXTUREPATH + "cavigliaL.png");
|
||||
|
||||
const std::string TEXTURE_F = std::string("cavigliaF.png");
|
||||
const std::string TEXTURE_L = std::string("cavigliaL.png");
|
||||
|
||||
|
||||
public:
|
||||
|
||||
|
||||
@@ -5,12 +5,14 @@
|
||||
|
||||
|
||||
|
||||
|
||||
class Coscia : public PieceInterface{
|
||||
private:
|
||||
const sf::Vector3f coscia_Dim = {80, 200, 80};
|
||||
const sf::Color coscia_Col = sf::Color::Yellow;
|
||||
const sf::Texture TextureF = sf::Texture(TEXTUREPATH + "cosciaF.png");
|
||||
const sf::Texture TextureL = sf::Texture(TEXTUREPATH + "cosciaL.png");
|
||||
|
||||
const std::string TEXTURE_F = std::string("cosciaF.png");
|
||||
const std::string TEXTURE_L = std::string("cosciaL.png");
|
||||
|
||||
public:
|
||||
|
||||
|
||||
@@ -32,6 +32,22 @@ class PieceInterface{
|
||||
shapeYZ->setFillColor(color);
|
||||
}
|
||||
Direction direction = Direction::L;
|
||||
|
||||
sf::Texture TextureF ;
|
||||
sf::Texture TextureL ;
|
||||
|
||||
void setTextures (std::string F, std::string L){
|
||||
try{
|
||||
TextureF = sf::Texture(TEXTUREPATH + F);
|
||||
TextureL = sf::Texture(TEXTUREPATH + L);
|
||||
|
||||
shapeXZ->setTexture(&TextureL);
|
||||
shapeYZ->setTexture(&TextureF);
|
||||
}catch(...){
|
||||
throw "Errore nel caricamento texture.";
|
||||
}
|
||||
}
|
||||
|
||||
public:
|
||||
sf::Shape* shapeXZ, *shapeYZ;
|
||||
rb::Vector3 globalPos;
|
||||
|
||||
@@ -4,14 +4,13 @@
|
||||
#define TORSO_H
|
||||
|
||||
|
||||
|
||||
|
||||
class Torso : public PieceInterface{
|
||||
private:
|
||||
const sf::Vector3f torso_Dim = {100, 100, 150};
|
||||
const sf::Color torso_Col = sf::Color::Red;
|
||||
const sf::Texture TextureF = sf::Texture(TEXTUREPATH + "TorsoF.png");
|
||||
const sf::Texture TextureL = sf::Texture(TEXTUREPATH + "TorsoL.png");
|
||||
|
||||
const std::string TEXTURE_F = std::string("bacinoF.png");
|
||||
const std::string TEXTURE_L = std::string("bacinoL.png");
|
||||
|
||||
public:
|
||||
Torso(rb::Vector3 coords, _Float16 mass);
|
||||
|
||||
Reference in New Issue
Block a user