 
 
   next_piece: () ->
-    @puzzle.mask.reset_mask(@puzzle.grid)
+    @puzzle.mask.reset_mask()
     @puzzle.indicator.decrement()
     @unset_pieces.splice(@unset_pieces.indexOf(@sym),1)
     pc = Math.floor(@pieces_in_puzzle*Math.random())
     @sym = @unset_pieces[pc]
-    # pc = Math.floor(@pieces_in_puzzle*Math.random())
-    # @sym = @unset_pieces[pc]
-    # @unset_pieces.splice(@unset_pieces.indexOf(@sym),1)
     console.log " "
     console.log "next_piece()"
     console.log "   sym = #{@sym}"



  set_context: (mode) ->
    @mode = mode
    @context = @puzzle_view.get_drawing_context(mode)


  set_context2: (img) ->

  xhr.open('GET',url)
  xhr.onreadystatechange = ->
    if (xhr.readyState == 4 && xhr.status == 200)
      console.log ">>>>>>>>>>>>> pattern XHR ready EVENT <<<<<<<<<<<<<"
      msg_in = xhr.responseText
      response = JSON.parse(msg_in)
      @pstring = response.pstring
      app.grid = get_pattern_grid(@pstring)
      if app.load_status == "photo"
        app.load_status = "ready"
        console.log "start_new_puzzle() called from get_puzzle_pattern()"
        app.pz_status.start_new_puzzle()
      else
        app.load_status = "pattern"
