Add basic controller Support

Fix more memory leaks (seeing a trend here)
This commit is contained in:
Bram Verhulst
2024-04-24 21:38:14 +02:00
parent 1b90f222a4
commit f5d352239c
14 changed files with 2267 additions and 166 deletions

View File

@@ -108,48 +108,28 @@ private:
int m_maxRandom;
};
namespace Tiles
class Tiles
{
static GroundTileType* AIR = new GroundTileType("", GroundTileTypes::Air);
static GroundTileType* DIRT = new RandomGroundTile("tiles/dirt/dirt[0].png", GroundTileTypes::Dirt, 5);
namespace Hazards
{
static GroundTileType* STONE = new RandomGroundTile("tiles/ores/Ore_Stone_[0].png", GroundTileTypes::Stone, 3);
static GroundTileType* LAVA = new RandomGroundTile("tiles/ores/Ore_Lava_[0].png", GroundTileTypes::Lava, 3);
}
namespace Ores
{
static GroundTileType* IRON = new GroundTileType("tiles/ores/Ore_Ironium.png", GroundTileTypes::Iron);
static GroundTileType* BRONZE = new GroundTileType("tiles/ores/Ore_Bronzium.png", GroundTileTypes::Bronze);
static GroundTileType* GOLD = new GroundTileType("tiles/ores/Ore_Goldium.png", GroundTileTypes::Gold);
}
namespace Special
{
static GroundTileType* HARD_LEFT = new GroundTileType("tiles/dirt/special/hardLeft.png", GroundTileTypes::Hard);
static GroundTileType* HARD_RIGHT = new GroundTileType("tiles/dirt/special/hardRight.png", GroundTileTypes::Hard);
static GroundTileType* HARD_MIDDLE = new GroundTileType("tiles/dirt/special/hardMiddle.png", GroundTileTypes::Hard);
static GroundTileType* GRASS = new RandomGroundTile("tiles/dirt/special/grass[0].png", GroundTileTypes::Grass, 2);
}
}
static std::map<GroundTileType *, float> GroundTileWeights {
{ Tiles::AIR, 0.2f },
{ Tiles::DIRT, 0.5f },
{ Tiles::Special::GRASS, 0.0f },
{ Tiles::Hazards::STONE, 0.025f },
{ Tiles::Hazards::LAVA, 0.01f },
{ Tiles::Special::HARD_LEFT, 0.0f },
{ Tiles::Special::HARD_MIDDLE, 0.0f },
{ Tiles::Special::HARD_RIGHT, 0.0f },
{ Tiles::Ores::BRONZE, 0.05f },
{ Tiles::Ores::GOLD, 0.02f },
{ Tiles::Ores::IRON, 0.1f },
public:
};
// static std::map<GroundTileType *, float> GroundTileWeights {
// { Tiles::AIR, 0.2f },
// { Tiles::DIRT, 0.5f },
// { Tiles::Special::GRASS, 0.0f },
// { Tiles::Hazards::STONE, 0.025f },
// { Tiles::Hazards::LAVA, 0.01f },
// { Tiles::Special::HARD_LEFT, 0.0f },
// { Tiles::Special::HARD_MIDDLE, 0.0f },
// { Tiles::Special::HARD_RIGHT, 0.0f },
// { Tiles::Ores::BRONZE, 0.05f },
// { Tiles::Ores::GOLD, 0.02f },
// { Tiles::Ores::IRON, 0.1f },
// };
static std::map<GroundTileType*, float> GroundTileWeights;
void InitializeGroundTiles();
class WorldTile