9 const Color* baseMats,
float modelSize)
20 model.materials[1].maps[MATERIAL_MAP_DIFFUSE].color = palette.
outer;
22 model.materials[3].maps[MATERIAL_MAP_DIFFUSE].color = palette.
inner;
24 model.materials[2].maps[MATERIAL_MAP_DIFFUSE].color = palette.
blush;
26 DrawModelEx(model, worldPos, {0.0f, 1.0f, 0.0f}, rotation, {modelSize, modelSize, modelSize},
33 const Color* baseMats,
float modelSize)
38 model.materials[1].maps[MATERIAL_MAP_DIFFUSE].color = teamColor;
39 DrawModelEx(model, worldPos, {0.0f, 1.0f, 0.0f}, rotation, {modelSize, modelSize, modelSize},
46 const std::array<int, 7>& slotIndices,
47 const std::array<float, 7>& rotations,
const Vector3& tileCenter,
48 float tileSize, Model& foodModel,
float foodModelSize,
49 Model& crystalModel,
float crystalModelSize,
float baseSize)
51 for (
int i = 0; i < 7; i++) {
52 int count = resources[i];
53 if (count <= 0 || slotIndices[i] < 0)
continue;
58 float size = baseSize * (1.0f + std::log(count + 1) * 0.3f);
60 Vector3 drawPos = {tileCenter.x + dx * tileSize, size / 2.0f, tileCenter.z + dz * tileSize};
61 float rotation = rotations[i];
64 float s = foodModelSize * size;
65 DrawModelEx(foodModel, drawPos, {0.0f, 1.0f, 0.0f}, rotation, {s, s, s}, WHITE);
69 float s = crystalModelSize * size;
70 DrawModelEx(crystalModel, drawPos, {0.0f, 1.0f, 0.0f}, rotation, {s, s, s},
78 for (
int i = 0; i < model.materialCount && i < count; i++)
79 model.materials[i].maps[MATERIAL_MAP_DIFFUSE].color = baseMats[i];
static Color getResourceColor(int resourceIndex)
Returns the designated UI/3D color for a given resource index.
static bool colorEquals(Color a, Color b)
Utility to compare two colors for equality.
static constexpr Color KEEP
static SlimePalette getSlimePalette(Color teamColor)
Returns a slime palette with variations based on the team color.
static void drawEgg(Vector3 &worldPos, Color teamColor, Model &model, float rotation=0.0f, const Color *baseMats=nullptr, float modelSize=0.3f)
Draws an egg at the given world position.
static void drawResources(const Resources &resources, const std::array< int, 7 > &slotIndices, const std::array< float, 7 > &rotations, const Vector3 &tileCenter, float tileSize, Model &foodModel, float foodModelSize, Model &crystalModel, float crystalModelSize, float baseSize=0.15f)
Draws all resources for a tile using precomputed slot indices.
static void drawPlayer(Vector3 &worldPos, Color teamColor, float rotation, Model &model, const Color *baseMats, float modelSize=0.4f)
Draws a player at the given world position.
static void _restoreModelBaseColors(Model &model, const Color *baseMats, int count=6)
static std::pair< float, float > slotOffset(int slotIndex)
Returns the XZ offset pair {dx, dz} for a slot index (0-7).