Previous 199869 Revisions Next

r19971 Monday 31st December, 2012 at 17:35:24 UTC by Ryan Holtz
[HLSL] Fixed crash when using presets. [MooglyGuy]

[HLSL] Restored old HLSL prescale behavior, with 0 being auto-detect. [MooglyGuy]
[src/osd/windows]d3dhlsl.c drawd3d.c winmain.c

trunk/src/osd/windows/winmain.c
r19970r19971
338338   { WINOPTION_HLSL_INI_READ,                           "0",       OPTION_BOOLEAN,   "enable HLSL INI reading" },
339339   { WINOPTION_HLSL_INI_WRITE,                           "0",       OPTION_BOOLEAN,   "enable HLSL INI writing" },
340340   { WINOPTION_HLSL_INI_NAME,                           "%g",        OPTION_STRING,     "HLSL INI file name for this game" },
341   { WINOPTION_HLSL_PRESCALE_X,                          "2",         OPTION_INTEGER,    "HLSL pre-scale override factor for X" },
342   { WINOPTION_HLSL_PRESCALE_Y,                          "2",         OPTION_INTEGER,    "HLSL pre-scale override factor for Y" },
341   { WINOPTION_HLSL_PRESCALE_X,                          "0",         OPTION_INTEGER,    "HLSL pre-scale override factor for X (0 for auto)" },
342   { WINOPTION_HLSL_PRESCALE_Y,                          "0",         OPTION_INTEGER,    "HLSL pre-scale override factor for Y (0 for auto)" },
343343   { WINOPTION_HLSL_PRESET";(-1-3)",                           "-1",        OPTION_INTEGER,    "HLSL preset to use (0-3)" },
344344   { WINOPTION_HLSL_WRITE,                                NULL,        OPTION_STRING,     "enable HLSL AVI writing (huge disk bandwidth suggested)" },
345345   { WINOPTION_HLSL_SNAP_WIDTH,                           "2048",      OPTION_STRING,     "HLSL upscaled-snapshot width" },
trunk/src/osd/windows/drawd3d.c
r19970r19971
18021802               texture->type = d3d->dynamic_supported ? TEXTURE_TYPE_DYNAMIC : TEXTURE_TYPE_PLAIN;
18031803
18041804               if (d3d->hlsl->enabled() && !d3d->hlsl->register_texture(texture))
1805               {
18051806                  goto error;
1807               }
18061808
18071809               break;
18081810            }
r19970r19971
18441846            {
18451847               if (d3d->hlsl->enabled() && !d3d->hlsl->register_prescaled_texture(texture))
18461848               {
1849                  printf("hlsl issue 2\n");
18471850                  goto error;
18481851               }
18491852               break;
trunk/src/osd/windows/d3dhlsl.c
r19970r19971
193193   master_enable = false;
194194   prescale_size_x = 1;
195195   prescale_size_y = 1;
196   prescale_force_x = 1;
197   prescale_force_y = 1;
196   prescale_force_x = 0;
197   prescale_force_y = 0;
198198   preset = -1;
199199   shadow_texture = NULL;
200200   options = NULL;
r19970r19971
10031003      shadow_texture = texture_create(d3d, &texture, PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA) | PRIMFLAG_TEXFORMAT(TEXFORMAT_ARGB32));
10041004   }
10051005
1006   prescale_force_x = 1;
1007   prescale_force_y = 1;
1006   prescale_force_x = 0;
1007   prescale_force_y = 0;
10081008
10091009   if(!read_ini)
10101010   {
r19970r19971
10581058      options->yiq_scan_time = winoptions.screen_yiq_scan_time();
10591059      options->yiq_phase_count = winoptions.screen_yiq_phase_count();
10601060   }
1061   if (!prescale_force_x)
1062   {
1063      prescale_force_x = 1;
1064   }
1065   if (!prescale_force_y)
1066   {
1067      prescale_force_y = 1;
1068   }
1061
10691062   g_slider_list = init_slider_list();
10701063
10711064   const char *fx_dir = downcast<windows_options &>(window->machine().options()).screen_post_fx_dir();
r19970r19971
19041897   d3d_cache_target* cache = find_cache_target(target->screen_index, info->texinfo.width, info->texinfo.height);
19051898   if (cache == NULL)
19061899   {
1907      if (!add_cache_target(d3d, info, width, height, xprescale * prescale_force_x, yprescale * prescale_force_y, target->screen_index))
1900      if (!add_cache_target(d3d, info, width, height, xprescale, yprescale, target->screen_index))
19081901      {
19091902         global_free(target);
19101903         return false;
r19970r19971
19561949
19571950   d3d_info *d3d = (d3d_info *)window->drawdata;
19581951
1959   // Find the nearest prescale factor that is over our screen size
19601952   int hlsl_prescale_x = prescale_force_x;
19611953   int hlsl_prescale_y = prescale_force_y;
19621954
1955   // Find the nearest prescale factor that is over our screen size
1956   if (hlsl_prescale_x == 0)
1957   {
1958      hlsl_prescale_x = 1;
1959      while (width * xscale * hlsl_prescale_x < d3d->width)
1960      {
1961         hlsl_prescale_x++;
1962      }
1963      hlsl_prescale_x--;
1964   }
1965
1966   if (hlsl_prescale_y == 0)
1967   {
1968      hlsl_prescale_y = 1;
1969      while (height * yscale * hlsl_prescale_y < d3d->height)
1970      {
1971         hlsl_prescale_y++;
1972      }
1973      hlsl_prescale_y--;
1974   }
1975
19631976   if (!add_render_target(d3d, texture, width, height, xscale * hlsl_prescale_x, yscale * hlsl_prescale_y))
19641977      return false;
19651978

Previous 199869 Revisions Next


© 1997-2024 The MAME Team