summaryrefslogtreecommitdiffstats
path: root/docs/release/src/osd/modules/render/drawd3d.cpp
diff options
context:
space:
mode:
author Robbbert <Robbbert@users.noreply.github.com>2020-03-26 12:54:28 +1100
committer Robbbert <Robbbert@users.noreply.github.com>2020-03-26 12:54:28 +1100
commit75e0ed7918a4656755a08bdb7025af579615e033 (patch)
tree7e5061afb9d701862e2f27369a4019e8cd5fdb13 /docs/release/src/osd/modules/render/drawd3d.cpp
parent053c04ffc930159c538bcd77dd3255c74cdd2951 (diff)
0.220 Release filestag220
Diffstat (limited to 'docs/release/src/osd/modules/render/drawd3d.cpp')
-rw-r--r--docs/release/src/osd/modules/render/drawd3d.cpp44
1 files changed, 24 insertions, 20 deletions
diff --git a/docs/release/src/osd/modules/render/drawd3d.cpp b/docs/release/src/osd/modules/render/drawd3d.cpp
index db81be19d17..dfc774b4ed1 100644
--- a/docs/release/src/osd/modules/render/drawd3d.cpp
+++ b/docs/release/src/osd/modules/render/drawd3d.cpp
@@ -489,9 +489,9 @@ texture_info *d3d_texture_manager::find_texinfo(const render_texinfo *texinfo, u
// find a match
for (auto it = m_texture_list.begin(); it != m_texture_list.end(); it++)
{
- uint32_t test_screen = (uint32_t)((*it)->get_texinfo().unique_id >> 57);
+ auto test_screen = (uint32_t)((*it)->get_texinfo().unique_id >> 57);
uint32_t test_page = (uint32_t)((*it)->get_texinfo().unique_id >> 56) & 1;
- uint32_t prim_screen = (uint32_t)(texinfo->unique_id >> 57);
+ auto prim_screen = (uint32_t)(texinfo->unique_id >> 57);
uint32_t prim_page = (uint32_t)(texinfo->unique_id >> 56) & 1;
if (test_screen != prim_screen || test_page != prim_page)
continue;
@@ -778,7 +778,7 @@ void renderer_d3d9::update_gamma_ramp()
if (win->fullscreen())
{
// only set the gamma if it's not 1.0
- windows_options &options = downcast<windows_options &>(win->machine().options());
+ auto &options = downcast<windows_options &>(win->machine().options());
float brightness = options.full_screen_brightness();
float contrast = options.full_screen_contrast();
float gamma = options.full_screen_gamma();
@@ -801,8 +801,12 @@ void renderer_d3d9::update_gamma_ramp()
// device_create
//============================================================
-int renderer_d3d9::device_create(HWND device_hwnd)
+int renderer_d3d9::device_create(HWND hwnd)
{
+ // identify the actual window; this is needed so that -attach_window
+ // can work on a non-root HWND
+ HWND device_hwnd = GetAncestor(hwnd, GA_ROOT);
+
// if a device exists, free it
if (m_device != nullptr)
{
@@ -1481,8 +1485,8 @@ void renderer_d3d9::batch_vectors(int vector_count)
((rotation_0 || rotation_90) && orientation_swap_xy) ||
((rotation_180 || rotation_90) && !orientation_swap_xy);
- float screen_width = float(this->get_width());
- float screen_height = float(this->get_height());
+ auto screen_width = float(this->get_width());
+ auto screen_height = float(this->get_height());
float half_screen_width = screen_width * 0.5f;
float half_screen_height = screen_height * 0.5f;
float screen_swap_x_factor = 1.0f / screen_width * screen_height;
@@ -1611,10 +1615,10 @@ void renderer_d3d9::batch_vector(const render_primitive &prim)
}
// determine the color of the line
- int32_t r = (int32_t)(prim.color.r * 255.0f);
- int32_t g = (int32_t)(prim.color.g * 255.0f);
- int32_t b = (int32_t)(prim.color.b * 255.0f);
- int32_t a = (int32_t)(prim.color.a * 255.0f);
+ auto r = (int32_t)(prim.color.r * 255.0f);
+ auto g = (int32_t)(prim.color.g * 255.0f);
+ auto b = (int32_t)(prim.color.b * 255.0f);
+ auto a = (int32_t)(prim.color.a * 255.0f);
DWORD color = D3DCOLOR_ARGB(a, r, g, b);
// set the color, Z parameters to standard values
@@ -1681,10 +1685,10 @@ void renderer_d3d9::draw_line(const render_primitive &prim)
vertex[3].v0 = stop.c.y;
// determine the color of the line
- int32_t r = (int32_t)(prim.color.r * 255.0f);
- int32_t g = (int32_t)(prim.color.g * 255.0f);
- int32_t b = (int32_t)(prim.color.b * 255.0f);
- int32_t a = (int32_t)(prim.color.a * 255.0f);
+ auto r = (int32_t)(prim.color.r * 255.0f);
+ auto g = (int32_t)(prim.color.g * 255.0f);
+ auto b = (int32_t)(prim.color.b * 255.0f);
+ auto a = (int32_t)(prim.color.a * 255.0f);
DWORD color = D3DCOLOR_ARGB(a, r, g, b);
// set the color, Z parameters to standard values
@@ -1750,10 +1754,10 @@ void renderer_d3d9::draw_quad(const render_primitive &prim)
}
// determine the color, allowing for over modulation
- int32_t r = (int32_t)(prim.color.r * 255.0f);
- int32_t g = (int32_t)(prim.color.g * 255.0f);
- int32_t b = (int32_t)(prim.color.b * 255.0f);
- int32_t a = (int32_t)(prim.color.a * 255.0f);
+ auto r = (int32_t)(prim.color.r * 255.0f);
+ auto g = (int32_t)(prim.color.g * 255.0f);
+ auto b = (int32_t)(prim.color.b * 255.0f);
+ auto a = (int32_t)(prim.color.a * 255.0f);
DWORD color = D3DCOLOR_ARGB(a, r, g, b);
// adjust half pixel X/Y offset, set the color, Z parameters to standard values
@@ -2703,8 +2707,8 @@ bool d3d_render_target::init(renderer_d3d9 *d3d, int source_width, int source_he
float scale_factor = 0.75f;
int scale_count = vector_screen ? MAX_BLOOM_COUNT : HALF_BLOOM_COUNT;
- float bloom_width = (float)source_width;
- float bloom_height = (float)source_height;
+ auto bloom_width = (float)source_width;
+ auto bloom_height = (float)source_height;
float bloom_size = bloom_width < bloom_height ? bloom_width : bloom_height;
for (int bloom_index = 0; bloom_index < scale_count && bloom_size >= 2.0f; bloom_size *= scale_factor)
{