summaryrefslogtreecommitdiffstatshomepage
path: root/src/osd
diff options
context:
space:
mode:
author Ryan Holtz <rholtz@batcountryentertainment.com>2013-01-05 17:55:42 +0000
committer Ryan Holtz <rholtz@batcountryentertainment.com>2013-01-05 17:55:42 +0000
commitc34900b360681c2f9702b2ecb5c2b65829a8da30 (patch)
tree6e4c5104edddc3b226bfcf694a01863deca28d11 /src/osd
parentf728c29698a817adc756a3deda0dc4147c2a94e6 (diff)
- d3dhlsl.c: Clamp hlsl_prescale_x/y to a minimum of 1. Fixes crashes when using
-nomaximize switch. [MooglyGuy]
Diffstat (limited to 'src/osd')
-rw-r--r--src/osd/windows/d3dhlsl.c7
-rw-r--r--src/osd/windows/drawd3d.c2
2 files changed, 6 insertions, 3 deletions
diff --git a/src/osd/windows/d3dhlsl.c b/src/osd/windows/d3dhlsl.c
index 2ed0787bfda..d6a182caf99 100644
--- a/src/osd/windows/d3dhlsl.c
+++ b/src/osd/windows/d3dhlsl.c
@@ -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;
diff --git a/src/osd/windows/drawd3d.c b/src/osd/windows/drawd3d.c
index 024f437a3ad..f519d6008ea 100644
--- a/src/osd/windows/drawd3d.c
+++ b/src/osd/windows/drawd3d.c
@@ -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)