remote_view_wait = 0
remote_view_hab = ""
remote_sf_w = mapa_room_cols*arcade_config.tiles_width
remote_sf_h = mapa_room_rows*arcade_config.tiles_height

function remote_view_init ()
    sf_remote=surf.new(remote_sf_w, remote_sf_h)
end

function remote_view(hab)
    remote_view_hab = hab
    remote_view_wait = 200
end

function remote_view_draw()
    if remote_view_wait>0 then
        local x,y = coords.room_to_coord ( remote_view_hab )
        
        local curr_source = surf.source()
        local curr_target = surf.target()
    
        surf.target(sf_remote)
        surf.cls(16)
        render_map(sf_mapa, tiles, x, y, sf_remote )
    
        surf.source(curr_source)
        surf.target(curr_target)
        
        local curr_source = surf.source()
        surf.source(sf_remote)
        draw.surf(0,0,remote_sf_w,remote_sf_h,11,11,(remote_sf_w/2)-2,(remote_sf_h/2)-2)
        draw.rect(10,10,(remote_sf_w/2),(remote_sf_h/2),2)
        surf.source(curr_source)
        remote_view_wait = remote_view_wait-1
    end
end