         # If the tile is part of the texture, mark it as changed
         if u in [0...@BUCKETS_PER_ROW] and v in [0...@BUCKETS_PER_ROW]
           tile = [u, v]
-          @dataTexture.tiles[tileIndexByTileMacro(tile)] = false
+          @dataTexture.tiles[tileIndexByTileMacro(@, tile)] = false
           @dataTexture.ready &= not (u in [@dataTexture.area[0]..@dataTexture.area[2]] and v in [@dataTexture.area[1]..@dataTexture.area[3]])
 
     @cube.on "volumeLabled", =>

          oldTile = [oldOffset[0] + du, oldOffset[1] + dv]
          newTile = [newOffset[0] + du, newOffset[1] + dv]

          oldTileIndex = tileIndexByTileMacro(oldTile)
          newTileIndex = tileIndexByTileMacro(newTile)

          #if oldTiles[oldTileIndex]
          #  @copyTile(newTile, oldTile, texture.buffer, oldBuffer)


# Macros
# should work as normal functions, as well
tileIndexByTileMacro = (_this, tile) ->

  tile[0] * (1 << @TEXTURE_SIZE_P - _this.cube.BUCKET_SIZE_P) + tile[1]


subTileMacro = (tile, index) ->
