// ------------------------------------------------------------------------------------- // Initialize interface variables to assembler. // These things used to be constants. This routine is now (10/6/93) getting called for // every texture map. It should get called whenever the window changes, or, preferably, // not at all. I'm pretty sure these variables are only being used for range checking. void init_interface_vars_to_assembler(void) { grs_bitmap *bp; static int callclose = 1; bp = &grd_curcanv->cv_bitmap; Assert(bp!=NULL); Assert(bp->bm_data!=NULL); if (y_pointers != NULL) { d_free(y_pointers); y_pointers = NULL; } MALLOC(y_pointers, int, bp->bm_h); // If bytes_per_row has changed, create new table of pointers. if (bytes_per_row != (int) bp->bm_rowsize) { int y_val, i; bytes_per_row = (int) bp->bm_rowsize; y_val = 0; for (i=0; i<bp->bm_h; i++) { y_pointers[i] = y_val; y_val += bytes_per_row; } } write_buffer = (unsigned char *) bp->bm_data; window_left = 0; window_right = (int) bp->bm_w-1; window_top = 0; window_bottom = (int) bp->bm_h-1; Window_clip_left = window_left; Window_clip_right = window_right; Window_clip_top = window_top; Window_clip_bot = window_bottom; window_width = bp->bm_w; window_height = bp->bm_h; if (!Fix_recip_table_computed) init_fix_recip_table(); if (callclose) { callclose=0; atexit(free_ypointers); } }
// ------------------------------------------------------------------------------------- // Initialize interface variables to assembler. // These things used to be constants. This routine is now (10/6/93) getting called for // every texture map. It should get called whenever the window changes, or, preferably, // not at all. I'm pretty sure these variables are only being used for range checking. void init_interface_vars_to_assembler(void) { grs_bitmap *bp; bp = &grd_curcanv->cv_bitmap; Assert(bp!=NULL); Assert(bp->bm_data!=NULL); Assert(bp->bm_h <= MAX_Y_POINTERS); // If bytes_per_row has changed, create new table of pointers. if (bytes_per_row != (int) bp->bm_rowsize) { int y_val, i; bytes_per_row = (int) bp->bm_rowsize; y_val = 0; for (i=0; i<MAX_Y_POINTERS; i++) { y_pointers[i] = y_val; y_val += bytes_per_row; } } write_buffer = (unsigned char *) bp->bm_data; window_left = 0; window_right = (int) bp->bm_w-1; window_top = 0; window_bottom = (int) bp->bm_h-1; Window_clip_left = window_left; Window_clip_right = window_right; Window_clip_top = window_top; Window_clip_bot = window_bottom; window_width = bp->bm_w; window_height = bp->bm_h; if (!Fix_recip_table_computed) init_fix_recip_table(); }