Allocate and initialize arrays for the maps */
| 73 | |
| 74 | /** Allocate and initialize arrays for the maps */ |
| 75 | void Micropolis::initMapArrays() |
| 76 | { |
| 77 | short i; |
| 78 | |
| 79 | if (!mapBase) { |
| 80 | mapBase = (unsigned short *)newPtr( |
| 81 | sizeof(unsigned short) * |
| 82 | WORLD_W * WORLD_H); |
| 83 | } |
| 84 | |
| 85 | for (i = 0; i < WORLD_W; i++) { |
| 86 | map[i] = (unsigned short *)(mapBase + (i * WORLD_H)); |
| 87 | } |
| 88 | |
| 89 | resHist = (short *)newPtr(HISTORY_LENGTH); |
| 90 | comHist = (short *)newPtr(HISTORY_LENGTH); |
| 91 | indHist = (short *)newPtr(HISTORY_LENGTH); |
| 92 | moneyHist = (short *)newPtr(HISTORY_LENGTH); |
| 93 | pollutionHist = (short *)newPtr(HISTORY_LENGTH); |
| 94 | crimeHist = (short *)newPtr(HISTORY_LENGTH); |
| 95 | miscHist = (short *)newPtr(MISC_HISTORY_LENGTH); |
| 96 | } |
| 97 | |
| 98 | |
| 99 | /** Free all map arrays */ |
nothing calls this directly
no outgoing calls
no test coverage detected