Micropolis
scan.cpp File Reference

Implements various scanning and analysis algorithms for Micropolis. More...

#include "micropolis.h"

Go to the source code of this file.

Functions

static void smoothStationMap (MapShort8 *map)
 
static void smoothDitherMap (const MapByte2 &srcMap, MapByte2 *destMap, bool ditherFlag)
 

Detailed Description

Implements various scanning and analysis algorithms for Micropolis.

This file contains functions for scanning and analyzing different aspects of the city in the Micropolis game, including fire and police station coverage, population density, pollution, land value, crime rates, and terrain. It also includes utility functions for smoothing maps and calculating distances.

Definition in file scan.cpp.

Function Documentation

◆ smoothDitherMap()

static void smoothDitherMap ( const MapByte2 srcMap,
MapByte2 destMap,
bool  ditherFlag 
)
static

Perform smoothing with or without dithering.

Parameters
srcMapSource map.
destMapDestination map.
ditherFlagFunction should apply dithering.

Definition at line 516 of file scan.cpp.

References Map< DATA, BLKSIZE >::get(), Map< DATA, BLKSIZE >::MAP_H, and Map< DATA, BLKSIZE >::MAP_W.

◆ smoothStationMap()

static void smoothStationMap ( MapShort8 map)
static

Smooth a station map.

Used for smoothing fire station and police station coverage maps.

Parameters
mapMap to smooth.

Definition at line 90 of file scan.cpp.

References Map< DATA, BLKSIZE >::get(), Map< DATA, BLKSIZE >::MAP_H, Map< DATA, BLKSIZE >::MAP_W, and Map< DATA, BLKSIZE >::set().

Referenced by Micropolis::crimeScan(), and Micropolis::fireAnalysis().