small max cube_count fix

This commit is contained in:
Niklumm 2025-11-23 13:35:52 +01:00
parent 9e5719f8f0
commit 9b3e642475
2 changed files with 2 additions and 8 deletions

View File

@ -3,12 +3,6 @@
std::vector<Vec3> createCubes(int pairs) std::vector<Vec3> createCubes(int pairs)
{ {
//zwei bis zehn paare
if (pairs >10 || pairs <= 1)
{
// 6 Karten-Positionen im 3x2 Raster
return {{-2, 0, -2}, {0, 0, -2}, {2, 0, -2},{-2, 0, 0}, {0, 0, 0}, {2, 0, 0}}; // Default field
}
std::vector<int> fieldSize = calculateFieldSize(pairs); std::vector<int> fieldSize = calculateFieldSize(pairs);
std::vector<Vec3> cubePositions; std::vector<Vec3> cubePositions;
//std::cout<<(fieldSize[0])<<std::endl; //std::cout<<(fieldSize[0])<<std::endl;
@ -48,7 +42,6 @@ std::vector<int> calculateFieldSize(int pairs)
std::vector<Color> getColors(int pairs) std::vector<Color> getColors(int pairs)
{ {
if (pairs >10) pairs = 10;
std::vector<Color> returnColors; std::vector<Color> returnColors;
Color colors[] = { Color colors[] = {
{230, 25, 75, 255}, // Red {230, 25, 75, 255}, // Red

View File

@ -24,7 +24,8 @@ int main()
camera.fovy = 45.0f; camera.fovy = 45.0f;
camera.projection = CAMERA_PERSPECTIVE; camera.projection = CAMERA_PERSPECTIVE;
int cubePairs = 3; //Cube count => 2*cubePairs int cubePairs = 7;
if (cubePairs > 10 || cubePairs <= 1) cubePairs = 3;
std::vector<Vec3> positions =createCubes(cubePairs); std::vector<Vec3> positions =createCubes(cubePairs);
// Nur 3 Farben für 3 Paare // Nur 3 Farben für 3 Paare