202 {
203 if (!centerTile.active())
204 {
205 return;
206 }
208 int num = 0;
209 BlockStyle blockStyle2 = default(BlockStyle);
210 if (blockStyle.top)
211 {
213 if (tileSafely.active() &&
WillItBlend(centerTile.type, tileSafely.type))
214 {
216 if (blockStyle2.bottom)
217 {
218 num |= 1;
219 }
220 else
221 {
222 blockStyle2.Clear();
223 }
224 }
225 }
226 BlockStyle blockStyle3 = default(BlockStyle);
227 if (blockStyle.left)
228 {
230 if (tileSafely2.active() &&
WillItBlend(centerTile.type, tileSafely2.type))
231 {
233 if (blockStyle3.right)
234 {
235 num |= 2;
236 }
237 else
238 {
239 blockStyle3.Clear();
240 }
241 }
242 }
243 BlockStyle blockStyle4 = default(BlockStyle);
244 if (blockStyle.right)
245 {
247 if (tileSafely3.active() &&
WillItBlend(centerTile.type, tileSafely3.type))
248 {
250 if (blockStyle4.left)
251 {
252 num |= 4;
253 }
254 else
255 {
256 blockStyle4.Clear();
257 }
258 }
259 }
260 BlockStyle blockStyle5 = default(BlockStyle);
261 if (blockStyle.bottom)
262 {
264 if (tileSafely4.active() &&
WillItBlend(centerTile.type, tileSafely4.type))
265 {
267 if (blockStyle5.top)
268 {
269 num |= 8;
270 }
271 else
272 {
273 blockStyle5.Clear();
274 }
275 }
276 }
277 if (blockStyle2.left && blockStyle3.top)
278 {
280 if (tileSafely5.active() &&
WillItBlend(centerTile.type, tileSafely5.type))
281 {
283 if (blockStyle6.right && blockStyle6.bottom)
284 {
285 num |= 0x10;
286 }
287 }
288 }
289 if (blockStyle2.right && blockStyle4.top)
290 {
292 if (tileSafely6.active() &&
WillItBlend(centerTile.type, tileSafely6.type))
293 {
295 if (blockStyle7.left && blockStyle7.bottom)
296 {
297 num |= 0x20;
298 }
299 }
300 }
301 if (blockStyle5.left && blockStyle3.bottom)
302 {
304 if (tileSafely7.active() &&
WillItBlend(centerTile.type, tileSafely7.type))
305 {
307 if (blockStyle8.right && blockStyle8.top)
308 {
309 num |= 0x40;
310 }
311 }
312 }
313 if (blockStyle5.right && blockStyle4.bottom)
314 {
316 if (tileSafely8.active() &&
WillItBlend(centerTile.type, tileSafely8.type))
317 {
319 if (blockStyle9.left && blockStyle9.top)
320 {
321 num |= 0x80;
322 }
323 }
324 }
325 if (resetFrame)
326 {
327 centerTile.frameNumber((
byte)
WorldGen.genRand.Next(0, 3));
328 }
330 centerTile.frameX = point.
X;
331 centerTile.frameY = point.
Y;
332 }
static Point16[][] selfFrame8WayLookup
static bool WillItBlend(ushort myType, ushort otherType)
static BlockStyle FindBlockStyle(Tile blockTile)
static Tile GetTileSafely(Vector2 position)