MCPcopy Create free account
hub / github.com/OpenFodder/openfodder / Tile_FindType

Method Tile_FindType

Source/Fodder.cpp:1236–1276  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1234}
1235
1236int16 cFodder::Tile_FindType(eTerrainFeature pType) {
1237
1238 for (int16 TileID = 0; TileID < sizeof(mTile_Hit) / sizeof(int16); ++TileID) {
1239
1240 int16 TerrainType = mTile_Hit[TileID];
1241
1242 // Single Type Tile
1243 if (TerrainType >= 0) {
1244
1245 // Match?
1246 if ((TerrainType & 0x0F) == pType) {
1247
1248 return TileID;
1249 }
1250 }
1251 else {
1252
1253 if (TerrainType < 0) {
1254 //loc_2A8D9
1255 // X
1256 /*pData10 >>= 1;
1257 pData10 &= 0x07;
1258
1259 int16 TilePixel = 7;
1260 TilePixel -= pData10;
1261
1262 // Y
1263 pData14 >>= 1;
1264 pData14 &= 0x07;
1265
1266 int8 RowTerrainType = mTile_BHit[TileID][pData14];
1267
1268 // If the bit for this X position is set, we use the UpperBits for the terrain type
1269 if (RowTerrainType & (1 << TilePixel))
1270 TerrainType >>= 4;*/
1271 }
1272 }
1273 }
1274
1275 return -1;
1276}
1277
1278std::vector<int16> cFodder::Tile_FindType(const eTerrainFeature pType, const eTerrainFeature pType2) {
1279 std::vector<int16> Results;

Callers

nothing calls this directly

Calls 1

push_backMethod · 0.45

Tested by

no test coverage detected