1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-01-26 03:52:01 +02:00

Merge pull request #3769 from vcmi/fix_penrose_crash

Fix crash caused by Penrose tiling
This commit is contained in:
Ivan Savenko 2024-04-14 13:39:27 +03:00 committed by GitHub
commit 51354f7470
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 3 deletions

View File

@ -134,10 +134,10 @@ void PenroseTiling::split(Triangle& p, std::vector<Point2D>& points,
std::set<Point2D> PenroseTiling::generatePenroseTiling(size_t numZones, CRandomGenerator * rand)
{
float scale = 100.f / (numZones * 1.5f + 20);
float scale = 173.2f / (numZones * 1.5f + 20);
float polyAngle = (2 * PI_CONSTANT) / POLY;
float randomAngle = rand->nextDouble(0, 2 * PI_CONSTANT);
float randomAngle = rand->nextDouble(0.25 * PI_CONSTANT, 0.75 * PI_CONSTANT);
std::vector<Point2D> points = { Point2D(0.0f, 0.0f), Point2D(0.0f, 1.0f).rotated(randomAngle) };
std::array<std::vector<uint32_t>, 5> indices;

View File

@ -59,7 +59,7 @@ public:
const uint32_t POLY = 10; // Number of symmetries?
const float BASE_SIZE = 1.25f;
const uint32_t DEPTH = 7; //Recursion depth
const uint32_t DEPTH = 8; //Recursion depth
const bool P2 = false; // Tiling type