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

Method getValue

MicropolisCore/src/TileEngine/src/tileengine.cpp:114–244  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

112
113
114unsigned long TileEngine::getValue(
115 int col,
116 int row,
117 PyObject *tileFunction,
118 const int *tileMapData,
119 unsigned int tileMapCount)
120{
121 if ((bufData == NULL) ||
122 (col < 0) ||
123 (col >= width) ||
124 (row < 0) ||
125 (row >= height)) {
126 return 0;
127 }
128
129 int tile = 0;
130
131 switch (tileFormat) {
132
133 case TILE_FORMAT_BYTE_UNSIGNED:
134 tile =
135 (int)(
136 *(unsigned char *)(
137 (unsigned char *)bufData +
138 (col * colBytes) +
139 (row * rowBytes)));
140 break;
141
142 case TILE_FORMAT_BYTE_SIGNED:
143 tile =
144 (int)(
145 *(char *)(
146 (char *)bufData +
147 (col * colBytes) +
148 (row * rowBytes)));
149 break;
150
151 case TILE_FORMAT_SHORT_UNSIGNED:
152 tile =
153 (int)(
154 *(unsigned short *)(
155 (unsigned char *)bufData +
156 (col * colBytes) +
157 (row * rowBytes)));
158 break;
159
160 case TILE_FORMAT_SHORT_SIGNED:
161 tile =
162 (int)(
163 *(short *)(
164 (unsigned char *)bufData +
165 (col * colBytes) +
166 (row * rowBytes)));
167 break;
168
169 case TILE_FORMAT_LONG_UNSIGNED:
170 tile =
171 (int)(

Callers 2

applyChangeMethod · 0.80
continueDragMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected