summaryrefslogtreecommitdiffstatshomepage
path: root/src/osd/modules
diff options
context:
space:
mode:
author ImJezze <jezze@gmx.net>2016-02-07 13:40:24 +0100
committer ImJezze <jezze@gmx.net>2016-02-07 13:40:24 +0100
commitd15d53c728b4848e3ed74d66b9ab446811e1acee (patch)
tree5346f7ff12c1925073ef3b4b830e7b9df87523a5 /src/osd/modules
parentf5e3032d98257ceaa7800251139f3c6df98f13e8 (diff)
Fixed Bloom Level Alignment
- fixed target dimensions of bloom levels, which results in a much better alignment especially for game with very low resolution (therefore current bloom settings might look a little less intense than before) - small cleanups (nw)
Diffstat (limited to 'src/osd/modules')
-rw-r--r--src/osd/modules/render/d3d/d3dhlsl.cpp12
-rw-r--r--src/osd/modules/render/drawd3d.h4
2 files changed, 10 insertions, 6 deletions
diff --git a/src/osd/modules/render/d3d/d3dhlsl.cpp b/src/osd/modules/render/d3d/d3dhlsl.cpp
index 9374233569a..6b70952889b 100644
--- a/src/osd/modules/render/d3d/d3dhlsl.cpp
+++ b/src/osd/modules/render/d3d/d3dhlsl.cpp
@@ -1464,8 +1464,8 @@ int shaders::downsample_pass(render_target *rt, int source_index, poly_info *pol
int bloom_index = 0;
float bloom_size = (d3d->get_width() < d3d->get_height()) ? d3d->get_width() : d3d->get_height();
- float bloom_width = prepare_vector ? rt->target_width : rt->target_width / hlsl_prescale_x;
- float bloom_height = prepare_vector ? rt->target_height : rt->target_height / hlsl_prescale_y;
+ float bloom_width = d3d->get_width();
+ float bloom_height = d3d->get_height();
for (; bloom_size >= 2.0f && bloom_index < 11; bloom_size *= 0.5f)
{
bloom_dims[bloom_index][0] = (float)(int)bloom_width;
@@ -2013,7 +2013,7 @@ bool shaders::register_texture(texture_info *texture)
enumerate_screens();
// Find the nearest prescale factor that is over our screen size
- if (hlsl_prescale_x == 0)
+ if (hlsl_prescale_x < 1)
{
hlsl_prescale_x = 1;
while (width * xscale * hlsl_prescale_x <= d3d->get_width())
@@ -2023,7 +2023,7 @@ bool shaders::register_texture(texture_info *texture)
hlsl_prescale_x--;
}
- if (hlsl_prescale_y == 0)
+ if (hlsl_prescale_y < 1)
{
hlsl_prescale_y = 1;
while (height * yscale * hlsl_prescale_y <= d3d->get_height())
@@ -2033,8 +2033,8 @@ bool shaders::register_texture(texture_info *texture)
hlsl_prescale_y--;
}
- hlsl_prescale_x = ((hlsl_prescale_x == 0) ? 1 : hlsl_prescale_x);
- hlsl_prescale_y = ((hlsl_prescale_y == 0) ? 1 : hlsl_prescale_y);
+ hlsl_prescale_x = hlsl_prescale_x < 1 ? 1 : hlsl_prescale_x;
+ hlsl_prescale_y = hlsl_prescale_y < 1 ? 1 : hlsl_prescale_y;
if (!add_render_target(d3d, texture, width, height, xscale * hlsl_prescale_x, yscale * hlsl_prescale_y))
{
diff --git a/src/osd/modules/render/drawd3d.h b/src/osd/modules/render/drawd3d.h
index 906bd7711b8..b5672be91ee 100644
--- a/src/osd/modules/render/drawd3d.h
+++ b/src/osd/modules/render/drawd3d.h
@@ -43,9 +43,11 @@ public:
surface *last_target;
texture *last_texture;
+ // real target dimension
int target_width;
int target_height;
+ // only used to identify/find the render target
int width;
int height;
@@ -66,12 +68,14 @@ public:
bool init(renderer *d3d, base *d3dintf, int width, int height, int prescale_x, int prescale_y);
int next_index(int index) { return ++index > 1 ? 0 : index; }
+ // real target dimension
int target_width;
int target_height;
int prescale_x;
int prescale_y;
+ // only used to identify/find the render target
int width;
int height;