MCPcopy Create free account
hub / github.com/SimHacker/micropolis / drawMonth

Method drawMonth

MicropolisCore/src/MicropolisEngine/src/graph.cpp:96–104  ·  view source on GitHub ↗

* Copy history data to new array, scaling as needed. * @param hist Source history data. * @param s Destination byte array. * @param scale Scale factor. * @todo Figure out why we copy data. */

Source from the content-addressed store, hash-verified

94 * @todo Figure out why we copy data.
95 */
96void Micropolis::drawMonth(short *hist, unsigned char *s, float scale)
97{
98 int val, x;
99
100 for (x = 0; x < 120; x++) {
101 val = (int)(hist[x] * scale);
102 s[119 - x] = (unsigned char)clamp(val, 0, 255);
103 }
104}
105
106
107/**

Callers

nothing calls this directly

Calls 1

clampFunction · 0.85

Tested by

no test coverage detected