Previous 199869 Revisions Next

r20083 Saturday 5th January, 2013 at 17:55:42 UTC by Ryan Holtz
- d3dhlsl.c: Clamp hlsl_prescale_x/y to a minimum of 1. Fixes crashes when using
            -nomaximize switch. [MooglyGuy]
[src/osd/windows]d3dhlsl.c drawd3d.c

trunk/src/osd/windows/drawd3d.c
r20082r20083
18801880
18811881error:
18821882   d3dintf->post_fx_available = false;
1883   mame_printf_verbose("Direct3D: Critical warning: A texture failed to allocate. Expect things to get bad quickly.\n");
1883   printf("Direct3D: Critical warning: A texture failed to allocate. Expect things to get bad quickly.\n");
18841884   if (texture->d3dsurface != NULL)
18851885      (*d3dintf->surface.release)(texture->d3dsurface);
18861886   if (texture->d3dtex != NULL)
trunk/src/osd/windows/d3dhlsl.c
r20082r20083
20232023   if (hlsl_prescale_x == 0)
20242024   {
20252025      hlsl_prescale_x = 1;
2026      while (width * xscale * hlsl_prescale_x < d3d->width)
2026      while (width * xscale * hlsl_prescale_x <= d3d->width)
20272027      {
20282028         hlsl_prescale_x++;
20292029      }
r20082r20083
20332033   if (hlsl_prescale_y == 0)
20342034   {
20352035      hlsl_prescale_y = 1;
2036      while (height * yscale * hlsl_prescale_y < d3d->height)
2036      while (height * yscale * hlsl_prescale_y <= d3d->height)
20372037      {
20382038         hlsl_prescale_y++;
20392039      }
20402040      hlsl_prescale_y--;
20412041   }
20422042
2043   hlsl_prescale_x = ((hlsl_prescale_x == 0) ? 1 : hlsl_prescale_x);
2044   hlsl_prescale_y = ((hlsl_prescale_y == 0) ? 1 : hlsl_prescale_y);
2045
20432046   if (!add_render_target(d3d, texture, width, height, xscale * hlsl_prescale_x, yscale * hlsl_prescale_y))
20442047      return false;
20452048

Previous 199869 Revisions Next


© 1997-2024 The MAME Team