diff options
Diffstat (limited to 'lang/ucblogo/patches/patch-graphics.c')
-rw-r--r-- | lang/ucblogo/patches/patch-graphics.c | 199 |
1 files changed, 158 insertions, 41 deletions
diff --git a/lang/ucblogo/patches/patch-graphics.c b/lang/ucblogo/patches/patch-graphics.c index 857c9dca673..98f4dc38598 100644 --- a/lang/ucblogo/patches/patch-graphics.c +++ b/lang/ucblogo/patches/patch-graphics.c @@ -1,71 +1,170 @@ -$NetBSD: patch-graphics.c,v 1.1 2012/11/01 19:55:37 joerg Exp $ +$NetBSD: patch-graphics.c,v 1.2 2015/10/11 07:02:39 ryoon Exp $ ---- graphics.c.orig 2012-10-30 22:02:54.000000000 +0000 +--- graphics.c.orig 2008-09-03 17:58:13.000000000 +0000 +++ graphics.c -@@ -535,7 +535,7 @@ NODE *lback(NODE *arg) { - } +@@ -231,7 +231,7 @@ void draw_turtle_helper(void) { + FLONUM delta_x, delta_y; + #endif + +- prepare_to_draw; ++ prepare_to_draw2(UNBOUND); + prepare_to_draw_turtle; + save_pen(&saved_pen); + plain_xor_pen(); +@@ -276,7 +276,7 @@ void save_string(char *, int); + void save_arc(FLONUM, FLONUM, FLONUM, FLONUM, FLONUM, FLONUM, FLONUM, FLONUM); + + void right(FLONUM a) { +- prepare_to_draw; ++ prepare_to_draw2(UNBOUND); + draw_turtle(); + turtle_heading += a; + turtle_heading = pfmod(turtle_heading,360.0); +@@ -336,7 +336,7 @@ void forward(FLONUM d) { + // #ifndef WIN32 + internal_hideturtle(); + // #endif +- prepare_to_draw; ++ prepare_to_draw2(UNBOUND); + draw_turtle(); + forward_helper(d); + draw_turtle(); +@@ -570,7 +570,7 @@ NODE *lback(NODE *arg) { NODE *lshowturtle(NODE *args) { + if(!graphics_setup) graphics_setup++; - prepare_to_draw; + prepare_to_draw2(UNBOUND); if (!turtle_shown) { turtle_shown = TRUE; draw_turtle(); -@@ -545,7 +545,7 @@ NODE *lshowturtle(NODE *args) { - } +@@ -582,7 +582,7 @@ NODE *lshowturtle(NODE *args) { - NODE *lhideturtle(NODE *args) { + void internal_hideturtle() { + if(!graphics_setup) graphics_setup++; - prepare_to_draw; + prepare_to_draw2(UNBOUND); if (turtle_shown) { draw_turtle(); turtle_shown = FALSE; -@@ -874,7 +874,7 @@ NODE *llabel(NODE *arg) { - *print_stringptr = '\0'; - +@@ -616,7 +616,7 @@ NODE *lsetheading(NODE *arg) { + + val = numeric_arg(arg); if (NOT_THROWING) { - prepare_to_draw; + prepare_to_draw2(UNBOUND); draw_turtle(); - theLength = strlen(textbuf); - #ifdef mac -@@ -983,7 +983,7 @@ NODE *lsetpencolor(NODE *arg) { - NODE *val = pos_int_arg(arg); + if (nodetype(val) == INT) + turtle_heading = (FLONUM)getint(val); +@@ -720,7 +720,7 @@ NODE *lscrunch(NODE *args) { + } + + NODE *lhome(NODE *args) { +- prepare_to_draw; ++ prepare_to_draw2(UNBOUND); + out_of_bounds = FALSE; + setpos_bynumber((FLONUM)0.0, (FLONUM)0.0); + draw_turtle(); +@@ -734,7 +734,7 @@ void cs_helper(int centerp) { + #if defined(x_window) && !HAVE_WX + clearing_screen++; + #endif +- prepare_to_draw; ++ prepare_to_draw2(UNBOUND); + clear_screen; + #if defined(x_window) && !HAVE_WX + clearing_screen==0; +@@ -814,7 +814,7 @@ void setpos_commonpart(FLONUM target_x, + void setpos_bynumber(FLONUM target_x, FLONUM target_y) { if (NOT_THROWING) { - prepare_to_draw; + prepare_to_draw2(UNBOUND); - set_pen_color(getint(val)); - save_color(); - done_drawing; -@@ -995,7 +995,7 @@ NODE *lsetbackground(NODE *arg) { - NODE *val = pos_int_arg(arg); + draw_turtle(); + move_to(g_round(screen_x_coord), g_round(screen_y_coord)); + setpos_commonpart(target_x, target_y); +@@ -827,7 +827,7 @@ void setpos_helper(NODE *xnode, NODE *yn + + if (NOT_THROWING) { + internal_hideturtle(); +- prepare_to_draw; ++ prepare_to_draw2(UNBOUND); + draw_turtle(); + move_to(g_round(screen_x_coord), g_round(screen_y_coord)); + target_x = ((xnode == NIL) ? +@@ -884,7 +884,7 @@ NODE *lsety(NODE *args) { + } + + NODE *lwrap(NODE *args) { +- prepare_to_draw; ++ prepare_to_draw2(UNBOUND); + draw_turtle(); + current_mode = wrapmode; + while (turtle_x > turtle_right_max) { +@@ -907,7 +907,7 @@ NODE *lwrap(NODE *args) { + NODE *lfence(NODE *args) { + (void)lwrap(args); /* get turtle inside the fence */ +- prepare_to_draw; ++ prepare_to_draw2(UNBOUND); + draw_turtle(); + current_mode = fencemode; + draw_turtle(); +@@ -916,7 +916,7 @@ NODE *lfence(NODE *args) { + } + + NODE *lwindow(NODE *args) { +- prepare_to_draw; ++ prepare_to_draw2(UNBOUND); + draw_turtle(); + current_mode = windowmode; + draw_turtle(); +@@ -935,7 +935,7 @@ NODE *lturtlemode(NODE *args) { + } + + NODE *lfill(NODE *args) { +- prepare_to_draw; ++ prepare_to_draw2(UNBOUND); + draw_turtle(); + logofill(); + draw_turtle(); +@@ -964,7 +964,7 @@ NODE *llabel(NODE *arg) { + print_stringlen = old_stringlen; + if (NOT_THROWING) { - prepare_to_draw; + prepare_to_draw2(UNBOUND); - set_back_ground(getint(val)); - done_drawing; + draw_turtle(); + theLength = strlen(textbuf); + #ifdef mac +@@ -1085,7 +1085,7 @@ NODE *lsetpencolor(NODE *arg) { + NODE *val; + + if (NOT_THROWING) { +- prepare_to_draw; ++ prepare_to_draw2(UNBOUND); + if (is_list(car(arg))) { + val = make_intnode(PEN_COLOR_OFFSET); + lsetpalette(cons(val,arg)); +@@ -1107,7 +1107,7 @@ NODE *lsetbackground(NODE *arg) { } -@@ -1008,7 +1008,7 @@ NODE *lsetpalette(NODE *args) { - int slotnum = (int)getint(slot); - - if (NOT_THROWING && (slotnum > 7)) { -- prepare_to_draw; -+ prepare_to_draw2(UNBOUND); - set_palette(slotnum, - (unsigned int)getint(car(arg)), - (unsigned int)getint(cadr(arg)), -@@ -1057,7 +1057,7 @@ NODE *lsetpensize(NODE *args) { - NODE *arg = pos_int_vector_arg(args); if (NOT_THROWING) { - prepare_to_draw; + prepare_to_draw2(UNBOUND); - set_pen_width((int)getint(car(arg))); - set_pen_height((int)getint(cadr(arg))); - save_size(); -@@ -1074,7 +1074,7 @@ NODE *lsetpenpattern(NODE *args) { + if (is_list(car(arg))) { + val = make_intnode(BACKGROUND_COLOR_OFFSET); + lsetpalette(cons(val,arg)); +@@ -1188,7 +1188,7 @@ void restore_palette(FILE *fp) { + NODE *lsetpensize(NODE *args) { + NODE *arg; + +- prepare_to_draw; ++ prepare_to_draw2(UNBOUND); + if (is_list(car(args))) { + arg = pos_int_vector_arg(args); + if (NOT_THROWING) { +@@ -1216,7 +1216,7 @@ NODE *lsetpenpattern(NODE *args) { arg = err_logo(BAD_DATA, arg); if (NOT_THROWING) { @@ -74,7 +173,7 @@ $NetBSD: patch-graphics.c,v 1.1 2012/11/01 19:55:37 joerg Exp $ set_list_pen_pattern(arg); save_pattern(); done_drawing; -@@ -1090,7 +1090,7 @@ NODE *lsetscrunch(NODE *args) { +@@ -1232,7 +1232,7 @@ NODE *lsetscrunch(NODE *args) { ynode = numeric_arg(cdr(args)); if (NOT_THROWING) { @@ -83,16 +182,34 @@ $NetBSD: patch-graphics.c,v 1.1 2012/11/01 19:55:37 joerg Exp $ draw_turtle(); x_scale = (nodetype(xnode) == FLOATT) ? getfloat(xnode) : (FLONUM)getint(xnode); -@@ -1227,7 +1227,7 @@ NODE *larc(NODE *arg) { - else +@@ -1390,7 +1390,7 @@ NODE *larc(NODE *arg) { radius = getfloat(val2); + internal_hideturtle(); - prepare_to_draw; + prepare_to_draw2(UNBOUND); draw_turtle(); /* save and force turtle state */ -@@ -1582,7 +1582,7 @@ NODE *lloadpict(NODE *args) { +@@ -1472,7 +1472,7 @@ NODE *lfilled(NODE *args) { + FLONUM x1,y1,lastx,lasty; + int old_refresh = refresh_p; + +- prepare_to_draw; ++ prepare_to_draw2(UNBOUND); + if (is_list(car(args))) { + val = make_intnode(FILLED_COLOR_OFFSET); + lsetpalette(cons(val,args)); +@@ -1834,7 +1834,7 @@ void redraw_graphics(void) { + return; + } + +- prepare_to_draw; ++ prepare_to_draw2(UNBOUND); + if(!graphics_setup){ + done_drawing; + return; +@@ -2074,7 +2074,7 @@ NODE *lloadpict(NODE *args) { lopenread(args); #endif if (NOT_THROWING) { @@ -100,4 +217,4 @@ $NetBSD: patch-graphics.c,v 1.1 2012/11/01 19:55:37 joerg Exp $ + prepare_to_draw2(UNBOUND); fp = (FILE *)file_list->n_obj; restore_palette(fp); - fread(&record_index, sizeof(FIXNUM), 1, fp); + fread(&rec_idx, sizeof(FIXNUM), 1, fp); |