/* ================ D_ViewChanged ================ */ void D_ViewChanged (void) { int rowbytes; // >>> FIX: For Nintendo Wii using devkitPPC / libogc // Assume the warp has the same size as the video buffer: //if (r_dowarp) // rowbytes = WARP_WIDTH; //else rowbytes = vid.rowbytes; // <<< FIX scale_for_mip = xscale; if (yscale > xscale) scale_for_mip = yscale; d_zrowbytes = vid.width * 2; d_zwidth = vid.width; d_pix_min = r_refdef.vrect.width / 320; if (d_pix_min < 1) d_pix_min = 1; d_pix_max = (int)((float)r_refdef.vrect.width / (320.0 / 4.0) + 0.5); d_pix_shift = 8 - (int)((float)r_refdef.vrect.width / 320.0 + 0.5); if (d_pix_max < 1) d_pix_max = 1; if (pixelAspect > 1.4) d_y_aspect_shift = 1; else d_y_aspect_shift = 0; d_vrectx = r_refdef.vrect.x; d_vrecty = r_refdef.vrect.y; d_vrectright_particle = r_refdef.vrectright - d_pix_max; d_vrectbottom_particle = r_refdef.vrectbottom - (d_pix_max << d_y_aspect_shift); { int i; for (i=0 ; i<vid.height; i++) { d_scantable[i] = i*rowbytes; zspantable[i] = d_pzbuffer + i*d_zwidth; } } D_Patch (); }
/* ================ D_ViewChanged ================ */ void D_ViewChanged (void) { int rowbytes; if (r_dowarp) rowbytes = WARP_WIDTH; else rowbytes = vid.rowbytes; scale_for_mip = xscale; if (yscale > xscale) scale_for_mip = yscale; d_zrowbytes = vid.width * 2; d_zwidth = vid.width; d_pix_min = r_refdef.vrect.width / 320; if (d_pix_min < 1) d_pix_min = 1; d_pix_max = (int)((float)r_refdef.vrect.width / (320.0 / 4.0) + 0.5); d_pix_shift = 8 - (int)((float)r_refdef.vrect.width / 320.0 + 0.5); if (d_pix_max < 1) d_pix_max = 1; if (pixelAspect > 1.4) d_y_aspect_shift = 1; else d_y_aspect_shift = 0; d_vrectx = r_refdef.vrect.x; d_vrecty = r_refdef.vrect.y; d_vrectright_particle = r_refdef.vrectright - d_pix_max; d_vrectbottom_particle = r_refdef.vrectbottom - (d_pix_max << d_y_aspect_shift); { int i; for (i=0 ; i<vid.height; i++) { d_scantable[i] = i*rowbytes; zspantable[i] = d_pzbuffer + i*d_zwidth; } } D_Patch (); }
void D_ViewChanged (void) { int i; scale_for_mip = xscale; if (yscale > xscale) scale_for_mip = yscale; d_zrowbytes = vid.width * 2; d_zwidth = vid.width; d_pix_min = r_refdef.vrect.width / 320; if (d_pix_min < 1) d_pix_min = 1; d_pix_max = (int)((float)r_refdef.vrect.width / (320.0 / 4.0) + 0.5); d_pix_shift = 8 - (int)((float)r_refdef.vrect.width / 320.0 + 0.5); if (d_pix_max < 1) d_pix_max = 1; d_vrectx = r_refdef.vrect.x; d_vrecty = r_refdef.vrect.y; d_vrectright_particle = r_refdef.vrectright - d_pix_max; d_vrectbottom_particle = r_refdef.vrectbottom - d_pix_max; for (i=0 ; i<vid.height; i++) { d_scantable[i] = i*r_screenwidth; zspantable[i] = d_pzbuffer + i*d_zwidth; } /* ** clear Z-buffer and color-buffers if we're doing the gallery */ if ( r_newrefdef.rdflags & RDF_NOWORLDMODEL ) { memset( d_pzbuffer, 0xff, vid.width * vid.height * sizeof( d_pzbuffer[0] ) ); Draw_Fill( r_newrefdef.x, r_newrefdef.y, r_newrefdef.width, r_newrefdef.height,( int ) sw_clearcolor->value & 0xff ); } alias_colormap = vid.colormap; D_Patch (); }