aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornathan <nathansmith@disroot.org>2025-12-08 19:23:16 +0000
committernathan <nathansmith@disroot.org>2025-12-08 19:23:16 +0000
commitab0b34db88d715e0f0828c691defb474de589837 (patch)
tree5acb99e70cc83e3c10405150e716d11332fe1975
parenta874c2c1baa2b308072cb9ee84bba1e03e08a06d (diff)
downloadFindThings-ab0b34db88d715e0f0828c691defb474de589837.tar.gz
FindThings-ab0b34db88d715e0f0828c691defb474de589837.tar.bz2
FindThings-ab0b34db88d715e0f0828c691defb474de589837.zip
Power line noises (not really but its a joke you will not get)
-rw-r--r--src/map.c37
1 files changed, 37 insertions, 0 deletions
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)
{