--- ray/src/rt/rview.c 1990/01/30 11:37:41 1.10 +++ ray/src/rt/rview.c 1991/05/03 15:43:32 1.13 @@ -18,6 +18,8 @@ static char SCCSid[] = "$SunId$ LBL"; #include +#include + #include VIEW ourview = STDVIEW; /* viewing parameters */ @@ -45,7 +47,7 @@ char *amblist[128]; /* ambient include/exclude list int ambincl = -1; /* include == 1, exclude == 0 */ int greyscale = 0; /* map colors to brightness? */ -char *devname = "X"; /* output device name */ +char *devname = dev_default; /* output device name */ struct driver *dev = NULL; /* driver functions */ @@ -55,6 +57,11 @@ PNODE ptrunk; /* the base of our image */ RECT pframe; /* current frame boundaries */ int pdepth; /* image depth in current frame */ +static jmp_buf mainloop; /* longjmp back to main loop */ +static char *reserve_mem = NULL; /* pre-allocated reserve memory */ + +#define RESERVE_AMT 8192 /* amount of memory to reserve */ + #define CTRL(c) ('c'-'@') @@ -113,7 +120,7 @@ rview() /* do a view */ devopen(devname); /* open device */ newimage(); /* set up image */ - + setjmp(mainloop); for ( ; ; ) { /* quit in command() */ while (hresolu <= 1<kid == NULL) { /* subdivide */ if ((p->kid = newptree()) == NULL) - error(SYSTEM, "out of memory in refine"); + memerror("in refine"); /* * The following paint order can leave a black pixel * when redraw() is called in (*dev->paintr)().