summaryrefslogtreecommitdiffstatshomepage
path: root/src/osd/windows/drawd3d.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/osd/windows/drawd3d.c')
-rw-r--r--src/osd/windows/drawd3d.c262
1 files changed, 131 insertions, 131 deletions
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;