public void SetTransparent(int x, int y) { int subX = x % AlphaArraySize; int subY = y % AlphaArraySize; SetTransparent(x / AlphaArraySize, y / AlphaArraySize, subX, subY); fixList.Add(x, y, true); }
private void _AfterResetVO_2(FogBaseData fogBaseData, float world_x, float world_y) { if (world_x < 0 || world_y < 0 || world_x >= (fogBaseData.w - real_w) || world_y >= (fogBaseData.h - real_h)) { return; } int _tmp_world_x = (int)world_x; int _tmp_world_y = (int)world_y; int world_begin_x = _tmp_world_x / FogBaseData.AlphaArraySize; int world_begin_y = _tmp_world_y / FogBaseData.AlphaArraySize; //int world_begin_delta_x = _tmp_world_x % FogBaseData.AlphaArraySize; //int world_begin_delta_y = _tmp_world_y % FogBaseData.AlphaArraySize; float world_begin_delta_x_f = world_x - world_begin_x * FogBaseData.AlphaArraySize; float world_begin_delta_y_f = world_y - world_begin_y * FogBaseData.AlphaArraySize; ulong _base_0x01 = 0x01; ulong _tmp_world_8x8, _tmp_view_8x8, _tmp_xor; int _index; int baseX, baseY; for (int i = 0; i < array_w; i++) { for (int j = 0; j < array_h; j++) { _tmp_world_8x8 = fogBaseData.totalAlphaArray [world_begin_x + i, world_begin_y + j]; _tmp_view_8x8 = array [i, j]; _tmp_xor = _tmp_world_8x8 ^ _tmp_view_8x8; if (_tmp_xor > 0) { _index = 0; baseX = i * FogBaseData.AlphaArraySize; baseY = j * FogBaseData.AlphaArraySize; while (_index < 64) { if ((_tmp_xor & _base_0x01) > 0) { fixList.Add(baseX + _index / FogBaseData.AlphaArraySize, baseY + _index % FogBaseData.AlphaArraySize, (_tmp_world_8x8 & (_base_0x01 << _index)) > 0 ? TRANSPARENT : OPAQUE); } _tmp_xor = _tmp_xor >> 1; _index++; } } array [i, j] = _tmp_world_8x8; } } //view_delta_x = (float) world_begin_delta_x / array_real_w; //view_delta_y = (float) world_begin_delta_y / array_real_h; view_delta_x = world_begin_delta_x_f / array_real_w; view_delta_y = world_begin_delta_y_f / array_real_h; }