diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/map.c | 37 |
1 files changed, 37 insertions, 0 deletions
@@ -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) { |
