summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEmmanuel Gil Peyrot <linkmauve@linkmauve.fr>2015-05-22 01:05:34 +0200
committerEmmanuel Gil Peyrot <linkmauve@linkmauve.fr>2015-06-28 15:31:13 +0200
commit8ee814ec27b5ad8949e7e0c55ef0b6fc47bb88ad (patch)
tree1a13bdaf8c79b161fd507d3073f9bb0ffdd3448e
parentMerge pull request #886 from zawata/Warning-Fixes (diff)
downloadyuzu-8ee814ec27b5ad8949e7e0c55ef0b6fc47bb88ad.tar
yuzu-8ee814ec27b5ad8949e7e0c55ef0b6fc47bb88ad.tar.gz
yuzu-8ee814ec27b5ad8949e7e0c55ef0b6fc47bb88ad.tar.bz2
yuzu-8ee814ec27b5ad8949e7e0c55ef0b6fc47bb88ad.tar.lz
yuzu-8ee814ec27b5ad8949e7e0c55ef0b6fc47bb88ad.tar.xz
yuzu-8ee814ec27b5ad8949e7e0c55ef0b6fc47bb88ad.tar.zst
yuzu-8ee814ec27b5ad8949e7e0c55ef0b6fc47bb88ad.zip
-rw-r--r--src/core/hw/gpu.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/core/hw/gpu.cpp b/src/core/hw/gpu.cpp
index 7471def57..2bc650002 100644
--- a/src/core/hw/gpu.cpp
+++ b/src/core/hw/gpu.cpp
@@ -125,11 +125,11 @@ inline void Write(u32 addr, const T data) {
break;
}
- unsigned horizontal_scale = (config.scaling != config.NoScale) ? 2 : 1;
- unsigned vertical_scale = (config.scaling == config.ScaleXY) ? 2 : 1;
+ bool horizontal_scale = config.scaling != config.NoScale;
+ bool vertical_scale = config.scaling == config.ScaleXY;
- u32 output_width = config.output_width / horizontal_scale;
- u32 output_height = config.output_height / vertical_scale;
+ u32 output_width = config.output_width >> horizontal_scale;
+ u32 output_height = config.output_height >> vertical_scale;
u32 input_size = config.input_width * config.input_height * GPU::Regs::BytesPerPixel(config.input_format);
u32 output_size = output_width * output_height * GPU::Regs::BytesPerPixel(config.output_format);
@@ -161,8 +161,8 @@ inline void Write(u32 addr, const T data) {
// Calculate the [x,y] position of the input image
// based on the current output position and the scale
- u32 input_x = x * horizontal_scale;
- u32 input_y = y * vertical_scale;
+ u32 input_x = x << horizontal_scale;
+ u32 input_y = y << vertical_scale;
if (config.flip_vertically) {
// Flip the y value of the output data,