diff --git a/port/linux/include/halo_linux_source_fixups.h b/port/linux/include/halo_linux_source_fixups.h index 83c4b95f..3b7ea4b5 100644 --- a/port/linux/include/halo_linux_source_fixups.h +++ b/port/linux/include/halo_linux_source_fixups.h @@ -47,6 +47,8 @@ unsigned char custom_edition_vehicle_placement_allowed(struct scenario_object_da /* the width of the screen the game draws, 480 lines tall: the device's or the display's shape, or 640 (port/linux/src/d3d8_gl.c) */ long halo_screen_width(void); +/* the screen's pixels to the Xbox's one (port/linux/src/d3d8_gl.c) */ +float halo_screen_scale(void); /* takes up a new width between frames (F11); returns the width */ long halo_screen_commit(void); /* the shadow maps' pixels for each of their 128 texels each way, a power of diff --git a/port/linux/src/d3d8_gl.c b/port/linux/src/d3d8_gl.c index 3f1a1bc7..df1d7a1b 100644 --- a/port/linux/src/d3d8_gl.c +++ b/port/linux/src/d3d8_gl.c @@ -242,6 +242,14 @@ float halo_screen_pixel_scale(void) return screen_scale[1]; } +/* how many pixels the screen's targets draw to the Xbox's one, the larger +of the two ways (the screen effects' convolutions: rasterizer_xbox_screen_effect.c) */ +float halo_screen_scale(void) +{ + halo_screen_width(); + return screen_scale[0] > screen_scale[1] ? screen_scale[0] : screen_scale[1]; +} + /* display.shadow_resolution: the size the shadow maps are drawn at. Each object's shadow is drawn from above into a 128x128 map, blurred into diff --git a/source/rasterizer/xbox/rasterizer_xbox_screen_effect.c b/source/rasterizer/xbox/rasterizer_xbox_screen_effect.c index 15d82169..68154707 100644 --- a/source/rasterizer/xbox/rasterizer_xbox_screen_effect.c +++ b/source/rasterizer/xbox/rasterizer_xbox_screen_effect.c @@ -492,6 +492,28 @@ void _rasterizer_screen_effect( real_rectangle2d vertex_bounds; unsigned long light_enhancement_input; unsigned long desaturation_input; + struct rasterizer_cinematic_screen_effect_parameters scaled_parameters; + + /* port: the native builds draw the screen at several pixels to the + Xbox's one (halo_screen_scale): a convolution's few copies of the + screen, apart by its radius in the Xbox's pixels, blended into a blur + at 640x480, and at four times the pixels they stand apart as sharp + ghosts (the zoom's warp). The same spread in that many times the + passes, each a step of it, blends them again. */ + if (parameters->convolution_type != _rasterizer_screen_effect_convolution_type_none && !parameters->video_on) + { + long steps = (long)(halo_screen_scale() + 0.999f); + + if (steps > 6) + steps = 6; + if (steps > 1) + { + scaled_parameters = *parameters; + scaled_parameters.convolution_radius /= (real)steps; + parameters = &scaled_parameters; + pass_count *= (short)steps; + } + } if (parameters->video_on) {