111 for (x = 0; x < 120; x++) {
112 val = (int)(hist[x] * scale);
113 s[119 - x] = (
unsigned char)
clamp(val, 0, 255);
135 callback->updateHistory(
this, callbackVal);
159 for (x = 118; x >= 0; x--) {
186 for (x = 238; x >= 120; x--) {
219 short *minValResult,
short *maxValResult)
228 short *history = NULL;
229 switch (historyType) {
254 switch (historyScale) {
266 short minVal = 32000;
267 short maxVal = -32000;
270 short val = history[i + offset];
272 minVal =
min(val, minVal);
273 maxVal =
max(val, maxVal);
276 *minValResult = minVal;
277 *maxValResult = maxVal;
297 short *history = NULL;
298 switch (historyType) {
323 switch (historyScale) {
335 short result = history[historyIndex + offset];
349 int historyIndex,
short historyValue)
357 short *history = NULL;
358 switch (historyType) {
383 switch (historyScale) {
395 history[historyIndex + offset] = historyValue;
void setHistory(int historyType, int historyScale, int historyIndex, short historyValue)
short getHistory(int historyType, int historyScale, int historyIndex)
void drawMonth(short *hist, unsigned char *s, float scale)
void getHistoryRange(int historyType, int historyScale, short *minValResult, short *maxValResult)
Header file for Micropolis game engine.
@ HISTORY_TYPE_CRIME
Crime history type.
@ HISTORY_TYPE_MONEY
Money history type.
@ HISTORY_TYPE_POLLUTION
Pollution history type.
@ HISTORY_TYPE_IND
Industry history type.
@ HISTORY_TYPE_COUNT
Number of history types.
@ HISTORY_TYPE_RES
Residiential history type.
@ HISTORY_TYPE_COM
Commercial history type.
static const int HISTORY_COUNT
@ HISTORY_SCALE_SHORT
Short scale data (10 years)
@ HISTORY_SCALE_COUNT
Number of history scales available.
@ HISTORY_SCALE_LONG
Long scale data (120 years)
static T min(const T a, const T b)
static T clamp(const T val, const T lower, const T upper)
static T max(const T a, const T b)