summaryrefslogtreecommitdiffstats
path: root/src/osd/windows
diff options
context:
space:
mode:
authorGravatarGravatar Miodrag Milanovic <mmicko@gmail.com>2013-02-11 07:44:56 +0000
committerGravatarGravatar Miodrag Milanovic <mmicko@gmail.com>2013-02-11 07:44:56 +0000
commita440a8e0200a36491ae540f6f00beae59c148549 (patch) (github)
treeb4c31ebadaa2857396c37178674086420bf1658f /src/osd/windows
parent4b0b4e6b2fa7eb5105859f561354662d479f53be (diff)
downloadmame0148u1.tar.bz2
mame0148u1.zip
Cleanups and version bumpmame0148u1
Diffstat (limited to 'src/osd/windows')
-rw-r--r--src/osd/windows/d3dcomm.h4
-rw-r--r--src/osd/windows/d3dhlsl.c954
-rw-r--r--src/osd/windows/d3dhlsl.h42
-rw-r--r--src/osd/windows/drawd3d.c262
-rw-r--r--src/osd/windows/drawd3d.h14
-rw-r--r--src/osd/windows/winmain.c18
-rw-r--r--src/osd/windows/winmain.h10
-rw-r--r--src/osd/windows/winsocket.c12
8 files changed, 658 insertions, 658 deletions
diff --git a/src/osd/windows/d3dcomm.h b/src/osd/windows/d3dcomm.h
index 2ac96074006..41318dc0822 100644
--- a/src/osd/windows/d3dcomm.h
+++ b/src/osd/windows/d3dcomm.h
@@ -86,8 +86,8 @@ struct d3d_poly_info
UINT32 flags; // rendering flags
DWORD modmode; // texture modulation mode
d3d_texture_info * texture; // pointer to texture info
- float line_time; // used by vectors
- float line_length; // used by vectors
+ float line_time; // used by vectors
+ float line_length; // used by vectors
};
diff --git a/src/osd/windows/d3dhlsl.c b/src/osd/windows/d3dhlsl.c
index 06f9894a026..373526dbdd8 100644
--- a/src/osd/windows/d3dhlsl.c
+++ b/src/osd/windows/d3dhlsl.c
@@ -914,17 +914,17 @@ void hlsl_info::init(d3d_base *d3dintf, win_window_info *window)
ini_file.gets(buf, 1024);
sscanf(buf, "yiq_phase_count %d\n", &options->yiq_phase_count);
- ini_file.gets(buf, 1024);
- sscanf(buf, "vector_time_scale %f\n", &options->vector_time_scale);
+ ini_file.gets(buf, 1024);
+ sscanf(buf, "vector_time_scale %f\n", &options->vector_time_scale);
- ini_file.gets(buf, 1024);
- sscanf(buf, "vector_time_period %f\n", &options->vector_time_period);
+ ini_file.gets(buf, 1024);
+ sscanf(buf, "vector_time_period %f\n", &options->vector_time_period);
- ini_file.gets(buf, 1024);
- sscanf(buf, "vector_length_scale %f\n", &options->vector_length_scale);
+ ini_file.gets(buf, 1024);
+ sscanf(buf, "vector_length_scale %f\n", &options->vector_length_scale);
- ini_file.gets(buf, 1024);
- sscanf(buf, "vector_length_ratio %f\n", &options->vector_length_ratio);
+ ini_file.gets(buf, 1024);
+ sscanf(buf, "vector_length_ratio %f\n", &options->vector_length_ratio);
}
}
}
@@ -979,10 +979,10 @@ void hlsl_info::init(d3d_base *d3dintf, win_window_info *window)
options->yiq_q = winoptions.screen_yiq_q();
options->yiq_scan_time = winoptions.screen_yiq_scan_time();
options->yiq_phase_count = winoptions.screen_yiq_phase_count();
- options->vector_time_scale = winoptions.screen_vector_time_scale();
- options->vector_time_period = winoptions.screen_vector_time_period();
- options->vector_length_scale = winoptions.screen_vector_length_scale();
- options->vector_length_ratio = winoptions.screen_vector_length_ratio();
+ options->vector_time_scale = winoptions.screen_vector_time_scale();
+ options->vector_time_period = winoptions.screen_vector_time_period();
+ options->vector_length_scale = winoptions.screen_vector_length_scale();
+ options->vector_length_ratio = winoptions.screen_vector_length_ratio();
}
options->params_dirty = true;
@@ -1001,58 +1001,58 @@ void hlsl_info::init(d3d_base *d3dintf, win_window_info *window)
void hlsl_info::init_fsfx_quad(void *vertbuf)
{
- // Called at the start of each frame by the D3D code in order to reserve two triangles
- // that are guaranteed to be at a fixed position so as to simply use D3DPT_TRIANGLELIST, 0, 2
- // instead of having to do bookkeeping about a specific screen quad
- if (!master_enable || !d3dintf->post_fx_available)
- return;
+ // Called at the start of each frame by the D3D code in order to reserve two triangles
+ // that are guaranteed to be at a fixed position so as to simply use D3DPT_TRIANGLELIST, 0, 2
+ // instead of having to do bookkeeping about a specific screen quad
+ if (!master_enable || !d3dintf->post_fx_available)
+ return;
- d3d_info *d3d = (d3d_info *)window->drawdata;
+ d3d_info *d3d = (d3d_info *)window->drawdata;
- // get a pointer to the vertex buffer
- fsfx_vertices = (d3d_vertex *)vertbuf;
- if (fsfx_vertices == NULL)
- return;
+ // get a pointer to the vertex buffer
+ fsfx_vertices = (d3d_vertex *)vertbuf;
+ if (fsfx_vertices == NULL)
+ return;
- // fill in the vertexes clockwise
- fsfx_vertices[0].x = 0.0f;
- fsfx_vertices[0].y = 0.0f;
- fsfx_vertices[1].x = d3d->width;
- fsfx_vertices[1].y = 0.0f;
- fsfx_vertices[2].x = 0.0f;
- fsfx_vertices[2].y = d3d->height;
- fsfx_vertices[3].x = d3d->width;
- fsfx_vertices[3].y = 0.0f;
- fsfx_vertices[4].x = 0.0f;
- fsfx_vertices[4].y = d3d->height;
- fsfx_vertices[5].x = d3d->width;
- fsfx_vertices[5].y = d3d->height;
+ // fill in the vertexes clockwise
+ fsfx_vertices[0].x = 0.0f;
+ fsfx_vertices[0].y = 0.0f;
+ fsfx_vertices[1].x = d3d->width;
+ fsfx_vertices[1].y = 0.0f;
+ fsfx_vertices[2].x = 0.0f;
+ fsfx_vertices[2].y = d3d->height;
+ fsfx_vertices[3].x = d3d->width;
+ fsfx_vertices[3].y = 0.0f;
+ fsfx_vertices[4].x = 0.0f;
+ fsfx_vertices[4].y = d3d->height;
+ fsfx_vertices[5].x = d3d->width;
+ fsfx_vertices[5].y = d3d->height;
- fsfx_vertices[0].u0 = 0.0f;
- fsfx_vertices[0].v0 = 0.0f;
+ fsfx_vertices[0].u0 = 0.0f;
+ fsfx_vertices[0].v0 = 0.0f;
- fsfx_vertices[1].u0 = 1.0f;
- fsfx_vertices[1].v0 = 0.0f;
+ fsfx_vertices[1].u0 = 1.0f;
+ fsfx_vertices[1].v0 = 0.0f;
- fsfx_vertices[2].u0 = 0.0f;
- fsfx_vertices[2].v0 = 1.0f;
+ fsfx_vertices[2].u0 = 0.0f;
+ fsfx_vertices[2].v0 = 1.0f;
- fsfx_vertices[3].u0 = 1.0f;
- fsfx_vertices[3].v0 = 0.0f;
+ fsfx_vertices[3].u0 = 1.0f;
+ fsfx_vertices[3].v0 = 0.0f;
- fsfx_vertices[4].u0 = 0.0f;
- fsfx_vertices[4].v0 = 1.0f;
+ fsfx_vertices[4].u0 = 0.0f;
+ fsfx_vertices[4].v0 = 1.0f;
- fsfx_vertices[5].u0 = 1.0f;
- fsfx_vertices[5].v0 = 1.0f;
+ fsfx_vertices[5].u0 = 1.0f;
+ fsfx_vertices[5].v0 = 1.0f;
- // set the color, Z parameters to standard values
- for (int i = 0; i < 6; i++)
- {
- fsfx_vertices[i].z = 0.0f;
- fsfx_vertices[i].rhw = 1.0f;
- fsfx_vertices[i].color = D3DCOLOR_ARGB(255, 255, 255, 255);
- }
+ // set the color, Z parameters to standard values
+ for (int i = 0; i < 6; i++)
+ {
+ fsfx_vertices[i].z = 0.0f;
+ fsfx_vertices[i].rhw = 1.0f;
+ fsfx_vertices[i].color = D3DCOLOR_ARGB(255, 255, 255, 255);
+ }
}
@@ -1068,22 +1068,22 @@ int hlsl_info::create_resources(bool reset)
d3d_info *d3d = (d3d_info *)window->drawdata;
- HRESULT result = (*d3dintf->device.get_render_target)(d3d->device, 0, &backbuffer);
- if (result != D3D_OK) mame_printf_verbose("Direct3D: Error %08X during device get_render_target call\n", (int)result);
-
- result = (*d3dintf->device.create_texture)(d3d->device, 4, 4, 1, D3DUSAGE_RENDERTARGET, D3DFMT_A8R8G8B8, D3DPOOL_DEFAULT, &black_texture);
- if (result != D3D_OK)
- {
- mame_printf_verbose("Direct3D: Unable to init video-memory target for black texture (%08x)\n", (UINT32)result);
- return 1;
- }
- (*d3dintf->texture.get_surface_level)(black_texture, 0, &black_surface);
- result = (*d3dintf->device.set_render_target)(d3d->device, 0, black_surface);
- if (result != D3D_OK) mame_printf_verbose("Direct3D: Error %08X during device set_render_target call\n", (int)result);
- result = (*d3dintf->device.clear)(d3d->device, 0, NULL, D3DCLEAR_TARGET, D3DCOLOR_ARGB(0,0,0,0), 0, 0);
- if (result != D3D_OK) mame_printf_verbose("Direct3D: Error %08X during device clear call\n", (int)result);
- result = (*d3dintf->device.set_render_target)(d3d->device, 0, backbuffer);
- if (result != D3D_OK) mame_printf_verbose("Direct3D: Error %08X during device set_render_target call\n", (int)result);
+ HRESULT result = (*d3dintf->device.get_render_target)(d3d->device, 0, &backbuffer);
+ if (result != D3D_OK) mame_printf_verbose("Direct3D: Error %08X during device get_render_target call\n", (int)result);
+
+ result = (*d3dintf->device.create_texture)(d3d->device, 4, 4, 1, D3DUSAGE_RENDERTARGET, D3DFMT_A8R8G8B8, D3DPOOL_DEFAULT, &black_texture);
+ if (result != D3D_OK)
+ {
+ mame_printf_verbose("Direct3D: Unable to init video-memory target for black texture (%08x)\n", (UINT32)result);
+ return 1;
+ }
+ (*d3dintf->texture.get_surface_level)(black_texture, 0, &black_surface);
+ result = (*d3dintf->device.set_render_target)(d3d->device, 0, black_surface);
+ if (result != D3D_OK) mame_printf_verbose("Direct3D: Error %08X during device set_render_target call\n", (int)result);
+ result = (*d3dintf->device.clear)(d3d->device, 0, NULL, D3DCLEAR_TARGET, D3DCOLOR_ARGB(0,0,0,0), 0, 0);
+ if (result != D3D_OK) mame_printf_verbose("Direct3D: Error %08X during device clear call\n", (int)result);
+ result = (*d3dintf->device.set_render_target)(d3d->device, 0, backbuffer);
+ if (result != D3D_OK) mame_printf_verbose("Direct3D: Error %08X during device set_render_target call\n", (int)result);
result = (*d3dintf->device.create_texture)(d3d->device, (int)snap_width, (int)snap_height, 1, D3DUSAGE_DYNAMIC, D3DFMT_A8R8G8B8, D3DPOOL_SYSTEMMEM, &avi_copy_texture);
if (result != D3D_OK)
@@ -1243,35 +1243,35 @@ int hlsl_info::create_resources(bool reset)
// create the vector shader
#if HLSL_VECTOR
- char bloom_cstr[1024];
- sprintf(bloom_cstr, "%s\\bloom.fx", fx_dir);
- TCHAR *bloom_name = tstring_from_utf8(bloom_cstr);
-
- result = (*d3dintf->device.create_effect)(d3d->device, bloom_name, &bloom_effect);
- if(result != D3D_OK)
- {
- mame_printf_verbose("Direct3D: Unable to load bloom.fx\n");
- return 1;
- }
- if (bloom_name)
- osd_free(bloom_name);
-
- char downsample_cstr[1024];
- sprintf(downsample_cstr, "%s\\downsample.fx", fx_dir);
- TCHAR *downsample_name = tstring_from_utf8(downsample_cstr);
-
- result = (*d3dintf->device.create_effect)(d3d->device, downsample_name, &downsample_effect);
- if(result != D3D_OK)
- {
- mame_printf_verbose("Direct3D: Unable to load downsample.fx\n");
- return 1;
- }
- if (downsample_name)
- osd_free(downsample_name);
-
- char vector_cstr[1024];
- sprintf(vector_cstr, "%s\\vector.fx", fx_dir);
- TCHAR *vector_name = tstring_from_utf8(vector_cstr);
+ char bloom_cstr[1024];
+ sprintf(bloom_cstr, "%s\\bloom.fx", fx_dir);
+ TCHAR *bloom_name = tstring_from_utf8(bloom_cstr);
+
+ result = (*d3dintf->device.create_effect)(d3d->device, bloom_name, &bloom_effect);
+ if(result != D3D_OK)
+ {
+ mame_printf_verbose("Direct3D: Unable to load bloom.fx\n");
+ return 1;
+ }
+ if (bloom_name)
+ osd_free(bloom_name);
+
+ char downsample_cstr[1024];
+ sprintf(downsample_cstr, "%s\\downsample.fx", fx_dir);
+ TCHAR *downsample_name = tstring_from_utf8(downsample_cstr);
+
+ result = (*d3dintf->device.create_effect)(d3d->device, downsample_name, &downsample_effect);
+ if(result != D3D_OK)
+ {
+ mame_printf_verbose("Direct3D: Unable to load downsample.fx\n");
+ return 1;
+ }
+ if (downsample_name)
+ osd_free(downsample_name);
+
+ char vector_cstr[1024];
+ sprintf(vector_cstr, "%s\\vector.fx", fx_dir);
+ TCHAR *vector_name = tstring_from_utf8(vector_cstr);
result = (*d3dintf->device.create_effect)(d3d->device, vector_name, &vector_effect);
if(result != D3D_OK)
@@ -1351,7 +1351,7 @@ void hlsl_info::begin_frame()
d3d_render_target *rt = find_render_target(d3d->width, d3d->height, 0, 0);
if (rt == NULL)
{
- return;
+ return;
}
HRESULT result = (*d3dintf->device.set_render_target)(d3d->device, 0, rt->target[0]);
@@ -1368,42 +1368,42 @@ void hlsl_info::begin_frame()
//============================================================
void hlsl_info::blit(d3d_surface *dst, d3d_texture *src, d3d_surface *new_dst, D3DPRIMITIVETYPE prim_type,
- UINT32 prim_index, UINT32 prim_count, int dstw, int dsth)
+ UINT32 prim_index, UINT32 prim_count, int dstw, int dsth)
{
- d3d_info *d3d = (d3d_info *)window->drawdata;
+ d3d_info *d3d = (d3d_info *)window->drawdata;
- HRESULT result = (*d3dintf->device.set_render_target)(d3d->device, 0, dst);
- if (result != D3D_OK) mame_printf_verbose("Direct3D: Error %08X during device set_render_target call\n", (int)result);
+ HRESULT result = (*d3dintf->device.set_render_target)(d3d->device, 0, dst);
+ if (result != D3D_OK) mame_printf_verbose("Direct3D: Error %08X during device set_render_target call\n", (int)result);
- curr_effect = effect;
+ curr_effect = effect;
- (*d3dintf->effect.set_texture)(curr_effect, "Diffuse", src);
+ (*d3dintf->effect.set_texture)(curr_effect, "Diffuse", src);
- (*d3dintf->effect.set_float)(curr_effect, "TargetWidth", (float)dstw);
- (*d3dintf->effect.set_float)(curr_effect, "TargetHeight", (float)dsth);
- (*d3dintf->effect.set_float)(curr_effect, "PostPass", 1.0f);
- (*d3dintf->effect.set_float)(curr_effect, "PincushionAmount", options->pincushion);
- (*d3dintf->effect.set_float)(curr_effect, "Brighten", 0.0f);
+ (*d3dintf->effect.set_float)(curr_effect, "TargetWidth", (float)dstw);
+ (*d3dintf->effect.set_float)(curr_effect, "TargetHeight", (float)dsth);
+ (*d3dintf->effect.set_float)(curr_effect, "PostPass", 1.0f);
+ (*d3dintf->effect.set_float)(curr_effect, "PincushionAmount", options->pincushion);
+ (*d3dintf->effect.set_float)(curr_effect, "Brighten", 0.0f);
- unsigned int num_passes = 0;
- (*d3dintf->effect.begin)(curr_effect, &num_passes, 0);
+ unsigned int num_passes = 0;
+ (*d3dintf->effect.begin)(curr_effect, &num_passes, 0);
- for (UINT pass = 0; pass < num_passes; pass++)
- {
- (*d3dintf->effect.begin_pass)(curr_effect, pass);
- // add the primitives
- HRESULT result = (*d3dintf->device.draw_primitive)(d3d->device, prim_type, prim_index, prim_count);
- if (result != D3D_OK) mame_printf_verbose("Direct3D: Error %08X during device draw_primitive call\n", (int)result);
- (*d3dintf->effect.end_pass)(curr_effect);
- }
+ for (UINT pass = 0; pass < num_passes; pass++)
+ {
+ (*d3dintf->effect.begin_pass)(curr_effect, pass);
+ // add the primitives
+ HRESULT result = (*d3dintf->device.draw_primitive)(d3d->device, prim_type, prim_index, prim_count);
+ if (result != D3D_OK) mame_printf_verbose("Direct3D: Error %08X during device draw_primitive call\n", (int)result);
+ (*d3dintf->effect.end_pass)(curr_effect);
+ }
- (*d3dintf->effect.end)(curr_effect);
+ (*d3dintf->effect.end)(curr_effect);
- if (new_dst)
- {
- HRESULT result = (*d3dintf->device.set_render_target)(d3d->device, 0, new_dst);
- if (result != D3D_OK) mame_printf_verbose("Direct3D: Error %08X during device set_render_target call\n", (int)result);
- }
+ if (new_dst)
+ {
+ HRESULT result = (*d3dintf->device.set_render_target)(d3d->device, 0, new_dst);
+ if (result != D3D_OK) mame_printf_verbose("Direct3D: Error %08X during device set_render_target call\n", (int)result);
+ }
}
@@ -1413,7 +1413,7 @@ void hlsl_info::blit(d3d_surface *dst, d3d_texture *src, d3d_surface *new_dst, D
//============================================================
void hlsl_info::blit(d3d_surface *dst, d3d_texture *src, d3d_surface *new_dst, D3DPRIMITIVETYPE prim_type,
- UINT32 prim_index, UINT32 prim_count)
+ UINT32 prim_index, UINT32 prim_count)
{
d3d_info *d3d = (d3d_info *)window->drawdata;
@@ -1430,10 +1430,10 @@ void hlsl_info::blit(d3d_surface *dst, d3d_texture *src, d3d_surface *new_dst, D
(*d3dintf->effect.set_texture)(curr_effect, "Diffuse", src);
- (*d3dintf->effect.set_float)(curr_effect, "TargetWidth", (float)d3d->width);
- (*d3dintf->effect.set_float)(curr_effect, "TargetHeight", (float)d3d->height);
- (*d3dintf->effect.set_float)(curr_effect, "ScreenWidth", (float)d3d->width);
- (*d3dintf->effect.set_float)(curr_effect, "ScreenHeight", (float)d3d->height);
+ (*d3dintf->effect.set_float)(curr_effect, "TargetWidth", (float)d3d->width);
+ (*d3dintf->effect.set_float)(curr_effect, "TargetHeight", (float)d3d->height);
+ (*d3dintf->effect.set_float)(curr_effect, "ScreenWidth", (float)d3d->width);
+ (*d3dintf->effect.set_float)(curr_effect, "ScreenHeight", (float)d3d->height);
(*d3dintf->effect.set_float)(curr_effect, "PostPass", 1.0f);
(*d3dintf->effect.set_float)(curr_effect, "PincushionAmount", options->pincushion);
(*d3dintf->effect.set_float)(curr_effect, "Brighten", 1.0f);
@@ -1475,22 +1475,22 @@ void hlsl_info::end_frame()
render_snapshot(snap_target);
}
- if (!lines_pending)
- return;
+ if (!lines_pending)
+ return;
- lines_pending = false;
- /*d3d_info *d3d = (d3d_info *)window->drawdata;
+ lines_pending = false;
+ /*d3d_info *d3d = (d3d_info *)window->drawdata;
- d3d_render_target *rt = find_render_target(d3d->width, d3d->height, 0, 0);
- if (!rt)
- return;
+ d3d_render_target *rt = find_render_target(d3d->width, d3d->height, 0, 0);
+ if (!rt)
+ return;
- blit(backbuffer, rt->texture[0], NULL, vecbuf_type, vecbuf_index, vecbuf_count);*/
+ blit(backbuffer, rt->texture[0], NULL, vecbuf_type, vecbuf_index, vecbuf_count);*/
/*d3d_render_target *rt = find_render_target(d3d->width, d3d->height, 0, 0);
if (rt == NULL)
{
- return;
+ return;
}
blit(backbuffer, rt->texture[1], NULL, vecbuf_type, vecbuf_index, vecbuf_count);
@@ -1973,9 +1973,9 @@ void hlsl_info::render_quad(d3d_poly_info *poly, int vertnum)
(*d3dintf->effect.end)(curr_effect);
- curr_effect = post_effect;
- (*d3dintf->effect.set_float)(curr_effect, "TargetWidth", (float)d3d->width);
- (*d3dintf->effect.set_float)(curr_effect, "TargetHeight", (float)d3d->height);
+ curr_effect = post_effect;
+ (*d3dintf->effect.set_float)(curr_effect, "TargetWidth", (float)d3d->width);
+ (*d3dintf->effect.set_float)(curr_effect, "TargetHeight", (float)d3d->height);
/* Scanlines and shadow mask, at high res for AVI logging*/
if(avi_output_file != NULL)
@@ -2022,156 +2022,156 @@ void hlsl_info::render_quad(d3d_poly_info *poly, int vertnum)
snap_rendered = true;
}
- /* Scanlines and shadow mask */
- curr_effect = post_effect;
+ /* Scanlines and shadow mask */
+ curr_effect = post_effect;
- (*d3dintf->effect.set_texture)(curr_effect, "Diffuse", rt->texture[0]);
+ (*d3dintf->effect.set_texture)(curr_effect, "Diffuse", rt->texture[0]);
- //(*d3dintf->effect.set_float)(curr_effect, "TargetWidth", (float)rt->target_width);
- //(*d3dintf->effect.set_float)(curr_effect, "TargetHeight", (float)rt->target_height);
+ //(*d3dintf->effect.set_float)(curr_effect, "TargetWidth", (float)rt->target_width);
+ //(*d3dintf->effect.set_float)(curr_effect, "TargetHeight", (float)rt->target_height);
#if HLSL_VECTOR
- result = (*d3dintf->device.set_render_target)(d3d->device, 0, rt->target[1]);
+ result = (*d3dintf->device.set_render_target)(d3d->device, 0, rt->target[1]);
#else
- result = (*d3dintf->device.set_render_target)(d3d->device, 0, backbuffer);
+ result = (*d3dintf->device.set_render_target)(d3d->device, 0, backbuffer);
#endif
- if (result != D3D_OK) mame_printf_verbose("Direct3D: Error %08X during device set_render_target call\n", (int)result);
+ if (result != D3D_OK) mame_printf_verbose("Direct3D: Error %08X during device set_render_target call\n", (int)result);
- (*d3dintf->effect.begin)(curr_effect, &num_passes, 0);
+ (*d3dintf->effect.begin)(curr_effect, &num_passes, 0);
- for (UINT pass = 0; pass < num_passes; pass++)
- {
- (*d3dintf->effect.begin_pass)(curr_effect, pass);
- // add the primitives
- result = (*d3dintf->device.draw_primitive)(d3d->device, poly->type, vertnum, poly->count);
- if (result != D3D_OK) mame_printf_verbose("Direct3D: Error %08X during device draw_primitive call\n", (int)result);
- (*d3dintf->effect.end_pass)(curr_effect);
- }
+ for (UINT pass = 0; pass < num_passes; pass++)
+ {
+ (*d3dintf->effect.begin_pass)(curr_effect, pass);
+ // add the primitives
+ result = (*d3dintf->device.draw_primitive)(d3d->device, poly->type, vertnum, poly->count);
+ if (result != D3D_OK) mame_printf_verbose("Direct3D: Error %08X during device draw_primitive call\n", (int)result);
+ (*d3dintf->effect.end_pass)(curr_effect);
+ }
- (*d3dintf->effect.end)(curr_effect);
+ (*d3dintf->effect.end)(curr_effect);
#if HLSL_VECTOR
- /* Bloom */
- curr_effect = downsample_effect;
-
- (*d3dintf->effect.set_texture)(curr_effect, "Diffuse", rt->texture[1]);
-
- int bloom_size = (rt->target_width < rt->target_height) ? rt->target_width : rt->target_height;
- int bloom_index = 0;
- int bloom_width = rt->target_width;
- int bloom_height = rt->target_height;
- for(; bloom_size >= 2 && bloom_index < 11; bloom_size >>= 1)
- {
- float source_size[2] = { bloom_width, bloom_height };
- float target_size[2] = { bloom_width >> 1, bloom_height >> 1 };
- (*d3dintf->effect.set_vector)(curr_effect, "TargetSize", 2, target_size);
- (*d3dintf->effect.set_vector)(curr_effect, "SourceSize", 2, source_size);
-
- (*d3dintf->effect.begin)(curr_effect, &num_passes, 0);
-
- (*d3dintf->effect.set_texture)(curr_effect, "Diffuse", (bloom_index == 0) ? rt->texture[1] : ct->bloom_texture[bloom_index - 1]);
-
- if (ct->bloom_target[bloom_index] == NULL)
- {
- (*d3dintf->effect.end)(curr_effect);
- break;
- }
-
- HRESULT result = (*d3dintf->device.set_render_target)(d3d->device, 0, ct->bloom_target[bloom_index]);
- if (result != D3D_OK) mame_printf_verbose("Direct3D: Error %08X during device set_render_target call 7:%d\n", (int)result, bloom_size);
- //result = (*d3dintf->device.clear)(d3d->device, 0, NULL, D3DCLEAR_TARGET, D3DCOLOR_ARGB(0,0,0,0), 0, 0);
- //if (result != D3D_OK) mame_printf_verbose("Direct3D: Error %08X during device clear call\n", (int)result);
-
- for (UINT pass = 0; pass < num_passes; pass++)
- {
- (*d3dintf->effect.begin_pass)(curr_effect, pass);
- // add the primitives
- result = (*d3dintf->device.draw_primitive)(d3d->device, D3DPT_TRIANGLELIST, 0, 2);
- if (result != D3D_OK) mame_printf_verbose("Direct3D: Error %08X during device draw_primitive call\n", (int)result);
- (*d3dintf->effect.end_pass)(curr_effect);
- }
-
- (*d3dintf->effect.end)(curr_effect);
-
- bloom_index++;
- bloom_width >>= 1;
- bloom_height >>= 1;
- }
-
- /* Bloom composite pass*/
- curr_effect = bloom_effect;
-
- float target_size[2] = { rt->target_width, rt->target_height };
- (*d3dintf->effect.set_vector)(curr_effect, "TargetSize", 2, target_size);
-
- (*d3dintf->effect.set_texture)(curr_effect, "DiffuseA", rt->texture[1]);
- (*d3dintf->effect.set_float)(curr_effect, "DiffuseScaleA", 1.0f);
-
- char name[9] = "Diffuse*";
- char scale[14] = "DiffuseScale*";
- for(int index = 1; index < bloom_index; index++)
- {
- name[7] = 'A' + index;
- scale[12] = 'A' + index;
- (*d3dintf->effect.set_texture)(curr_effect, name, ct->bloom_texture[index - 1]);
- (*d3dintf->effect.set_float)(curr_effect, scale, 1.0f);
- }
- for(int index = bloom_index; index < 11; index++)
- {
- name[7] = 'A' + index;
- scale[12] = 'A' + index;
- (*d3dintf->effect.set_texture)(curr_effect, name, black_texture);
- (*d3dintf->effect.set_float)(curr_effect, scale, 0.0f);
- }
-
- (*d3dintf->effect.begin)(curr_effect, &num_passes, 0);
-
- result = (*d3dintf->device.set_render_target)(d3d->device, 0, rt->target[2]);
- if (result != D3D_OK) mame_printf_verbose("Direct3D: Error %08X during device set_render_target call 8\n", (int)result);
-
- for (UINT pass = 0; pass < num_passes; pass++)
- {
- (*d3dintf->effect.begin_pass)(curr_effect, pass);
- // add the primitives
- result = (*d3dintf->device.draw_primitive)(d3d->device, D3DPT_TRIANGLELIST, 0, 2);
- if (result != D3D_OK) mame_printf_verbose("Direct3D: Error %08X during device draw_primitive call\n", (int)result);
- (*d3dintf->effect.end_pass)(curr_effect);
- }
-
- (*d3dintf->effect.end)(curr_effect);
-
- curr_effect = effect;
-
- //(*d3dintf->effect.set_float)(curr_effect, "PostPass", 1.0f);
-
- //blit(backbuffer, ct->last_texture, NULL, poly->type, vertnum, poly->count, d3d->width, d3d->height);
-
- result = (*d3dintf->device.set_render_target)(d3d->device, 0, backbuffer);
- if (result != D3D_OK) mame_printf_verbose("Direct3D: Error %08X during device set_render_target call 9\n", (int)result);
-
- (*d3dintf->effect.set_texture)(curr_effect, "Diffuse", rt->texture[2]);
-
- (*d3dintf->effect.set_float)(curr_effect, "RawWidth", poly->texture != NULL ? (float)poly->texture->rawwidth : 8.0f);
- (*d3dintf->effect.set_float)(curr_effect, "RawHeight", poly->texture != NULL ? (float)poly->texture->rawheight : 8.0f);
- (*d3dintf->effect.set_float)(curr_effect, "WidthRatio", poly->texture != NULL ? (1.0f / (poly->texture->ustop - poly->texture->ustart)) : 0.0f);
- (*d3dintf->effect.set_float)(curr_effect, "HeightRatio", poly->texture != NULL ? (1.0f / (poly->texture->vstop - poly->texture->vstart)) : 0.0f);
- (*d3dintf->effect.set_float)(curr_effect, "TargetWidth", (float)d3d->width);
- (*d3dintf->effect.set_float)(curr_effect, "TargetHeight", (float)d3d->height);
- (*d3dintf->effect.set_float)(curr_effect, "PostPass", 0.0f);
- (*d3dintf->effect.set_float)(curr_effect, "PincushionAmount", options->pincushion);
-
- (*d3dintf->effect.begin)(curr_effect, &num_passes, 0);
-
- for (UINT pass = 0; pass < num_passes; pass++)
- {
- (*d3dintf->effect.begin_pass)(curr_effect, pass);
- // add the primitives
- HRESULT result = (*d3dintf->device.draw_primitive)(d3d->device, poly->type, vertnum, poly->count);
- if (result != D3D_OK) mame_printf_verbose("Direct3D: Error %08X during device draw_primitive call\n", (int)result);
- (*d3dintf->effect.end_pass)(curr_effect);
- }
-
- (*d3dintf->effect.end)(curr_effect);
+ /* Bloom */
+ curr_effect = downsample_effect;
+
+ (*d3dintf->effect.set_texture)(curr_effect, "Diffuse", rt->texture[1]);
+
+ int bloom_size = (rt->target_width < rt->target_height) ? rt->target_width : rt->target_height;
+ int bloom_index = 0;
+ int bloom_width = rt->target_width;
+ int bloom_height = rt->target_height;
+ for(; bloom_size >= 2 && bloom_index < 11; bloom_size >>= 1)
+ {
+ float source_size[2] = { bloom_width, bloom_height };
+ float target_size[2] = { bloom_width >> 1, bloom_height >> 1 };
+ (*d3dintf->effect.set_vector)(curr_effect, "TargetSize", 2, target_size);
+ (*d3dintf->effect.set_vector)(curr_effect, "SourceSize", 2, source_size);
+
+ (*d3dintf->effect.begin)(curr_effect, &num_passes, 0);
+
+ (*d3dintf->effect.set_texture)(curr_effect, "Diffuse", (bloom_index == 0) ? rt->texture[1] : ct->bloom_texture[bloom_index - 1]);
+
+ if (ct->bloom_target[bloom_index] == NULL)
+ {
+ (*d3dintf->effect.end)(curr_effect);
+ break;
+ }
+
+ HRESULT result = (*d3dintf->device.set_render_target)(d3d->device, 0, ct->bloom_target[bloom_index]);
+ if (result != D3D_OK) mame_printf_verbose("Direct3D: Error %08X during device set_render_target call 7:%d\n", (int)result, bloom_size);
+ //result = (*d3dintf->device.clear)(d3d->device, 0, NULL, D3DCLEAR_TARGET, D3DCOLOR_ARGB(0,0,0,0), 0, 0);
+ //if (result != D3D_OK) mame_printf_verbose("Direct3D: Error %08X during device clear call\n", (int)result);
+
+ for (UINT pass = 0; pass < num_passes; pass++)
+ {
+ (*d3dintf->effect.begin_pass)(curr_effect, pass);
+ // add the primitives
+ result = (*d3dintf->device.draw_primitive)(d3d->device, D3DPT_TRIANGLELIST, 0, 2);
+ if (result != D3D_OK) mame_printf_verbose("Direct3D: Error %08X during device draw_primitive call\n", (int)result);
+ (*d3dintf->effect.end_pass)(curr_effect);
+ }
+
+ (*d3dintf->effect.end)(curr_effect);
+
+ bloom_index++;
+ bloom_width >>= 1;
+ bloom_height >>= 1;
+ }
+
+ /* Bloom composite pass*/
+ curr_effect = bloom_effect;
+
+ float target_size[2] = { rt->target_width, rt->target_height };
+ (*d3dintf->effect.set_vector)(curr_effect, "TargetSize", 2, target_size);
+
+ (*d3dintf->effect.set_texture)(curr_effect, "DiffuseA", rt->texture[1]);
+ (*d3dintf->effect.set_float)(curr_effect, "DiffuseScaleA", 1.0f);
+
+ char name[9] = "Diffuse*";
+ char scale[14] = "DiffuseScale*";
+ for(int index = 1; index < bloom_index; index++)
+ {
+ name[7] = 'A' + index;
+ scale[12] = 'A' + index;
+ (*d3dintf->effect.set_texture)(curr_effect, name, ct->bloom_texture[index - 1]);
+ (*d3dintf->effect.set_float)(curr_effect, scale, 1.0f);
+ }
+ for(int index = bloom_index; index < 11; index++)
+ {
+ name[7] = 'A' + index;
+ scale[12] = 'A' + index;
+ (*d3dintf->effect.set_texture)(curr_effect, name, black_texture);
+ (*d3dintf->effect.set_float)(curr_effect, scale, 0.0f);
+ }
+
+ (*d3dintf->effect.begin)(curr_effect, &num_passes, 0);
+
+ result = (*d3dintf->device.set_render_target)(d3d->device, 0, rt->target[2]);
+ if (result != D3D_OK) mame_printf_verbose("Direct3D: Error %08X during device set_render_target call 8\n", (int)result);
+
+ for (UINT pass = 0; pass < num_passes; pass++)
+ {
+ (*d3dintf->effect.begin_pass)(curr_effect, pass);
+ // add the primitives
+ result = (*d3dintf->device.draw_primitive)(d3d->device, D3DPT_TRIANGLELIST, 0, 2);
+ if (result != D3D_OK) mame_printf_verbose("Direct3D: Error %08X during device draw_primitive call\n", (int)result);
+ (*d3dintf->effect.end_pass)(curr_effect);
+ }
+
+ (*d3dintf->effect.end)(curr_effect);
+
+ curr_effect = effect;
+
+ //(*d3dintf->effect.set_float)(curr_effect, "PostPass", 1.0f);
+
+ //blit(backbuffer, ct->last_texture, NULL, poly->type, vertnum, poly->count, d3d->width, d3d->height);
+
+ result = (*d3dintf->device.set_render_target)(d3d->device, 0, backbuffer);
+ if (result != D3D_OK) mame_printf_verbose("Direct3D: Error %08X during device set_render_target call 9\n", (int)result);
+
+ (*d3dintf->effect.set_texture)(curr_effect, "Diffuse", rt->texture[2]);
+
+ (*d3dintf->effect.set_float)(curr_effect, "RawWidth", poly->texture != NULL ? (float)poly->texture->rawwidth : 8.0f);
+ (*d3dintf->effect.set_float)(curr_effect, "RawHeight", poly->texture != NULL ? (float)poly->texture->rawheight : 8.0f);
+ (*d3dintf->effect.set_float)(curr_effect, "WidthRatio", poly->texture != NULL ? (1.0f / (poly->texture->ustop - poly->texture->ustart)) : 0.0f);
+ (*d3dintf->effect.set_float)(curr_effect, "HeightRatio", poly->texture != NULL ? (1.0f / (poly->texture->vstop - poly->texture->vstart)) : 0.0f);
+ (*d3dintf->effect.set_float)(curr_effect, "TargetWidth", (float)d3d->width);
+ (*d3dintf->effect.set_float)(curr_effect, "TargetHeight", (float)d3d->height);
+ (*d3dintf->effect.set_float)(curr_effect, "PostPass", 0.0f);
+ (*d3dintf->effect.set_float)(curr_effect, "PincushionAmount", options->pincushion);
+
+ (*d3dintf->effect.begin)(curr_effect, &num_passes, 0);
+
+ for (UINT pass = 0; pass < num_passes; pass++)
+ {
+ (*d3dintf->effect.begin_pass)(curr_effect, pass);
+ // add the primitives
+ HRESULT result = (*d3dintf->device.draw_primitive)(d3d->device, poly->type, vertnum, poly->count);
+ if (result != D3D_OK) mame_printf_verbose("Direct3D: Error %08X during device draw_primitive call\n", (int)result);
+ (*d3dintf->effect.end_pass)(curr_effect);
+ }
+
+ (*d3dintf->effect.end)(curr_effect);
#endif
poly->texture->cur_frame++;
@@ -2180,150 +2180,150 @@ void hlsl_info::render_quad(d3d_poly_info *poly, int vertnum)
options->params_dirty = false;
}
#if HLSL_VECTOR
- else if(PRIMFLAG_GET_VECTOR(poly->flags) && vector_enable)
- {
- d3d_render_target *rt = find_render_target(d3d->width, d3d->height, 0, 0);
- if (rt == NULL)
- {
- return;
- }
-
- lines_pending = true;
-
- curr_effect = vector_effect;
- //curr_effect = effect;
-
- if(options->params_dirty)
- {
- (*d3dintf->effect.set_float)(curr_effect, "TargetWidth", (float)d3d->width);
- (*d3dintf->effect.set_float)(curr_effect, "TargetHeight", (float)d3d->height);
- }
-
- float time_params[2] = { poly->line_time, options->vector_time_scale };
- float length_params[3] = { poly->line_length, options->vector_length_scale, options->vector_length_ratio };
- (*d3dintf->effect.set_vector)(curr_effect, "TimeParams", 2, time_params);
- (*d3dintf->effect.set_vector)(curr_effect, "LengthParams", 3, length_params);
-
- (*d3dintf->effect.begin)(curr_effect, &num_passes, 0);
-
- HRESULT result = (*d3dintf->device.set_render_target)(d3d->device, 0, rt->target[0]);
- if (result != D3D_OK) mame_printf_verbose("Direct3D: Error %08X during device set_render_target call\n", (int)result);
-
- for (UINT pass = 0; pass < num_passes; pass++)
- {
- (*d3dintf->effect.begin_pass)(curr_effect, pass);
- // add the primitives
- HRESULT result = (*d3dintf->device.draw_primitive)(d3d->device, poly->type, vertnum, poly->count);
- if (result != D3D_OK) mame_printf_verbose("Direct3D: Error %08X during device draw_primitive call\n", (int)result);
- (*d3dintf->effect.end_pass)(curr_effect);
- }
-
- (*d3dintf->effect.end)(curr_effect);
- result = (*d3dintf->device.set_render_target)(d3d->device, 0, backbuffer);
- if (result != D3D_OK) mame_printf_verbose("Direct3D: Error %08X during device set_render_target call\n", (int)result);
-
- curr_effect = effect;
-
- (*d3dintf->effect.set_float)(curr_effect, "FixedAlpha", 1.0f);
- }
- else if (PRIMFLAG_GET_VECTORBUF(poly->flags) && vector_enable)
- {
- //if (!lines_pending)
- //return;
- //lines_pending = false;
-
- d3d_info *d3d = (d3d_info *)window->drawdata;
-
- d3d_render_target *rt = find_render_target(d3d->width, d3d->height, 0, 0);
- if (rt == NULL)
- {
- return;
- }
-
- /* Bloom */
- curr_effect = downsample_effect;
-
- (*d3dintf->effect.set_texture)(curr_effect, "Diffuse", rt->texture[0]);
-
- int bloom_size = (d3d->width < d3d->height) ? d3d->width : d3d->height;
- int bloom_index = 0;
- int bloom_width = d3d->width;
- int bloom_height = d3d->height;
- for(; bloom_size >= 2 && bloom_index < 11; bloom_size >>= 1)
- {
- float source_size[2] = { bloom_width, bloom_height };
- float target_size[2] = { bloom_width >> 1, bloom_height >> 1 };
- (*d3dintf->effect.set_vector)(curr_effect, "TargetSize", 2, target_size);
- (*d3dintf->effect.set_vector)(curr_effect, "SourceSize", 2, source_size);
-
- (*d3dintf->effect.begin)(curr_effect, &num_passes, 0);
-
- (*d3dintf->effect.set_texture)(curr_effect, "Diffuse", (bloom_index == 0) ? rt->texture[0] : rt->bloom_texture[bloom_index - 1]);
-
- HRESULT result = (*d3dintf->device.set_render_target)(d3d->device, 0, rt->bloom_target[bloom_index]);
- if (result != D3D_OK) mame_printf_verbose("Direct3D: Error %08X during device set_render_target call 6\n", (int)result);
- //result = (*d3dintf->device.clear)(d3d->device, 0, NULL, D3DCLEAR_TARGET, D3DCOLOR_ARGB(0,0,0,0), 0, 0);
- //if (result != D3D_OK) mame_printf_verbose("Direct3D: Error %08X during device clear call\n", (int)result);
-
- for (UINT pass = 0; pass < num_passes; pass++)
- {
- (*d3dintf->effect.begin_pass)(curr_effect, pass);
- // add the primitives
- result = (*d3dintf->device.draw_primitive)(d3d->device, poly->type, vertnum, poly->count);
- if (result != D3D_OK) mame_printf_verbose("Direct3D: Error %08X during device draw_primitive call\n", (int)result);
- (*d3dintf->effect.end_pass)(curr_effect);
- }
-
- (*d3dintf->effect.end)(curr_effect);
-
- bloom_index++;
- bloom_width >>= 1;
- bloom_height >>= 1;
- }
-
- /* Bloom composite pass*/
- curr_effect = bloom_effect;
-
- float target_size[2] = { d3d->width, d3d->height };
- (*d3dintf->effect.set_vector)(curr_effect, "TargetSize", 2, target_size);
-
- (*d3dintf->effect.set_texture)(curr_effect, "DiffuseA", rt->texture[0]);
- (*d3dintf->effect.set_float)(curr_effect, "DiffuseScaleA", 1.0f);
-
- char name[9] = "Diffuse*";
- char scale[14] = "DiffuseScale*";
- for(int index = 1; index < bloom_index; index++)
- {
- name[7] = 'A' + index;
- scale[12] = 'A' + index;
- (*d3dintf->effect.set_texture)(curr_effect, name, rt->bloom_texture[index - 1]);
- (*d3dintf->effect.set_float)(curr_effect, scale, 1.0f);
- }
- for(int index = bloom_index; index < 11; index++)
- {
- name[7] = 'A' + index;
- scale[12] = 'A' + index;
- (*d3dintf->effect.set_texture)(curr_effect, name, black_texture);
- (*d3dintf->effect.set_float)(curr_effect, scale, 0.0f);
- }
-
- (*d3dintf->effect.begin)(curr_effect, &num_passes, 0);
-
- HRESULT result = (*d3dintf->device.set_render_target)(d3d->device, 0, rt->target[1]);
- if (result != D3D_OK) mame_printf_verbose("Direct3D: Error %08X during device set_render_target call 6\n", (int)result);
- //result = (*d3dintf->device.clear)(d3d->device, 0, NULL, D3DCLEAR_TARGET, D3DCOLOR_ARGB(0,0,0,0), 0, 0);
- //if (result != D3D_OK) mame_printf_verbose("Direct3D: Error %08X during device clear call\n", (int)result);
-
- for (UINT pass = 0; pass < num_passes; pass++)
- {
- (*d3dintf->effect.begin_pass)(curr_effect, pass);
- // add the primitives
- result = (*d3dintf->device.draw_primitive)(d3d->device, poly->type, vertnum, poly->count);
- if (result != D3D_OK) mame_printf_verbose("Direct3D: Error %08X during device draw_primitive call\n", (int)result);
- (*d3dintf->effect.end_pass)(curr_effect);
- }
-
- (*d3dintf->effect.end)(curr_effect);
+ else if(PRIMFLAG_GET_VECTOR(poly->flags) && vector_enable)
+ {
+ d3d_render_target *rt = find_render_target(d3d->width, d3d->height, 0, 0);
+ if (rt == NULL)
+ {
+ return;
+ }
+
+ lines_pending = true;
+
+ curr_effect = vector_effect;
+ //curr_effect = effect;
+
+ if(options->params_dirty)
+ {
+ (*d3dintf->effect.set_float)(curr_effect, "TargetWidth", (float)d3d->width);
+ (*d3dintf->effect.set_float)(curr_effect, "TargetHeight", (float)d3d->height);
+ }
+
+ float time_params[2] = { poly->line_time, options->vector_time_scale };
+ float length_params[3] = { poly->line_length, options->vector_length_scale, options->vector_length_ratio };
+ (*d3dintf->effect.set_vector)(curr_effect, "TimeParams", 2, time_params);
+ (*d3dintf->effect.set_vector)(curr_effect, "LengthParams", 3, length_params);
+
+ (*d3dintf->effect.begin)(curr_effect, &num_passes, 0);
+
+ HRESULT result = (*d3dintf->device.set_render_target)(d3d->device, 0, rt->target[0]);
+ if (result != D3D_OK) mame_printf_verbose("Direct3D: Error %08X during device set_render_target call\n", (int)result);
+
+ for (UINT pass = 0; pass < num_passes; pass++)
+ {
+ (*d3dintf->effect.begin_pass)(curr_effect, pass);
+ // add the primitives
+ HRESULT result = (*d3dintf->device.draw_primitive)(d3d->device, poly->type, vertnum, poly->count);
+ if (result != D3D_OK) mame_printf_verbose("Direct3D: Error %08X during device draw_primitive call\n", (int)result);
+ (*d3dintf->effect.end_pass)(curr_effect);
+ }
+
+ (*d3dintf->effect.end)(curr_effect);
+ result = (*d3dintf->device.set_render_target)(d3d->device, 0, backbuffer);
+ if (result != D3D_OK) mame_printf_verbose("Direct3D: Error %08X during device set_render_target call\n", (int)result);
+
+ curr_effect = effect;
+
+ (*d3dintf->effect.set_float)(curr_effect, "FixedAlpha", 1.0f);
+ }
+ else if (PRIMFLAG_GET_VECTORBUF(poly->flags) && vector_enable)
+ {
+ //if (!lines_pending)
+ //return;
+ //lines_pending = false;
+
+ d3d_info *d3d = (d3d_info *)window->drawdata;
+
+ d3d_render_target *rt = find_render_target(d3d->width, d3d->height, 0, 0);
+ if (rt == NULL)
+ {
+ return;
+ }
+
+ /* Bloom */
+ curr_effect = downsample_effect;
+
+ (*d3dintf->effect.set_texture)(curr_effect, "Diffuse", rt->texture[0]);
+
+ int bloom_size = (d3d->width < d3d->height) ? d3d->width : d3d->height;
+ int bloom_index = 0;
+ int bloom_width = d3d->width;
+ int bloom_height = d3d->height;
+ for(; bloom_size >= 2 && bloom_index < 11; bloom_size >>= 1)
+ {
+ float source_size[2] = { bloom_width, bloom_height };
+ float target_size[2] = { bloom_width >> 1, bloom_height >> 1 };
+ (*d3dintf->effect.set_vector)(curr_effect, "TargetSize", 2, target_size);
+ (*d3dintf->effect.set_vector)(curr_effect, "SourceSize", 2, source_size);
+
+ (*d3dintf->effect.begin)(curr_effect, &num_passes, 0);
+
+ (*d3dintf->effect.set_texture)(curr_effect, "Diffuse", (bloom_index == 0) ? rt->texture[0] : rt->bloom_texture[bloom_index - 1]);
+
+ HRESULT result = (*d3dintf->device.set_render_target)(d3d->device, 0, rt->bloom_target[bloom_index]);
+ if (result != D3D_OK) mame_printf_verbose("Direct3D: Error %08X during device set_render_target call 6\n", (int)result);
+ //result = (*d3dintf->device.clear)(d3d->device, 0, NULL, D3DCLEAR_TARGET, D3DCOLOR_ARGB(0,0,0,0), 0, 0);
+ //if (result != D3D_OK) mame_printf_verbose("Direct3D: Error %08X during device clear call\n", (int)result);
+
+ for (UINT pass = 0; pass < num_passes; pass++)
+ {
+ (*d3dintf->effect.begin_pass)(curr_effect, pass);
+ // add the primitives
+ result = (*d3dintf->device.draw_primitive)(d3d->device, poly->type, vertnum, poly->count);
+ if (result != D3D_OK) mame_printf_verbose("Direct3D: Error %08X during device draw_primitive call\n", (int)result);
+ (*d3dintf->effect.end_pass)(curr_effect);
+ }
+
+ (*d3dintf->effect.end)(curr_effect);
+
+ bloom_index++;
+ bloom_width >>= 1;
+ bloom_height >>= 1;
+ }
+
+ /* Bloom composite pass*/
+ curr_effect = bloom_effect;
+
+ float target_size[2] = { d3d->width, d3d->height };
+ (*d3dintf->effect.set_vector)(curr_effect, "TargetSize", 2, target_size);
+
+ (*d3dintf->effect.set_texture)(curr_effect, "DiffuseA", rt->texture[0]);
+ (*d3dintf->effect.set_float)(curr_effect, "DiffuseScaleA", 1.0f);
+
+ char name[9] = "Diffuse*";
+ char scale[14] = "DiffuseScale*";
+ for(int index = 1; index < bloom_index; index++)
+ {
+ name[7] = 'A' + index;
+ scale[12] = 'A' + index;
+ (*d3dintf->effect.set_texture)(curr_effect, name, rt->bloom_texture[index - 1]);
+ (*d3dintf->effect.set_float)(curr_effect, scale, 1.0f);
+ }
+ for(int index = bloom_index; index < 11; index++)
+ {
+ name[7] = 'A' + index;
+ scale[12] = 'A' + index;
+ (*d3dintf->effect.set_texture)(curr_effect, name, black_texture);
+ (*d3dintf->effect.set_float)(curr_effect, scale, 0.0f);
+ }
+
+ (*d3dintf->effect.begin)(curr_effect, &num_passes, 0);
+
+ HRESULT result = (*d3dintf->device.set_render_target)(d3d->device, 0, rt->target[1]);
+ if (result != D3D_OK) mame_printf_verbose("Direct3D: Error %08X during device set_render_target call 6\n", (int)result);
+ //result = (*d3dintf->device.clear)(d3d->device, 0, NULL, D3DCLEAR_TARGET, D3DCOLOR_ARGB(0,0,0,0), 0, 0);
+ //if (result != D3D_OK) mame_printf_verbose("Direct3D: Error %08X during device clear call\n", (int)result);
+
+ for (UINT pass = 0; pass < num_passes; pass++)
+ {
+ (*d3dintf->effect.begin_pass)(curr_effect, pass);
+ // add the primitives
+ result = (*d3dintf->device.draw_primitive)(d3d->device, poly->type, vertnum, poly->count);
+ if (result != D3D_OK) mame_printf_verbose("Direct3D: Error %08X during device draw_primitive call\n", (int)result);
+ (*d3dintf->effect.end_pass)(curr_effect);
+ }
+
+ (*d3dintf->effect.end)(curr_effect);
/* Phosphor */
curr_effect = phosphor_effect;
@@ -2359,51 +2359,51 @@ void hlsl_info::render_quad(d3d_poly_info *poly, int vertnum)
(*d3dintf->effect.end)(curr_effect);
- //curr_effect = effect;
+ //curr_effect = effect;
- //blit(backbuffer, rt->bloom_texture[5], NULL, poly->type, vertnum, poly->count);
- //blit(rt->target[2], rt->texture[0], NULL, poly->type, vertnum, poly->count);
- blit(backbuffer, rt->texture[0], NULL, poly->type, vertnum, poly->count);
- //blit(backbuffer, rt->texture[0], NULL, poly->type, vertnum, poly->count);
+ //blit(backbuffer, rt->bloom_texture[5], NULL, poly->type, vertnum, poly->count);
+ //blit(rt->target[2], rt->texture[0], NULL, poly->type, vertnum, poly->count);
+ blit(backbuffer, rt->texture[0], NULL, poly->type, vertnum, poly->count);
+ //blit(backbuffer, rt->texture[0], NULL, poly->type, vertnum, poly->count);
- result = (*d3dintf->device.set_render_target)(d3d->device, 0, rt->target[0]);
- if (result != D3D_OK) mame_printf_verbose("Direct3D: Error %08X during device set_render_target call\n", (int)result);
- result = (*d3dintf->device.clear)(d3d->device, 0, NULL, D3DCLEAR_TARGET, D3DCOLOR_ARGB(0,0,0,0), 0, 0);
- if (result != D3D_OK) mame_printf_verbose("Direct3D: Error %08X during device clear call\n", (int)result);
- result = (*d3dintf->device.set_render_target)(d3d->device, 0, backbuffer);
- if (result != D3D_OK) mame_printf_verbose("Direct3D: Error %08X during device set_render_target call\n", (int)result);
+ result = (*d3dintf->device.set_render_target)(d3d->device, 0, rt->target[0]);
+ if (result != D3D_OK) mame_printf_verbose("Direct3D: Error %08X during device set_render_target call\n", (int)result);
+ result = (*d3dintf->device.clear)(d3d->device, 0, NULL, D3DCLEAR_TARGET, D3DCOLOR_ARGB(0,0,0,0), 0, 0);
+ if (result != D3D_OK) mame_printf_verbose("Direct3D: Error %08X during device clear call\n", (int)result);
+ result = (*d3dintf->device.set_render_target)(d3d->device, 0, backbuffer);
+ if (result != D3D_OK) mame_printf_verbose("Direct3D: Error %08X during device set_render_target call\n", (int)result);
- /*curr_effect = post_effect;
+ /*curr_effect = post_effect;
- (*d3dintf->effect.set_texture)(curr_effect, "Diffuse", rt->texture[0]);
+ (*d3dintf->effect.set_texture)(curr_effect, "Diffuse", rt->texture[0]);
- (*d3dintf->effect.set_float)(curr_effect, "TargetWidth", (float)d3d->width);
- (*d3dintf->effect.set_float)(curr_effect, "TargetHeight", (float)d3d->height);
+ (*d3dintf->effect.set_float)(curr_effect, "TargetWidth", (float)d3d->width);
+ (*d3dintf->effect.set_float)(curr_effect, "TargetHeight", (float)d3d->height);
(*d3dintf->effect.set_float)(curr_effect, "RawWidth", (float)poly->texture->rawwidth);
(*d3dintf->effect.set_float)(curr_effect, "RawHeight", (float)poly->texture->rawheight);
(*d3dintf->effect.set_float)(curr_effect, "WidthRatio", 1.0f / (poly->texture->ustop - poly->texture->ustart));
(*d3dintf->effect.set_float)(curr_effect, "HeightRatio", 1.0f / (poly->texture->vstop - poly->texture->vstart));
- result = (*d3dintf->device.set_render_target)(d3d->device, 0, rt->target[1]);
- if (result != D3D_OK) mame_printf_verbose("Direct3D: Error %08X during device set_render_target call\n", (int)result);
+ result = (*d3dintf->device.set_render_target)(d3d->device, 0, rt->target[1]);
+ if (result != D3D_OK) mame_printf_verbose("Direct3D: Error %08X during device set_render_target call\n", (int)result);
- (*d3dintf->effect.begin)(curr_effect, &num_passes, 0);
+ (*d3dintf->effect.begin)(curr_effect, &num_passes, 0);
- for (UINT pass = 0; pass < num_passes; pass++)
- {
- (*d3dintf->effect.begin_pass)(curr_effect, pass);
- // add the primitives
- result = (*d3dintf->device.draw_primitive)(d3d->device, poly->type, vertnum, poly->count);
- if (result != D3D_OK) mame_printf_verbose("Direct3D: Error %08X during device draw_primitive call\n", (int)result);
- (*d3dintf->effect.end_pass)(curr_effect);
- }
+ for (UINT pass = 0; pass < num_passes; pass++)
+ {
+ (*d3dintf->effect.begin_pass)(curr_effect, pass);
+ // add the primitives
+ result = (*d3dintf->device.draw_primitive)(d3d->device, poly->type, vertnum, poly->count);
+ if (result != D3D_OK) mame_printf_verbose("Direct3D: Error %08X during device draw_primitive call\n", (int)result);
+ (*d3dintf->effect.end_pass)(curr_effect);
+ }
- (*d3dintf->effect.end)(curr_effect);*/
+ (*d3dintf->effect.end)(curr_effect);*/
- vecbuf_type = poly->type;
- vecbuf_index = vertnum;
- vecbuf_count = poly->count;
- }
+ vecbuf_type = poly->type;
+ vecbuf_index = vertnum;
+ vecbuf_count = poly->count;
+ }
#endif
else
{
@@ -2733,10 +2733,10 @@ void hlsl_info::delete_resources(bool reset)
file.printf("yiq_q %f\n", options->yiq_q);
file.printf("yiq_scan_time %f\n", options->yiq_scan_time);
file.printf("yiq_phase_count %d\n", options->yiq_phase_count);
- file.printf("vector_time_scale %f\n", options->vector_time_scale);
- file.printf("vector_time_period %f\n", options->vector_time_period);
- file.printf("vector_length_scale %f\n", options->vector_length_scale);
- file.printf("vector_length_ratio %f\n", options->vector_length_ratio);
+ file.printf("vector_time_scale %f\n", options->vector_time_scale);
+ file.printf("vector_time_period %f\n", options->vector_time_period);
+ file.printf("vector_length_scale %f\n", options->vector_length_scale);
+ file.printf("vector_length_ratio %f\n", options->vector_length_ratio);
}
while (targethead != NULL)
@@ -2745,16 +2745,16 @@ void hlsl_info::delete_resources(bool reset)
}
#if HLSL_VECTOR
- if (downsample_effect != NULL)
- {
- (*d3dintf->effect.release)(downsample_effect);
- downsample_effect = NULL;
- }
- if (bloom_effect != NULL)
- {
- (*d3dintf->effect.release)(bloom_effect);
- bloom_effect = NULL;
- }
+ if (downsample_effect != NULL)
+ {
+ (*d3dintf->effect.release)(downsample_effect);
+ downsample_effect = NULL;
+ }
+ if (bloom_effect != NULL)
+ {
+ (*d3dintf->effect.release)(bloom_effect);
+ bloom_effect = NULL;
+ }
#endif
if (effect != NULL)
{
@@ -2807,11 +2807,11 @@ void hlsl_info::delete_resources(bool reset)
yiq_decode_effect = NULL;
}
- if (black_texture != NULL)
- {
- (*d3dintf->texture.release)(black_texture);
- black_texture = NULL;
- }
+ if (black_texture != NULL)
+ {
+ (*d3dintf->texture.release)(black_texture);
+ black_texture = NULL;
+ }
if (avi_copy_texture != NULL)
{
diff --git a/src/osd/windows/d3dhlsl.h b/src/osd/windows/d3dhlsl.h
index 7d508ddb2a1..25c6cf77077 100644
--- a/src/osd/windows/d3dhlsl.h
+++ b/src/osd/windows/d3dhlsl.h
@@ -48,7 +48,7 @@
// CONSTANTS
//============================================================
-#define HLSL_VECTOR (0)
+#define HLSL_VECTOR (0)
//============================================================
// TYPE DEFINITIONS
@@ -92,7 +92,7 @@ struct hlsl_options
float phosphor[3];
float saturation;
- // NTSC
+ // NTSC
bool yiq_enable;
float yiq_cc;
float yiq_a;
@@ -106,11 +106,11 @@ struct hlsl_options
float yiq_scan_time;
int yiq_phase_count;
- // Vectors
- float vector_time_scale;
- float vector_time_period;
- float vector_length_scale;
- float vector_length_ratio;
+ // Vectors
+ float vector_time_scale;
+ float vector_time_period;
+ float vector_length_scale;
+ float vector_length_ratio;
};
class hlsl_info
@@ -150,7 +150,7 @@ public:
void avi_update_snap(d3d_surface *surface);
void render_snapshot(d3d_surface *surface);
void record_texture();
- void init_fsfx_quad(void *vertbuf);
+ void init_fsfx_quad(void *vertbuf);
void set_texture(d3d_texture_info *texture);
d3d_render_target * find_render_target(d3d_texture_info *info);
@@ -165,11 +165,11 @@ public:
slider_state *init_slider_list();
private:
- void blit(d3d_surface *dst, d3d_texture *src, d3d_surface *new_dst,
- D3DPRIMITIVETYPE prim_type, UINT32 prim_index, UINT32 prim_count,
- int dstw, int dsth);
- void blit(d3d_surface *dst, d3d_texture *src, d3d_surface *new_dst,
- D3DPRIMITIVETYPE prim_type, UINT32 prim_index, UINT32 prim_count);
+ void blit(d3d_surface *dst, d3d_texture *src, d3d_surface *new_dst,
+ D3DPRIMITIVETYPE prim_type, UINT32 prim_index, UINT32 prim_count,
+ int dstw, int dsth);
+ void blit(d3d_surface *dst, d3d_texture *src, d3d_surface *new_dst,
+ D3DPRIMITIVETYPE prim_type, UINT32 prim_index, UINT32 prim_count);
void enumerate_screens();
void end_avi_recording();
@@ -201,9 +201,9 @@ private:
bitmap_argb32 shadow_bitmap; // shadow mask bitmap for post-processing shader
d3d_texture_info * shadow_texture; // shadow mask texture for post-processing shader
hlsl_options * options; // current uniform state
- D3DPRIMITIVETYPE vecbuf_type;
- UINT32 vecbuf_index;
- UINT32 vecbuf_count;
+ D3DPRIMITIVETYPE vecbuf_type;
+ UINT32 vecbuf_index;
+ UINT32 vecbuf_count;
avi_file * avi_output_file; // AVI file
bitmap_rgb32 avi_snap; // AVI snapshot
@@ -215,8 +215,8 @@ private:
d3d_surface * avi_final_target; // AVI upscaled surface
d3d_texture * avi_final_texture; // AVI upscaled texture
- d3d_surface * black_surface; // black dummy surface
- d3d_texture * black_texture; // black dummy texture
+ d3d_surface * black_surface; // black dummy surface
+ d3d_texture * black_texture; // black dummy texture
bool render_snap; // whether or not to take HLSL post-render snapshot
bool snap_rendered; // whether we just rendered our HLSL post-render shot or not
@@ -228,7 +228,7 @@ private:
int snap_height; // snapshot height
bool lines_pending; // whether or not we have lines to flush on the next quad
- bool initialized; // whether or not we're initialize
+ bool initialized; // whether or not we're initialize
// HLSL effects
d3d_surface * backbuffer; // pointer to our device's backbuffer
@@ -244,8 +244,8 @@ private:
d3d_effect * yiq_encode_effect; // pointer to the YIQ encoder effect object
d3d_effect * yiq_decode_effect; // pointer to the YIQ decoder effect object
#if HLSL_VECTOR
- d3d_effect * bloom_effect; // pointer to the bloom composite effect
- d3d_effect * downsample_effect; // pointer to the bloom downsample effect
+ d3d_effect * bloom_effect; // pointer to the bloom composite effect
+ d3d_effect * downsample_effect; // pointer to the bloom downsample effect
d3d_effect * vector_effect; // pointer to the vector-effect object
#endif
d3d_vertex * fsfx_vertices; // pointer to our full-screen-quad object
diff --git a/src/osd/windows/drawd3d.c b/src/osd/windows/drawd3d.c
index c103c67eca7..d87dc5fd2c0 100644
--- a/src/osd/windows/drawd3d.c
+++ b/src/osd/windows/drawd3d.c
@@ -625,46 +625,46 @@ mtlog_add("drawd3d_window_draw: begin_scene");
d3d->lockedbuf = NULL;
- // loop over primitives
- if(d3d->hlsl->enabled())
- {
- d3d->hlsl_buf = (void*)primitive_alloc(d3d, 6);
- d3d->hlsl->init_fsfx_quad(d3d->hlsl_buf);
- }
+ // loop over primitives
+ if(d3d->hlsl->enabled())
+ {
+ d3d->hlsl_buf = (void*)primitive_alloc(d3d, 6);
+ d3d->hlsl->init_fsfx_quad(d3d->hlsl_buf);
+ }
mtlog_add("drawd3d_window_draw: count lines");
- int line_count = 0;
- for (prim = window->primlist->first(); prim != NULL; prim = prim->next())
- if (prim->type == render_primitive::LINE && PRIMFLAG_GET_VECTOR(prim->flags))
- line_count++;
+ int line_count = 0;
+ for (prim = window->primlist->first(); prim != NULL; prim = prim->next())
+ if (prim->type == render_primitive::LINE && PRIMFLAG_GET_VECTOR(prim->flags))
+ line_count++;
mtlog_add("drawd3d_window_draw: primitive loop begin");
- // Rotating index for vector time offsets
- static int start_index = 0;
- int line_index = 0;
- windows_options &options = downcast<windows_options &>(window->machine().options());
- float period = options.screen_vector_time_period();
+ // Rotating index for vector time offsets
+ static int start_index = 0;
+ int line_index = 0;
+ windows_options &options = downcast<windows_options &>(window->machine().options());
+ float period = options.screen_vector_time_period();
for (prim = window->primlist->first(); prim != NULL; prim = prim->next())
- {
+ {
switch (prim->type)
{
case render_primitive::LINE:
- if (PRIMFLAG_GET_VECTOR(prim->flags))
- {
- if (period == 0.0f || line_count == 0)
- {
- draw_line(d3d, prim, 1.0f);
- }
- else
- {
- draw_line(d3d, prim, (float)(start_index + line_index) / ((float)line_count * period));
- line_index++;
- }
- }
- else
- {
- draw_line(d3d, prim, 0.0f);
- }
+ if (PRIMFLAG_GET_VECTOR(prim->flags))
+ {
+ if (period == 0.0f || line_count == 0)
+ {
+ draw_line(d3d, prim, 1.0f);
+ }
+ else
+ {
+ draw_line(d3d, prim, (float)(start_index + line_index) / ((float)line_count * period));
+ line_index++;
+ }
+ }
+ else
+ {
+ draw_line(d3d, prim, 0.0f);
+ }
break;
case render_primitive::QUAD:
@@ -674,12 +674,12 @@ mtlog_add("drawd3d_window_draw: primitive loop begin");
default:
throw emu_fatalerror("Unexpected render_primitive type");
}
- }
- start_index += (int)((float)line_index * period);
- if (line_count > 0)
- {
- start_index %= line_count;
- }
+ }
+ start_index += (int)((float)line_index * period);
+ if (line_count > 0)
+ {
+ start_index %= line_count;
+ }
mtlog_add("drawd3d_window_draw: primitive loop end");
window->primlist->release_lock();
@@ -1580,22 +1580,22 @@ static void draw_line(d3d_info *d3d, const render_primitive *prim, float line_ti
poly->flags = prim->flags;
poly->modmode = D3DTOP_MODULATE;
poly->texture = d3d->vector_texture;
- poly->line_time = line_time;
- poly->line_length = 1.0f;
- if (PRIMFLAG_GET_VECTOR(poly->flags))
- {
- float dx = fabs(prim->bounds.x1 - prim->bounds.x0);
- float dy = fabs(prim->bounds.y1 - prim->bounds.y0);
- float length2 = dx * dx + dy * dy;
- if (length2 > 0.0f)
- {
- poly->line_length = sqrt(length2);
- }
- else
- {
- // use default length of 1.0f from above
- }
- }
+ poly->line_time = line_time;
+ poly->line_length = 1.0f;
+ if (PRIMFLAG_GET_VECTOR(poly->flags))
+ {
+ float dx = fabs(prim->bounds.x1 - prim->bounds.x0);
+ float dy = fabs(prim->bounds.y1 - prim->bounds.y0);
+ float length2 = dx * dx + dy * dy;
+ if (length2 > 0.0f)
+ {
+ poly->line_length = sqrt(length2);
+ }
+ else
+ {
+ // use default length of 1.0f from above
+ }
+ }
}
}
@@ -1690,7 +1690,7 @@ static void draw_quad(d3d_info *d3d, const render_primitive *prim)
poly->flags = prim->flags;
poly->modmode = modmode;
poly->texture = texture;
- //poly->
+ //poly->
}
@@ -1759,14 +1759,14 @@ static void primitive_flush_pending(d3d_info *d3d)
d3d->hlsl->begin_draw();
- if (d3d->hlsl->enabled())
- {
- vertnum = 6;
- }
- else
- {
- vertnum = 0;
- }
+ if (d3d->hlsl->enabled())
+ {
+ vertnum = 6;
+ }
+ else
+ {
+ vertnum = 0;
+ }
// now do the polys
for (polynum = 0; polynum < d3d->numpolys; polynum++)
@@ -2718,19 +2718,19 @@ static void texture_update(d3d_info *d3d, const render_primitive *prim)
d3d_cache_target::~d3d_cache_target()
{
- for (int index = 0; index < 11; index++)
- {
- if (bloom_texture[index] != NULL)
- {
- (*d3dintf->texture.release)(bloom_texture[index]);
- bloom_texture[index] = NULL;
- }
- if (bloom_target[index] != NULL)
- {
- (*d3dintf->surface.release)(bloom_target[index]);
- bloom_target[index] = NULL;
- }
- }
+ for (int index = 0; index < 11; index++)
+ {
+ if (bloom_texture[index] != NULL)
+ {
+ (*d3dintf->texture.release)(bloom_texture[index]);
+ bloom_texture[index] = NULL;
+ }
+ if (bloom_target[index] != NULL)
+ {
+ (*d3dintf->surface.release)(bloom_target[index]);
+ bloom_target[index] = NULL;
+ }
+ }
if (last_texture != NULL)
{
@@ -2751,33 +2751,33 @@ d3d_cache_target::~d3d_cache_target()
bool d3d_cache_target::init(d3d_info *d3d, d3d_base *d3dintf, int width, int height, int prescale_x, int prescale_y, bool bloom)
{
- if (bloom)
- {
- int bloom_size = (width * prescale_x < height * prescale_y) ? width * prescale_x : height * prescale_y;
- int bloom_index = 0;
- int bloom_width = width * prescale_x;
- int bloom_height = height * prescale_y;
- for (; bloom_size >= 2 && bloom_index < 11; bloom_size >>= 1)
- {
- bloom_width >>= 1;
- bloom_height >>= 1;
- HRESULT result = (*d3dintf->device.create_texture)(d3d->device, bloom_width, bloom_height, 1, D3DUSAGE_RENDERTARGET, D3DFMT_A8R8G8B8, D3DPOOL_DEFAULT, &bloom_texture[bloom_index]);
- if (result != D3D_OK)
- {
- return false;
- }
- (*d3dintf->texture.get_surface_level)(bloom_texture[bloom_index], 0, &bloom_target[bloom_index]);
- bloom_index++;
- }
- }
+ if (bloom)
+ {
+ int bloom_size = (width * prescale_x < height * prescale_y) ? width * prescale_x : height * prescale_y;
+ int bloom_index = 0;
+ int bloom_width = width * prescale_x;
+ int bloom_height = height * prescale_y;
+ for (; bloom_size >= 2 && bloom_index < 11; bloom_size >>= 1)
+ {
+ bloom_width >>= 1;
+ bloom_height >>= 1;
+ HRESULT result = (*d3dintf->device.create_texture)(d3d->device, bloom_width, bloom_height, 1, D3DUSAGE_RENDERTARGET, D3DFMT_A8R8G8B8, D3DPOOL_DEFAULT, &bloom_texture[bloom_index]);
+ if (result != D3D_OK)
+ {
+ return false;
+ }
+ (*d3dintf->texture.get_surface_level)(bloom_texture[bloom_index], 0, &bloom_target[bloom_index]);
+ bloom_index++;
+ }
+ }
HRESULT result = (*d3dintf->device.create_texture)(d3d->device, width * prescale_x, height * prescale_y, 1, D3DUSAGE_RENDERTARGET, D3DFMT_A8R8G8B8, D3DPOOL_DEFAULT, &last_texture);
if (result != D3D_OK)
return false;
(*d3dintf->texture.get_surface_level)(last_texture, 0, &last_target);
- target_width = width * prescale_x;
- target_height = height * prescale_y;
+ target_width = width * prescale_x;
+ target_height = height * prescale_y;
return true;
}
@@ -2788,19 +2788,19 @@ bool d3d_cache_target::init(d3d_info *d3d, d3d_base *d3dintf, int width, int hei
d3d_render_target::~d3d_render_target()
{
- for (int index = 0; index < 11; index++)
- {
- if (bloom_texture[index] != NULL)
- {
- (*d3dintf->texture.release)(bloom_texture[index]);
- bloom_texture[index] = NULL;
- }
- if (bloom_target[index] != NULL)
- {
- (*d3dintf->surface.release)(bloom_target[index]);
- bloom_target[index] = NULL;
- }
- }
+ for (int index = 0; index < 11; index++)
+ {
+ if (bloom_texture[index] != NULL)
+ {
+ (*d3dintf->texture.release)(bloom_texture[index]);
+ bloom_texture[index] = NULL;
+ }
+ if (bloom_target[index] != NULL)
+ {
+ (*d3dintf->surface.release)(bloom_target[index]);
+ bloom_target[index] = NULL;
+ }
+ }
for (int index = 0; index < 5; index++)
{
@@ -2885,29 +2885,29 @@ bool d3d_render_target::init(d3d_info *d3d, d3d_base *d3dintf, int width, int he
return false;
(*d3dintf->texture.get_surface_level)(prescaletexture, 0, &prescaletarget);
- for (int index = 0; index < 11; index++)
- {
- bloom_texture[index] = NULL;
- bloom_target[index] = NULL;
- }
+ for (int index = 0; index < 11; index++)
+ {
+ bloom_texture[index] = NULL;
+ bloom_target[index] = NULL;
+ }
}
else
- {
- int bloom_size = (width < height) ? width : height;
- int bloom_index = 0;
- int bloom_width = width;
- int bloom_height = height;
- for (; bloom_size >= 2 && bloom_index < 11; bloom_size >>= 1)
- {
- bloom_width >>= 1;
- bloom_height >>= 1;
- result = (*d3dintf->device.create_texture)(d3d->device, bloom_width, bloom_height, 1, D3DUSAGE_RENDERTARGET, D3DFMT_A8R8G8B8, D3DPOOL_DEFAULT, &bloom_texture[bloom_index]);
- if (result != D3D_OK)
- return false;
- (*d3dintf->texture.get_surface_level)(bloom_texture[bloom_index], 0, &bloom_target[bloom_index]);
- bloom_index++;
- }
- }
+ {
+ int bloom_size = (width < height) ? width : height;
+ int bloom_index = 0;
+ int bloom_width = width;
+ int bloom_height = height;
+ for (; bloom_size >= 2 && bloom_index < 11; bloom_size >>= 1)
+ {
+ bloom_width >>= 1;
+ bloom_height >>= 1;
+ result = (*d3dintf->device.create_texture)(d3d->device, bloom_width, bloom_height, 1, D3DUSAGE_RENDERTARGET, D3DFMT_A8R8G8B8, D3DPOOL_DEFAULT, &bloom_texture[bloom_index]);
+ if (result != D3D_OK)
+ return false;
+ (*d3dintf->texture.get_surface_level)(bloom_texture[bloom_index], 0, &bloom_target[bloom_index]);
+ bloom_index++;
+ }
+ }
target_width = width * prescale_x;
target_height = height * prescale_y;
diff --git a/src/osd/windows/drawd3d.h b/src/osd/windows/drawd3d.h
index 7cca9fee099..a4e3ef40c19 100644
--- a/src/osd/windows/drawd3d.h
+++ b/src/osd/windows/drawd3d.h
@@ -72,8 +72,8 @@ public:
d3d_surface *last_target;
d3d_texture *last_texture;
- int target_width;
- int target_height;
+ int target_width;
+ int target_height;
int width;
int height;
@@ -83,8 +83,8 @@ public:
d3d_cache_target *next;
d3d_cache_target *prev;
- d3d_surface *bloom_target[11];
- d3d_texture *bloom_texture[11];
+ d3d_surface *bloom_target[11];
+ d3d_texture *bloom_texture[11];
};
/* d3d_render_target is the information about a Direct3D render target chain */
@@ -116,8 +116,8 @@ public:
d3d_render_target *next;
d3d_render_target *prev;
- d3d_surface *bloom_target[11];
- d3d_texture *bloom_texture[11];
+ d3d_surface *bloom_target[11];
+ d3d_texture *bloom_texture[11];
};
/* d3d_info is the information about Direct3D for the current screen */
@@ -143,7 +143,7 @@ struct d3d_info
d3d_poly_info poly[VERTEX_BUFFER_SIZE/3]; // array to hold polygons as they are created
int numpolys; // number of accumulated polygons
- bool restarting; // if we're restarting
+ bool restarting; // if we're restarting
d3d_texture_info * texlist; // list of active textures
int dynamic_supported; // are dynamic textures supported?
diff --git a/src/osd/windows/winmain.c b/src/osd/windows/winmain.c
index 58e0232ca07..902290fa687 100644
--- a/src/osd/windows/winmain.c
+++ b/src/osd/windows/winmain.c
@@ -375,7 +375,7 @@ const options_entry windows_options::s_option_entries[] =
{ WINOPTION_FLOOR";fs_floor", "0.0,0.0,0.0",OPTION_STRING, "signal floor level" },
{ WINOPTION_PHOSPHOR";fs_phosphor", "0.0,0.0,0.0",OPTION_STRING, "phosphorescence decay rate (0.0 is instant, 1.0 is forever)" },
/* NTSC simulation below this line */
- { NULL, NULL, OPTION_HEADER, "NTSC POST-PROCESSING OPTIONS" },
+ { NULL, NULL, OPTION_HEADER, "NTSC POST-PROCESSING OPTIONS" },
{ WINOPTION_YIQ_ENABLE";yiq", "0", OPTION_BOOLEAN, "enable YIQ-space HLSL post-processing" },
{ WINOPTION_YIQ_CCVALUE";yiqcc", "3.59754545",OPTION_FLOAT, "Color Carrier frequency for NTSC signal processing" },
{ WINOPTION_YIQ_AVALUE";yiqa", "0.5", OPTION_FLOAT, "A value for NTSC signal processing" },
@@ -388,14 +388,14 @@ const options_entry windows_options::s_option_entries[] =
{ WINOPTION_YIQ_QVALUE";yiqq", "0.6", OPTION_FLOAT, "Q filter cutoff frequency for NTSC signal processing" },
{ WINOPTION_YIQ_SCAN_TIME";yiqsc", "52.6", OPTION_FLOAT, "Horizontal scanline duration for NTSC signal processing (in usec)" },
{ WINOPTION_YIQ_PHASE_COUNT";yiqp", "2", OPTION_INTEGER, "Phase Count value for NTSC signal processing" },
- { WINOPTION_YIQ_SCAN_TIME";yiqsc", "52.6", OPTION_FLOAT, "Horizontal scanline duration for NTSC signal processing (in usec)" },
- { WINOPTION_YIQ_PHASE_COUNT";yiqp", "2", OPTION_INTEGER, "Phase Count value for NTSC signal processing" },
- /* Vector simulation below this line */
- { NULL, NULL, OPTION_HEADER, "VECTOR POST-PROCESSING OPTIONS" },
- { WINOPTION_VECTOR_TIME_SCALE";vectime", "0.0", OPTION_FLOAT, "How much the fade rate affects vector fade" },
- { WINOPTION_VECTOR_TIME_PERIOD";vecperiod", "0.1", OPTION_FLOAT, "Vector fade rate versus screen refresh rate" },
- { WINOPTION_VECTOR_LENGTH_SCALE";veclength", "0.9", OPTION_FLOAT, "How much length affects vector fade" },
- { WINOPTION_VECTOR_LENGTH_RATIO";vecsize", "4.0", OPTION_FLOAT, "Vector fade length (4.0 - vectors fade the most at and above 4 pixels, etc.)" },
+ { WINOPTION_YIQ_SCAN_TIME";yiqsc", "52.6", OPTION_FLOAT, "Horizontal scanline duration for NTSC signal processing (in usec)" },
+ { WINOPTION_YIQ_PHASE_COUNT";yiqp", "2", OPTION_INTEGER, "Phase Count value for NTSC signal processing" },
+ /* Vector simulation below this line */
+ { NULL, NULL, OPTION_HEADER, "VECTOR POST-PROCESSING OPTIONS" },
+ { WINOPTION_VECTOR_TIME_SCALE";vectime", "0.0", OPTION_FLOAT, "How much the fade rate affects vector fade" },
+ { WINOPTION_VECTOR_TIME_PERIOD";vecperiod", "0.1", OPTION_FLOAT, "Vector fade rate versus screen refresh rate" },
+ { WINOPTION_VECTOR_LENGTH_SCALE";veclength", "0.9", OPTION_FLOAT, "How much length affects vector fade" },
+ { WINOPTION_VECTOR_LENGTH_RATIO";vecsize", "4.0", OPTION_FLOAT, "Vector fade length (4.0 - vectors fade the most at and above 4 pixels, etc.)" },
// per-window options
{ NULL, NULL, OPTION_HEADER, "PER-WINDOW VIDEO OPTIONS" },
diff --git a/src/osd/windows/winmain.h b/src/osd/windows/winmain.h
index 167ca9ec476..eb3b234643e 100644
--- a/src/osd/windows/winmain.h
+++ b/src/osd/windows/winmain.h
@@ -1,4 +1,4 @@
- //============================================================
+ //============================================================
//
// winmain.h - Win32 main program and core headers
//
@@ -243,10 +243,10 @@ public:
float screen_yiq_q() const { return float_value(WINOPTION_YIQ_QVALUE); }
float screen_yiq_scan_time() const { return float_value(WINOPTION_YIQ_SCAN_TIME); }
int screen_yiq_phase_count() const { return int_value(WINOPTION_YIQ_PHASE_COUNT); }
- float screen_vector_time_scale() const { return float_value(WINOPTION_VECTOR_TIME_SCALE); }
- float screen_vector_time_period() const { return float_value(WINOPTION_VECTOR_TIME_PERIOD); }
- float screen_vector_length_scale() const { return float_value(WINOPTION_VECTOR_LENGTH_SCALE); }
- float screen_vector_length_ratio() const { return float_value(WINOPTION_VECTOR_LENGTH_RATIO); }
+ float screen_vector_time_scale() const { return float_value(WINOPTION_VECTOR_TIME_SCALE); }
+ float screen_vector_time_period() const { return float_value(WINOPTION_VECTOR_TIME_PERIOD); }
+ float screen_vector_length_scale() const { return float_value(WINOPTION_VECTOR_LENGTH_SCALE); }
+ float screen_vector_length_ratio() const { return float_value(WINOPTION_VECTOR_LENGTH_RATIO); }
const char *screen_offset() const { return value(WINOPTION_OFFSET); }
const char *screen_scale() const { return value(WINOPTION_SCALE); }
const char *screen_power() const { return value(WINOPTION_POWER); }
diff --git a/src/osd/windows/winsocket.c b/src/osd/windows/winsocket.c
index d5ebaafc2d4..90eeeb26e9a 100644
--- a/src/osd/windows/winsocket.c
+++ b/src/osd/windows/winsocket.c
@@ -43,7 +43,7 @@ bool win_init_sockets()
/* check for correct version */
if ( LOBYTE( wsaData.wVersion ) != 2 ||
- HIBYTE( wsaData.wVersion ) != 0 )
+ HIBYTE( wsaData.wVersion ) != 0 )
{
/* incorrect WinSock version */
WSACleanup();
@@ -95,25 +95,25 @@ file_error win_open_socket(const char *path, UINT32 openflags, osd_file **file,
// listening socket support
if (openflags & OPEN_FLAG_CREATE)
{
-// printf("Listening for client at '%s' on port '%d'\n", hostname, port);
+// printf("Listening for client at '%s' on port '%d'\n", hostname, port);
// bind socket...
if (bind((*file)->socket, (struct sockaddr *)&sai, sizeof(struct sockaddr)) == -1)
{
return FILERR_ACCESS_DENIED;
}
-
+
// start to listen...
if (listen((*file)->socket, 1) == -1) {
return FILERR_ACCESS_DENIED;
}
-
+
// mark socket as "listening"
(*file)->handle = 0;
*filesize = 0;
return FILERR_NONE;
}
-
-// printf("Connecting to server '%s' on port '%d'\n", hostname, port);
+
+// printf("Connecting to server '%s' on port '%d'\n", hostname, port);
if (connect((*file)->socket, (struct sockaddr *)&sai, sizeof(struct sockaddr)) == -1)
{
return FILERR_ACCESS_DENIED;