mirror of
https://github.com/holub/mame
synced 2025-04-22 16:31:49 +03:00
- d3dhlsl.c: Clamp hlsl_prescale_x/y to a minimum of 1. Fixes crashes when using
-nomaximize switch. [MooglyGuy]
This commit is contained in:
parent
f728c29698
commit
c34900b360
@ -2023,7 +2023,7 @@ bool hlsl_info::register_texture(d3d_texture_info *texture, int width, int heigh
|
||||
if (hlsl_prescale_x == 0)
|
||||
{
|
||||
hlsl_prescale_x = 1;
|
||||
while (width * xscale * hlsl_prescale_x < d3d->width)
|
||||
while (width * xscale * hlsl_prescale_x <= d3d->width)
|
||||
{
|
||||
hlsl_prescale_x++;
|
||||
}
|
||||
@ -2033,13 +2033,16 @@ bool hlsl_info::register_texture(d3d_texture_info *texture, int width, int heigh
|
||||
if (hlsl_prescale_y == 0)
|
||||
{
|
||||
hlsl_prescale_y = 1;
|
||||
while (height * yscale * hlsl_prescale_y < d3d->height)
|
||||
while (height * yscale * hlsl_prescale_y <= d3d->height)
|
||||
{
|
||||
hlsl_prescale_y++;
|
||||
}
|
||||
hlsl_prescale_y--;
|
||||
}
|
||||
|
||||
hlsl_prescale_x = ((hlsl_prescale_x == 0) ? 1 : hlsl_prescale_x);
|
||||
hlsl_prescale_y = ((hlsl_prescale_y == 0) ? 1 : hlsl_prescale_y);
|
||||
|
||||
if (!add_render_target(d3d, texture, width, height, xscale * hlsl_prescale_x, yscale * hlsl_prescale_y))
|
||||
return false;
|
||||
|
||||
|
@ -1880,7 +1880,7 @@ d3d_texture_info *texture_create(d3d_info *d3d, const render_texinfo *texsource,
|
||||
|
||||
error:
|
||||
d3dintf->post_fx_available = false;
|
||||
mame_printf_verbose("Direct3D: Critical warning: A texture failed to allocate. Expect things to get bad quickly.\n");
|
||||
printf("Direct3D: Critical warning: A texture failed to allocate. Expect things to get bad quickly.\n");
|
||||
if (texture->d3dsurface != NULL)
|
||||
(*d3dintf->surface.release)(texture->d3dsurface);
|
||||
if (texture->d3dtex != NULL)
|
||||
|
Loading…
Reference in New Issue
Block a user