/* EDIT_WORLD.P */ section $-eden => edit_world; ;;; make mapping to ved_q "soft", by mapping to word ;;; not procedure. vedsetkey('\^[q', "ved_q"); define edit_world(); lvars oldfile = vedcurrent; define vars ved_x(); vededitor(identfn, oldfile); ;;; read back world get_world(); ;;; then exit from ved_get_and_edit exitfrom(edit_world) enddefine; define vars ved_q(); vededitor(identfn, oldfile); ;;; then exit from ved_get_and_edit exitfrom(edit_world) enddefine; ;;; Set local static mode. vars vedstatic = true; ;;; make the specified file current, after saving the oldfile edit('BUG'); ;;; Invoke a replica of VED's top level loop, to be left when ;;; ved_q or ved_x is invoked runproc(0, consproc(0,vedscreenraw<>vedprocess)); enddefine; define get_world(); lvars xW, yW, xVED, yVED, new_obj, old_obj, id; for yW from bw_world_height(world)-1 by -1 to 0 do for xW from 0 to bw_world_width(world)-1 do world_coords_to_ved_coords( xW, yW ) -> yVED -> xVED; vedjumpto( yVED, xVED ); vedcurrentchar() -> new_obj; world( xW, yW ) -> old_obj; bw_new_object( world, new_obj ) -> id; if new_obj /= `B` then bw_place_object( world, id, [%xW,yW%] ); endif; endfor; endfor; enddefine; endsection;