351 long window_x_size, window_y_size, window_x_origin, window_y_origin;
352 int x_min, x_max, y_min, y_max, x_start, y_start, x_end, y_end, x_len;
353 long x_origin, y_origin, new_x_center, new_y_center;
354 int x_center, y_center, saved_x_center, saved_y_center;
357 register unsigned char *y_ptr;
360 x_center = saved_x_center =
x_size / 2;
361 y_center = saved_y_center =
y_size / 2;
366 event = qread( &data );
368 printf(
"event %d, data %d\n", event, data );
391 getorigin( &x_origin, &y_origin );
394 RGBcolor( 128, 128, 128 );
403 RGBcolor( 128, 128, 128 );
410 getsize( &window_x_size, &window_y_size );
411 x_min = x_center - window_x_size/2;
412 x_max = x_min + (window_x_size-1);
413 y_min = y_center - window_y_size/2;
414 y_max = y_min + (window_y_size-1);
417 ortho2( x_min - .5, x_max + .5, y_min - .5, y_max + .5 );
420 x_start =
MAX( x_min, 0 );
421 y_start =
MAX( y_min, 0 );
424 x_len = x_end - x_start + 1;
431 y <= y_end && (y%16 != 0 || qtest() != REDRAW);
432 y++, y_ptr +=
x_size * 3 )
434 cmov2i( x_start, y );
451 if ( getbutton(RIGHTSHIFTKEY) || getbutton(LEFTSHIFTKEY) )
453 x_center = saved_x_center;
454 y_center = saved_y_center;
457 else if ( getbutton(CTRLKEY) )
459 saved_x_center = x_center;
460 saved_y_center = y_center;
478 getorigin( &x_origin, &y_origin );
479 new_x_center = getvaluator( MOUSEX ) - x_origin + x_min;
480 new_y_center = getvaluator( MOUSEY ) - y_origin + y_min;
481 if ( new_x_center >= x_start &&
482 new_x_center <= x_end &&
483 new_y_center >= y_start &&
484 new_y_center <= y_end )
486 x_center = new_x_center;
487 y_center = new_y_center;
unsigned long * rect_image
unsigned char * rgb_image