summaryrefslogtreecommitdiffstatshomepage
path: root/src/osd/modules/render/d3d/d3dhlsl.c
diff options
context:
space:
mode:
author ImJezze <jezze@gmx.net>2015-05-02 19:41:03 +0200
committer ImJezze <jezze@gmx.net>2015-05-02 19:41:03 +0200
commitcc3b682e52bf097d31db78032aad01d6a0b12e94 (patch)
tree860c97ca011b64c31a5ad277f5cea2b1d86eeaf0 /src/osd/modules/render/d3d/d3dhlsl.c
parent7df6a23ba2ae1c1df94ed8cc2398f2546f339997 (diff)
parenta649a95488e1fc85813dda747dc74c596496bd1c (diff)
Merge pull request #1 from mamedev/master
Sync to master
Diffstat (limited to 'src/osd/modules/render/d3d/d3dhlsl.c')
-rw-r--r--src/osd/modules/render/d3d/d3dhlsl.c201
1 files changed, 101 insertions, 100 deletions
diff --git a/src/osd/modules/render/d3d/d3dhlsl.c b/src/osd/modules/render/d3d/d3dhlsl.c
index b76c3365528..733ccfe0723 100644
--- a/src/osd/modules/render/d3d/d3dhlsl.c
+++ b/src/osd/modules/render/d3d/d3dhlsl.c
@@ -370,8 +370,8 @@ void shaders::render_snapshot(surface *surface)
return;
// add two text entries describing the image
- astring text1 = astring(emulator_info::get_appname()).cat(" ").cat(build_version);
- astring text2 = astring(machine->system().manufacturer).cat(" ").cat(machine->system().description);
+ std::string text1 = std::string(emulator_info::get_appname()).append(" ").append(build_version);
+ std::string text2 = std::string(machine->system().manufacturer).append(" ").append(machine->system().description);
png_info pnginfo = { 0 };
png_add_text(&pnginfo, "Software", text1.c_str());
png_add_text(&pnginfo, "System", text2.c_str());
@@ -540,7 +540,7 @@ void shaders::begin_avi_recording(const char *name)
// create a new temporary movie file
file_error filerr;
- astring fullpath;
+ std::string fullpath;
{
emu_file tempfile(machine->options().snapshot_directory(), OPEN_FLAG_WRITE | OPEN_FLAG_CREATE | OPEN_FLAG_CREATE_PATHS);
if (name != NULL)
@@ -2394,415 +2394,415 @@ static slider_state *slider_alloc(running_machine &machine, const char *title, I
// assorted global slider accessors
//============================================================
-static INT32 slider_set(float *option, float scale, const char *fmt, astring *str, INT32 newval)
+static INT32 slider_set(float *option, float scale, const char *fmt, std::string *str, INT32 newval)
{
if (option != NULL && newval != SLIDER_NOCHANGE) *option = (float)newval * scale;
- if (str != NULL) str->printf(fmt, *option);
+ if (str != NULL) strprintf(*str, fmt, *option);
return floor(*option / scale + 0.5f);
}
-static INT32 slider_shadow_mask_alpha(running_machine &machine, void *arg, astring *str, INT32 newval)
+static INT32 slider_shadow_mask_alpha(running_machine &machine, void *arg, std::string *str, INT32 newval)
{
return slider_set(&(((hlsl_options*)arg)->shadow_mask_alpha), 0.01f, "%2.2f", str, newval);
}
-static INT32 slider_shadow_mask_x_count(running_machine &machine, void *arg, astring *str, INT32 newval)
+static INT32 slider_shadow_mask_x_count(running_machine &machine, void *arg, std::string *str, INT32 newval)
{
hlsl_options *options = (hlsl_options*)arg;
if (newval != SLIDER_NOCHANGE) options->shadow_mask_count_x = newval;
- if (str != NULL) str->printf("%d", options->shadow_mask_count_x);
+ if (str != NULL) strprintf(*str, "%d", options->shadow_mask_count_x);
options->params_dirty = true;
return options->shadow_mask_count_x;
}
-static INT32 slider_shadow_mask_y_count(running_machine &machine, void *arg, astring *str, INT32 newval)
+static INT32 slider_shadow_mask_y_count(running_machine &machine, void *arg, std::string *str, INT32 newval)
{
hlsl_options *options = (hlsl_options*)arg;
if (newval != SLIDER_NOCHANGE) options->shadow_mask_count_y = newval;
- if (str != NULL) str->printf("%d", options->shadow_mask_count_y);
+ if (str != NULL) strprintf(*str, "%d", options->shadow_mask_count_y);
options->params_dirty = true;
return options->shadow_mask_count_y;
}
-static INT32 slider_shadow_mask_usize(running_machine &machine, void *arg, astring *str, INT32 newval)
+static INT32 slider_shadow_mask_usize(running_machine &machine, void *arg, std::string *str, INT32 newval)
{
((hlsl_options*)arg)->params_dirty = true;
return slider_set(&(((hlsl_options*)arg)->shadow_mask_u_size), 1.0f / 32.0f, "%2.5f", str, newval);
}
-static INT32 slider_shadow_mask_vsize(running_machine &machine, void *arg, astring *str, INT32 newval)
+static INT32 slider_shadow_mask_vsize(running_machine &machine, void *arg, std::string *str, INT32 newval)
{
((hlsl_options*)arg)->params_dirty = true;
return slider_set(&(((hlsl_options*)arg)->shadow_mask_v_size), 1.0f / 32.0f, "%2.5f", str, newval);
}
-static INT32 slider_curvature(running_machine &machine, void *arg, astring *str, INT32 newval)
+static INT32 slider_curvature(running_machine &machine, void *arg, std::string *str, INT32 newval)
{
((hlsl_options*)arg)->params_dirty = true;
return slider_set(&(((hlsl_options*)arg)->curvature), 0.01f, "%2.2f", str, newval);
}
-static INT32 slider_pincushion(running_machine &machine, void *arg, astring *str, INT32 newval)
+static INT32 slider_pincushion(running_machine &machine, void *arg, std::string *str, INT32 newval)
{
((hlsl_options*)arg)->params_dirty = true;
return slider_set(&(((hlsl_options*)arg)->pincushion), 0.01f, "%2.2f", str, newval);
}
-static INT32 slider_scanline_alpha(running_machine &machine, void *arg, astring *str, INT32 newval)
+static INT32 slider_scanline_alpha(running_machine &machine, void *arg, std::string *str, INT32 newval)
{
((hlsl_options*)arg)->params_dirty = true;
return slider_set(&(((hlsl_options*)arg)->scanline_alpha), 0.01f, "%2.2f", str, newval);
}
-static INT32 slider_scanline_scale(running_machine &machine, void *arg, astring *str, INT32 newval)
+static INT32 slider_scanline_scale(running_machine &machine, void *arg, std::string *str, INT32 newval)
{
((hlsl_options*)arg)->params_dirty = true;
return slider_set(&(((hlsl_options*)arg)->scanline_scale), 0.05f, "%2.2f", str, newval);
}
-static INT32 slider_scanline_height(running_machine &machine, void *arg, astring *str, INT32 newval)
+static INT32 slider_scanline_height(running_machine &machine, void *arg, std::string *str, INT32 newval)
{
((hlsl_options*)arg)->params_dirty = true;
return slider_set(&(((hlsl_options*)arg)->scanline_height), 0.05f, "%2.2f", str, newval);
}
-static INT32 slider_scanline_bright_scale(running_machine &machine, void *arg, astring *str, INT32 newval)
+static INT32 slider_scanline_bright_scale(running_machine &machine, void *arg, std::string *str, INT32 newval)
{
((hlsl_options*)arg)->params_dirty = true;
return slider_set(&(((hlsl_options*)arg)->scanline_bright_scale), 0.05f, "%2.2f", str, newval);
}
-static INT32 slider_scanline_bright_offset(running_machine &machine, void *arg, astring *str, INT32 newval)
+static INT32 slider_scanline_bright_offset(running_machine &machine, void *arg, std::string *str, INT32 newval)
{
((hlsl_options*)arg)->params_dirty = true;
return slider_set(&(((hlsl_options*)arg)->scanline_bright_offset), 0.05f, "%2.2f", str, newval);
}
-static INT32 slider_scanline_offset(running_machine &machine, void *arg, astring *str, INT32 newval)
+static INT32 slider_scanline_offset(running_machine &machine, void *arg, std::string *str, INT32 newval)
{
((hlsl_options*)arg)->params_dirty = true;
return slider_set(&(((hlsl_options*)arg)->scanline_offset), 0.05f, "%2.2f", str, newval);
}
-static INT32 slider_defocus_x(running_machine &machine, void *arg, astring *str, INT32 newval)
+static INT32 slider_defocus_x(running_machine &machine, void *arg, std::string *str, INT32 newval)
{
((hlsl_options*)arg)->params_dirty = true;
return slider_set(&(((hlsl_options*)arg)->defocus[0]), 0.5f, "%2.1f", str, newval);
}
-static INT32 slider_defocus_y(running_machine &machine, void *arg, astring *str, INT32 newval)
+static INT32 slider_defocus_y(running_machine &machine, void *arg, std::string *str, INT32 newval)
{
((hlsl_options*)arg)->params_dirty = true;
return slider_set(&(((hlsl_options*)arg)->defocus[1]), 0.5f, "%2.1f", str, newval);
}
-static INT32 slider_red_converge_x(running_machine &machine, void *arg, astring *str, INT32 newval)
+static INT32 slider_red_converge_x(running_machine &machine, void *arg, std::string *str, INT32 newval)
{
((hlsl_options*)arg)->params_dirty = true;
return slider_set(&(((hlsl_options*)arg)->converge_x[0]), 0.1f, "%3.1f", str, newval);
}
-static INT32 slider_red_converge_y(running_machine &machine, void *arg, astring *str, INT32 newval)
+static INT32 slider_red_converge_y(running_machine &machine, void *arg, std::string *str, INT32 newval)
{
((hlsl_options*)arg)->params_dirty = true;
return slider_set(&(((hlsl_options*)arg)->converge_y[0]), 0.1f, "%3.1f", str, newval);
}
-static INT32 slider_green_converge_x(running_machine &machine, void *arg, astring *str, INT32 newval)
+static INT32 slider_green_converge_x(running_machine &machine, void *arg, std::string *str, INT32 newval)
{
((hlsl_options*)arg)->params_dirty = true;
return slider_set(&(((hlsl_options*)arg)->converge_x[1]), 0.1f, "%3.1f", str, newval);
}
-static INT32 slider_green_converge_y(running_machine &machine, void *arg, astring *str, INT32 newval)
+static INT32 slider_green_converge_y(running_machine &machine, void *arg, std::string *str, INT32 newval)
{
((hlsl_options*)arg)->params_dirty = true;
return slider_set(&(((hlsl_options*)arg)->converge_y[1]), 0.1f, "%3.1f", str, newval);
}
-static INT32 slider_blue_converge_x(running_machine &machine, void *arg, astring *str, INT32 newval)
+static INT32 slider_blue_converge_x(running_machine &machine, void *arg, std::string *str, INT32 newval)
{
((hlsl_options*)arg)->params_dirty = true;
return slider_set(&(((hlsl_options*)arg)->converge_x[2]), 0.1f, "%3.1f", str, newval);
}
-static INT32 slider_blue_converge_y(running_machine &machine, void *arg, astring *str, INT32 newval)
+static INT32 slider_blue_converge_y(running_machine &machine, void *arg, std::string *str, INT32 newval)
{
((hlsl_options*)arg)->params_dirty = true;
return slider_set(&(((hlsl_options*)arg)->converge_y[2]), 0.1f, "%3.1f", str, newval);
}
-static INT32 slider_red_radial_converge_x(running_machine &machine, void *arg, astring *str, INT32 newval)
+static INT32 slider_red_radial_converge_x(running_machine &machine, void *arg, std::string *str, INT32 newval)
{
((hlsl_options*)arg)->params_dirty = true;
return slider_set(&(((hlsl_options*)arg)->radial_converge_x[0]), 0.1f, "%3.1f", str, newval);
}
-static INT32 slider_red_radial_converge_y(running_machine &machine, void *arg, astring *str, INT32 newval)
+static INT32 slider_red_radial_converge_y(running_machine &machine, void *arg, std::string *str, INT32 newval)
{
((hlsl_options*)arg)->params_dirty = true;
return slider_set(&(((hlsl_options*)arg)->radial_converge_y[0]), 0.1f, "%3.1f", str, newval);
}
-static INT32 slider_green_radial_converge_x(running_machine &machine, void *arg, astring *str, INT32 newval)
+static INT32 slider_green_radial_converge_x(running_machine &machine, void *arg, std::string *str, INT32 newval)
{
((hlsl_options*)arg)->params_dirty = true;
return slider_set(&(((hlsl_options*)arg)->radial_converge_x[1]), 0.1f, "%3.1f", str, newval);
}
-static INT32 slider_green_radial_converge_y(running_machine &machine, void *arg, astring *str, INT32 newval)
+static INT32 slider_green_radial_converge_y(running_machine &machine, void *arg, std::string *str, INT32 newval)
{
((hlsl_options*)arg)->params_dirty = true;
return slider_set(&(((hlsl_options*)arg)->radial_converge_y[1]), 0.1f, "%3.1f", str, newval);
}
-static INT32 slider_blue_radial_converge_x(running_machine &machine, void *arg, astring *str, INT32 newval)
+static INT32 slider_blue_radial_converge_x(running_machine &machine, void *arg, std::string *str, INT32 newval)
{
((hlsl_options*)arg)->params_dirty = true;
return slider_set(&(((hlsl_options*)arg)->radial_converge_x[2]), 0.1f, "%3.1f", str, newval);
}
-static INT32 slider_blue_radial_converge_y(running_machine &machine, void *arg, astring *str, INT32 newval)
+static INT32 slider_blue_radial_converge_y(running_machine &machine, void *arg, std::string *str, INT32 newval)
{
((hlsl_options*)arg)->params_dirty = true;
return slider_set(&(((hlsl_options*)arg)->radial_converge_y[2]), 0.1f, "%3.1f", str, newval);
}
-static INT32 slider_red_from_r(running_machine &machine, void *arg, astring *str, INT32 newval)
+static INT32 slider_red_from_r(running_machine &machine, void *arg, std::string *str, INT32 newval)
{
((hlsl_options*)arg)->params_dirty = true;
return slider_set(&(((hlsl_options*)arg)->red_ratio[0]), 0.005f, "%2.3f", str, newval);
}
-static INT32 slider_red_from_g(running_machine &machine, void *arg, astring *str, INT32 newval)
+static INT32 slider_red_from_g(running_machine &machine, void *arg, std::string *str, INT32 newval)
{
((hlsl_options*)arg)->params_dirty = true;
return slider_set(&(((hlsl_options*)arg)->red_ratio[1]), 0.005f, "%2.3f", str, newval);
}
-static INT32 slider_red_from_b(running_machine &machine, void *arg, astring *str, INT32 newval)
+static INT32 slider_red_from_b(running_machine &machine, void *arg, std::string *str, INT32 newval)
{
((hlsl_options*)arg)->params_dirty = true;
return slider_set(&(((hlsl_options*)arg)->red_ratio[2]), 0.005f, "%2.3f", str, newval);
}
-static INT32 slider_green_from_r(running_machine &machine, void *arg, astring *str, INT32 newval)
+static INT32 slider_green_from_r(running_machine &machine, void *arg, std::string *str, INT32 newval)
{
((hlsl_options*)arg)->params_dirty = true;
return slider_set(&(((hlsl_options*)arg)->grn_ratio[0]), 0.005f, "%2.3f", str, newval);
}
-static INT32 slider_green_from_g(running_machine &machine, void *arg, astring *str, INT32 newval)
+static INT32 slider_green_from_g(running_machine &machine, void *arg, std::string *str, INT32 newval)
{
((hlsl_options*)arg)->params_dirty = true;
return slider_set(&(((hlsl_options*)arg)->grn_ratio[1]), 0.005f, "%2.3f", str, newval);
}
-static INT32 slider_green_from_b(running_machine &machine, void *arg, astring *str, INT32 newval)
+static INT32 slider_green_from_b(running_machine &machine, void *arg, std::string *str, INT32 newval)
{
((hlsl_options*)arg)->params_dirty = true;
return slider_set(&(((hlsl_options*)arg)->grn_ratio[2]), 0.005f, "%2.3f", str, newval);
}
-static INT32 slider_blue_from_r(running_machine &machine, void *arg, astring *str, INT32 newval)
+static INT32 slider_blue_from_r(running_machine &machine, void *arg, std::string *str, INT32 newval)
{
((hlsl_options*)arg)->params_dirty = true;
return slider_set(&(((hlsl_options*)arg)->blu_ratio[0]), 0.005f, "%2.3f", str, newval);
}
-static INT32 slider_blue_from_g(running_machine &machine, void *arg, astring *str, INT32 newval)
+static INT32 slider_blue_from_g(running_machine &machine, void *arg, std::string *str, INT32 newval)
{
((hlsl_options*)arg)->params_dirty = true;
return slider_set(&(((hlsl_options*)arg)->blu_ratio[1]), 0.005f, "%2.3f", str, newval);
}
-static INT32 slider_blue_from_b(running_machine &machine, void *arg, astring *str, INT32 newval)
+static INT32 slider_blue_from_b(running_machine &machine, void *arg, std::string *str, INT32 newval)
{
((hlsl_options*)arg)->params_dirty = true;
return slider_set(&(((hlsl_options*)arg)->blu_ratio[2]), 0.005f, "%2.3f", str, newval);
}
-static INT32 slider_red_offset(running_machine &machine, void *arg, astring *str, INT32 newval)
+static INT32 slider_red_offset(running_machine &machine, void *arg, std::string *str, INT32 newval)
{
((hlsl_options*)arg)->params_dirty = true;
return slider_set(&(((hlsl_options*)arg)->offset[0]), 0.01f, "%2.2f", str, newval);
}
-static INT32 slider_green_offset(running_machine &machine, void *arg, astring *str, INT32 newval)
+static INT32 slider_green_offset(running_machine &machine, void *arg, std::string *str, INT32 newval)
{
((hlsl_options*)arg)->params_dirty = true;
return slider_set(&(((hlsl_options*)arg)->offset[1]), 0.01f, "%2.2f", str, newval);
}
-static INT32 slider_blue_offset(running_machine &machine, void *arg, astring *str, INT32 newval)
+static INT32 slider_blue_offset(running_machine &machine, void *arg, std::string *str, INT32 newval)
{
((hlsl_options*)arg)->params_dirty = true;
return slider_set(&(((hlsl_options*)arg)->offset[2]), 0.01f, "%2.2f", str, newval);
}
-static INT32 slider_red_scale(running_machine &machine, void *arg, astring *str, INT32 newval)
+static INT32 slider_red_scale(running_machine &machine, void *arg, std::string *str, INT32 newval)
{
((hlsl_options*)arg)->params_dirty = true;
return slider_set(&(((hlsl_options*)arg)->scale[0]), 0.01f, "%2.2f", str, newval);
}
-static INT32 slider_green_scale(running_machine &machine, void *arg, astring *str, INT32 newval)
+static INT32 slider_green_scale(running_machine &machine, void *arg, std::string *str, INT32 newval)
{
((hlsl_options*)arg)->params_dirty = true;
return slider_set(&(((hlsl_options*)arg)->scale[1]), 0.01f, "%2.2f", str, newval);
}
-static INT32 slider_blue_scale(running_machine &machine, void *arg, astring *str, INT32 newval)
+static INT32 slider_blue_scale(running_machine &machine, void *arg, std::string *str, INT32 newval)
{
((hlsl_options*)arg)->params_dirty = true;
return slider_set(&(((hlsl_options*)arg)->scale[2]), 0.01f, "%2.2f", str, newval);
}
-static INT32 slider_red_power(running_machine &machine, void *arg, astring *str, INT32 newval)
+static INT32 slider_red_power(running_machine &machine, void *arg, std::string *str, INT32 newval)
{
((hlsl_options*)arg)->params_dirty = true;
return slider_set(&(((hlsl_options*)arg)->power[0]), 0.05f, "%2.2f", str, newval);
}
-static INT32 slider_green_power(running_machine &machine, void *arg, astring *str, INT32 newval)
+static INT32 slider_green_power(running_machine &machine, void *arg, std::string *str, INT32 newval)
{
((hlsl_options*)arg)->params_dirty = true;
return slider_set(&(((hlsl_options*)arg)->power[1]), 0.05f, "%2.2f", str, newval);
}
-static INT32 slider_blue_power(running_machine &machine, void *arg, astring *str, INT32 newval)
+static INT32 slider_blue_power(running_machine &machine, void *arg, std::string *str, INT32 newval)
{
((hlsl_options*)arg)->params_dirty = true;
return slider_set(&(((hlsl_options*)arg)->power[2]), 0.05f, "%2.2f", str, newval);
}
-static INT32 slider_red_floor(running_machine &machine, void *arg, astring *str, INT32 newval)
+static INT32 slider_red_floor(running_machine &machine, void *arg, std::string *str, INT32 newval)
{
((hlsl_options*)arg)->params_dirty = true;
return slider_set(&(((hlsl_options*)arg)->floor[0]), 0.01f, "%2.2f", str, newval);
}
-static INT32 slider_green_floor(running_machine &machine, void *arg, astring *str, INT32 newval)
+static INT32 slider_green_floor(running_machine &machine, void *arg, std::string *str, INT32 newval)
{
((hlsl_options*)arg)->params_dirty = true;
return slider_set(&(((hlsl_options*)arg)->floor[1]), 0.01f, "%2.2f", str, newval);
}
-static INT32 slider_blue_floor(running_machine &machine, void *arg, astring *str, INT32 newval)
+static INT32 slider_blue_floor(running_machine &machine, void *arg, std::string *str, INT32 newval)
{
((hlsl_options*)arg)->params_dirty = true;
return slider_set(&(((hlsl_options*)arg)->floor[2]), 0.01f, "%2.2f", str, newval);
}
-static INT32 slider_red_phosphor_life(running_machine &machine, void *arg, astring *str, INT32 newval)
+static INT32 slider_red_phosphor_life(running_machine &machine, void *arg, std::string *str, INT32 newval)
{
((hlsl_options*)arg)->params_dirty = true;
return slider_set(&(((hlsl_options*)arg)->phosphor[0]), 0.01f, "%2.2f", str, newval);
}
-static INT32 slider_green_phosphor_life(running_machine &machine, void *arg, astring *str, INT32 newval)
+static INT32 slider_green_phosphor_life(running_machine &machine, void *arg, std::string *str, INT32 newval)
{
((hlsl_options*)arg)->params_dirty = true;
return slider_set(&(((hlsl_options*)arg)->phosphor[1]), 0.01f, "%2.2f", str, newval);
}
-static INT32 slider_blue_phosphor_life(running_machine &machine, void *arg, astring *str, INT32 newval)
+static INT32 slider_blue_phosphor_life(running_machine &machine, void *arg, std::string *str, INT32 newval)
{
((hlsl_options*)arg)->params_dirty = true;
return slider_set(&(((hlsl_options*)arg)->phosphor[2]), 0.01f, "%2.2f", str, newval);
}
-static INT32 slider_saturation(running_machine &machine, void *arg, astring *str, INT32 newval)
+static INT32 slider_saturation(running_machine &machine, void *arg, std::string *str, INT32 newval)
{
((hlsl_options*)arg)->params_dirty = true;
return slider_set(&(((hlsl_options*)arg)->saturation), 0.01f, "%2.2f", str, newval);
}
-static INT32 slider_vector_attenuation(running_machine &machine, void *arg, astring *str, INT32 newval)
+static INT32 slider_vector_attenuation(running_machine &machine, void *arg, std::string *str, INT32 newval)
{
((hlsl_options*)arg)->params_dirty = true;
return slider_set(&(((hlsl_options*)arg)->vector_length_scale), 0.01f, "%1.2f", str, newval);
}
-static INT32 slider_vector_length_max(running_machine &machine, void *arg, astring *str, INT32 newval)
+static INT32 slider_vector_length_max(running_machine &machine, void *arg, std::string *str, INT32 newval)
{
((hlsl_options*)arg)->params_dirty = true;
return slider_set(&(((hlsl_options*)arg)->vector_length_ratio), 1.0f, "%4f", str, newval);
}
-static INT32 slider_vector_bloom_scale(running_machine &machine, void *arg, astring *str, INT32 newval)
+static INT32 slider_vector_bloom_scale(running_machine &machine, void *arg, std::string *str, INT32 newval)
{
((hlsl_options*)arg)->params_dirty = true;
return slider_set(&(((hlsl_options*)arg)->vector_bloom_scale), 0.001f, "%1.3f", str, newval);
}
-static INT32 slider_raster_bloom_scale(running_machine &machine, void *arg, astring *str, INT32 newval)
+static INT32 slider_raster_bloom_scale(running_machine &machine, void *arg, std::string *str, INT32 newval)
{
((hlsl_options*)arg)->params_dirty = true;
return slider_set(&(((hlsl_options*)arg)->raster_bloom_scale), 0.001f, "%1.3f", str, newval);
}
-static INT32 slider_bloom_lvl0_scale(running_machine &machine, void *arg, astring *str, INT32 newval)
+static INT32 slider_bloom_lvl0_scale(running_machine &machine, void *arg, std::string *str, INT32 newval)
{
((hlsl_options*)arg)->params_dirty = true;
return slider_set(&(((hlsl_options*)arg)->bloom_level0_weight), 0.01f, "%1.2f", str, newval);
}
-static INT32 slider_bloom_lvl1_scale(running_machine &machine, void *arg, astring *str, INT32 newval)
+static INT32 slider_bloom_lvl1_scale(running_machine &machine, void *arg, std::string *str, INT32 newval)
{
((hlsl_options*)arg)->params_dirty = true;
return slider_set(&(((hlsl_options*)arg)->bloom_level1_weight), 0.01f, "%1.2f", str, newval);
}
-static INT32 slider_bloom_lvl2_scale(running_machine &machine, void *arg, astring *str, INT32 newval)
+static INT32 slider_bloom_lvl2_scale(running_machine &machine, void *arg, std::string *str, INT32 newval)
{
((hlsl_options*)arg)->params_dirty = true;
return slider_set(&(((hlsl_options*)arg)->bloom_level2_weight), 0.01f, "%1.2f", str, newval);
}
-static INT32 slider_bloom_lvl3_scale(running_machine &machine, void *arg, astring *str, INT32 newval)
+static INT32 slider_bloom_lvl3_scale(running_machine &machine, void *arg, std::string *str, INT32 newval)
{
((hlsl_options*)arg)->params_dirty = true;
return slider_set(&(((hlsl_options*)arg)->bloom_level3_weight), 0.01f, "%1.2f", str, newval);
}
-static INT32 slider_bloom_lvl4_scale(running_machine &machine, void *arg, astring *str, INT32 newval)
+static INT32 slider_bloom_lvl4_scale(running_machine &machine, void *arg, std::string *str, INT32 newval)
{
((hlsl_options*)arg)->params_dirty = true;
return slider_set(&(((hlsl_options*)arg)->bloom_level4_weight), 0.01f, "%1.2f", str, newval);
}
-static INT32 slider_bloom_lvl5_scale(running_machine &machine, void *arg, astring *str, INT32 newval)
+static INT32 slider_bloom_lvl5_scale(running_machine &machine, void *arg, std::string *str, INT32 newval)
{
((hlsl_options*)arg)->params_dirty = true;
return slider_set(&(((hlsl_options*)arg)->bloom_level5_weight), 0.01f, "%1.2f", str, newval);
}
-static INT32 slider_bloom_lvl6_scale(running_machine &machine, void *arg, astring *str, INT32 newval)
+static INT32 slider_bloom_lvl6_scale(running_machine &machine, void *arg, std::string *str, INT32 newval)
{
((hlsl_options*)arg)->params_dirty = true;
return slider_set(&(((hlsl_options*)arg)->bloom_level6_weight), 0.01f, "%1.2f", str, newval);
}
-static INT32 slider_bloom_lvl7_scale(running_machine &machine, void *arg, astring *str, INT32 newval)
+static INT32 slider_bloom_lvl7_scale(running_machine &machine, void *arg, std::string *str, INT32 newval)
{
((hlsl_options*)arg)->params_dirty = true;
return slider_set(&(((hlsl_options*)arg)->bloom_level7_weight), 0.01f, "%1.2f", str, newval);
}
-static INT32 slider_bloom_lvl8_scale(running_machine &machine, void *arg, astring *str, INT32 newval)
+static INT32 slider_bloom_lvl8_scale(running_machine &machine, void *arg, std::string *str, INT32 newval)
{
((hlsl_options*)arg)->params_dirty = true;
return slider_set(&(((hlsl_options*)arg)->bloom_level8_weight), 0.01f, "%1.2f", str, newval);
}
-static INT32 slider_bloom_lvl9_scale(running_machine &machine, void *arg, astring *str, INT32 newval)
+static INT32 slider_bloom_lvl9_scale(running_machine &machine, void *arg, std::string *str, INT32 newval)
{
((hlsl_options*)arg)->params_dirty = true;
return slider_set(&(((hlsl_options*)arg)->bloom_level9_weight), 0.01f, "%1.2f", str, newval);
}
-static INT32 slider_bloom_lvl10_scale(running_machine &machine, void *arg, astring *str, INT32 newval)
+static INT32 slider_bloom_lvl10_scale(running_machine &machine, void *arg, std::string *str, INT32 newval)
{
((hlsl_options*)arg)->params_dirty = true;
return slider_set(&(((hlsl_options*)arg)->bloom_level10_weight), 0.01f, "%1.2f", str, newval);
@@ -3393,30 +3393,30 @@ static file_error open_next(d3d::renderer *d3d, emu_file &file, const char *temp
if (snapname == NULL || snapname[0] == 0)
snapname = "%g/%i";
- astring snapstr(snapname);
+ std::string snapstr(snapname);
// strip any extension in the provided name
- int index = snapstr.rchr(0, '.');
+ int index = snapstr.find_last_of('.');
if (index != -1)
snapstr.substr(0, index);
// handle %d in the template (for image devices)
- astring snapdev("%d_");
- int pos = snapstr.find(0, snapdev.c_str());
+ std::string snapdev("%d_");
+ int pos = snapstr.find(snapdev,0);
if (pos != -1)
{
// if more %d are found, revert to default and ignore them all
- if (snapstr.find(pos + 3, snapdev.c_str()) != -1)
- snapstr.cpy("%g/%i");
+ if (snapstr.find(snapdev, pos + 3) != -1)
+ snapstr.assign("%g/%i");
// else if there is a single %d, try to create the correct snapname
else
{
int name_found = 0;
// find length of the device name
- int end1 = snapstr.find(pos + 3, "/");
- int end2 = snapstr.find(pos + 3, "%");
+ int end1 = snapstr.find("/", pos + 3);
+ int end2 = snapstr.find("%", pos + 3);
int end = -1;
if ((end1 != -1) && (end2 != -1))
@@ -3426,35 +3426,35 @@ static file_error open_next(d3d::renderer *d3d, emu_file &file, const char *temp
else if (end2 != -1)
end = end2;
else
- end = snapstr.len();
+ end = snapstr.length();
if (end - pos < 3)
fatalerror("Something very wrong is going on!!!\n");
// copy the device name to an astring
- astring snapdevname;
- snapdevname.cpysubstr(snapstr, pos + 3, end - pos - 3);
+ std::string snapdevname;
+ snapdevname.assign(snapstr.substr(pos + 3, end - pos - 3));
// verify that there is such a device for this system
image_interface_iterator iter(d3d->window().machine().root_device());
for (device_image_interface *image = iter.first(); image != NULL; iter.next())
{
// get the device name
- astring tempdevname(image->brief_instance_name());
+ std::string tempdevname(image->brief_instance_name());
- if (snapdevname.cmp(tempdevname) == 0)
+ if (snapdevname.compare(tempdevname) == 0)
{
// verify that such a device has an image mounted
if (image->basename() != NULL)
{
- astring filename(image->basename());
+ std::string filename(image->basename());
// strip extension
- filename.substr(0, filename.rchr(0, '.'));
+ filename.substr(0, filename.find_last_of('.'));
// setup snapname and remove the %d_
- snapstr.replace(0, snapdevname.c_str(), filename.c_str());
- snapstr.del(pos, 3);
+ strreplace(snapstr, snapdevname.c_str(), filename.c_str());
+ snapstr.erase(pos, 3);
name_found = 1;
}
@@ -3463,33 +3463,34 @@ static file_error open_next(d3d::renderer *d3d, emu_file &file, const char *temp
// or fallback to default
if (name_found == 0)
- snapstr.cpy("%g/%i");
+ snapstr.assign("%g/%i");
}
}
// add our own index
// add our own extension
- snapstr.cat(".").cat(extension);
+ snapstr.append(".").append(extension);
// substitute path and gamename up front
- snapstr.replace(0, "/", PATH_SEPARATOR);
- snapstr.replace(0, "%g", d3d->window().machine().basename());
+ strreplace(snapstr, "/", PATH_SEPARATOR);
+ strreplace(snapstr, "%g", d3d->window().machine().basename());
// determine if the template has an index; if not, we always use the same name
- astring fname;
- if (snapstr.find(0, "%i") == -1)
- fname.cpy(snapstr);
+ std::string fname;
+ if (snapstr.find("%i") == -1)
+ fname.assign(snapstr);
// otherwise, we scan for the next available filename
else
{
// try until we succeed
- astring seqtext;
+ std::string seqtext;
file.set_openflags(OPEN_FLAG_READ);
for (int seq = 0; ; seq++)
{
// build up the filename
- fname.cpy(snapstr).replace(0, "%i", seqtext.format("%04d_%d", seq, idx).c_str());
+ strprintf(seqtext, "%04d_%d", seq, idx);
+ strreplace(fname.assign(snapstr), "%i", seqtext.c_str());
// try to open the file; stop when we fail
file_error filerr = file.open(fname.c_str());