From ab0b34db88d715e0f0828c691defb474de589837 Mon Sep 17 00:00:00 2001 From: nathan Date: Mon, 8 Dec 2025 12:23:16 -0700 Subject: Power line noises (not really but its a joke you will not get) --- src/map.c | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/src/map.c b/src/map.c index 976cc4d..e2abaeb 100644 --- a/src/map.c +++ b/src/map.c @@ -29,11 +29,46 @@ void renderMapEntityPreview(Image* map, Entity entity, const World* world) ImageDrawText(map, "Pond", position.x, position.y, 20, BLACK); } break; + case SAMANTHAS_SPOT: + { + float samanthasSpotSize = roundf(WORLD_IMAGE_WIDTH / world->size.x * + SAMANTHAS_SPOT_SIZE); + position = Vector2SubtractValue(position, samanthasSpotSize); + samanthasSpotSize *= 2.0; + + ImageDrawRectangle(map, position.x, position.y, samanthasSpotSize, + samanthasSpotSize, PINK); + + // Samantha's spot label. + position.x -= 20.0; + ImageDrawText(map, "Samantha", position.x, position.y, 10, BLACK); + } + break; default: break; } } +void renderMapUtilityPoleLines(Image* map, const World* world) +{ + for (int index = 0; index < WORLD_UTILITY_POLE_COUNT - 1; ++index) + { + for (int innerIndex = 0; innerIndex < UTILITY_LINE_COUNT; ++innerIndex) + { + Vector3 start = world->utilityPoleLines[index][innerIndex].start; + Vector3 end = world->utilityPoleLines[index][innerIndex].end; + + start.x *= WORLD_IMAGE_WIDTH / world->size.x; + start.z *= WORLD_IMAGE_HEIGHT / world->size.z; + + end.x *= WORLD_IMAGE_WIDTH / world->size.x; + end.z *= WORLD_IMAGE_HEIGHT / world->size.z; + + ImageDrawLine(map, start.x, start.z, end.x, end.z, BLACK); + } + } +} + void initMapTexture(Map* map, const World* world, const Settings* settings) { Image image = LoadImageFromTexture(world->heightmapTexture); @@ -67,6 +102,8 @@ void initMapTexture(Map* map, const World* world, const Settings* settings) .mipmaps = 1 }; + renderMapUtilityPoleLines(&image, world); + // Draw entities. for (int index = 0; index < WORLD_ENTITY_MAX; ++index) { -- cgit v1.2.3