diff --git a/Makefile b/Makefile index 140a2c2b..3d5a6322 100755 --- a/Makefile +++ b/Makefile @@ -235,12 +235,9 @@ $(OBJ)/%.res: %.rc %.o: %.res cvtres /OUT:"$@" $^ -# We must provide SDL2.dll with the Windows port. This is an AWFUL HACK to find it. -SPACE := -SPACE += +# We must provide SDL2.dll with the Windows port. $(BIN)/SDL/SDL2.dll: - @$(eval POTENTIAL_MATCHES := $(subst @@@," ",$(patsubst %,%/SDL2.dll,$(subst ;,$(SPACE),$(subst $(SPACE),@@@,$(lib)))))) - @$(eval MATCH := $(shell ls $(POTENTIAL_MATCHES) 2> NUL | head -n 1)) + @$(eval MATCH := $(shell where $$LIB:SDL2.dll)) cp "$(MATCH)" $@ # Tester diff --git a/Shaders/AAOmniScaleLegacy.fsh b/Shaders/AAOmniScaleLegacy.fsh index 6f325ac1..d667edfe 100644 --- a/Shaders/AAOmniScaleLegacy.fsh +++ b/Shaders/AAOmniScaleLegacy.fsh @@ -8,10 +8,10 @@ vec4 omniScale(sampler2D image, vec2 texCoord) { vec2 pixel = texCoord * textureDimensions - vec2(0.5, 0.5); - vec4 q11 = texture(image, vec2(floor(pixel.x) / textureDimensions.x, floor(pixel.y) / textureDimensions.y)); - vec4 q12 = texture(image, vec2(floor(pixel.x) / textureDimensions.x, ceil(pixel.y) / textureDimensions.y)); - vec4 q21 = texture(image, vec2(ceil(pixel.x) / textureDimensions.x, floor(pixel.y) / textureDimensions.y)); - vec4 q22 = texture(image, vec2(ceil(pixel.x) / textureDimensions.x, ceil(pixel.y) / textureDimensions.y)); + vec4 q11 = texture(image, (floor(pixel) + 0.5) / textureDimensions); + vec4 q12 = texture(image, (vec2(floor(pixel.x), ceil(pixel.y)) + 0.5) / textureDimensions); + vec4 q21 = texture(image, (vec2(ceil(pixel.x), floor(pixel.y)) + 0.5) / textureDimensions); + vec4 q22 = texture(image, (ceil(pixel) + 0.5) / textureDimensions); vec2 pos = fract(pixel); diff --git a/Shaders/Bilinear.fsh b/Shaders/Bilinear.fsh index a519e12d..6fa5e21f 100644 --- a/Shaders/Bilinear.fsh +++ b/Shaders/Bilinear.fsh @@ -4,10 +4,10 @@ vec4 scale(sampler2D image) vec2 pixel = texCoord * textureDimensions - vec2(0.5, 0.5); - vec4 q11 = texture(image, vec2(floor(pixel.x) / textureDimensions.x, floor(pixel.y) / textureDimensions.y)); - vec4 q12 = texture(image, vec2(floor(pixel.x) / textureDimensions.x, ceil(pixel.y) / textureDimensions.y)); - vec4 q21 = texture(image, vec2(ceil(pixel.x) / textureDimensions.x, floor(pixel.y) / textureDimensions.y)); - vec4 q22 = texture(image, vec2(ceil(pixel.x) / textureDimensions.x, ceil(pixel.y) / textureDimensions.y)); + vec4 q11 = texture(image, (floor(pixel) + 0.5) / textureDimensions); + vec4 q12 = texture(image, (vec2(floor(pixel.x), ceil(pixel.y)) + 0.5) / textureDimensions); + vec4 q21 = texture(image, (vec2(ceil(pixel.x), floor(pixel.y)) + 0.5) / textureDimensions); + vec4 q22 = texture(image, (ceil(pixel) + 0.5) / textureDimensions); vec4 r1 = mix(q11, q21, fract(pixel.x)); vec4 r2 = mix(q12, q22, fract(pixel.x)); diff --git a/Shaders/OmniScaleLegacy.fsh b/Shaders/OmniScaleLegacy.fsh index cd4257d3..f4bdea9a 100644 --- a/Shaders/OmniScaleLegacy.fsh +++ b/Shaders/OmniScaleLegacy.fsh @@ -10,10 +10,10 @@ vec4 scale(sampler2D image) vec2 pixel = texCoord * textureDimensions - vec2(0.5, 0.5); - vec4 q11 = texture(image, (pixel ) / textureDimensions); - vec4 q12 = texture(image, (pixel + vec2(0.0, 1.0)) / textureDimensions); - vec4 q21 = texture(image, (pixel + vec2(1.0, 0.0)) / textureDimensions); - vec4 q22 = texture(image, (pixel + vec2(1.0, 1.0)) / textureDimensions); + vec4 q11 = texture(image, (floor(pixel) + 0.5) / textureDimensions); + vec4 q12 = texture(image, (vec2(floor(pixel.x), ceil(pixel.y)) + 0.5) / textureDimensions); + vec4 q21 = texture(image, (vec2(ceil(pixel.x), floor(pixel.y)) + 0.5) / textureDimensions); + vec4 q22 = texture(image, (ceil(pixel) + 0.5) / textureDimensions); vec2 pos = fract(pixel); diff --git a/Shaders/SmoothBilinear.fsh b/Shaders/SmoothBilinear.fsh index ab242f5d..b796d88a 100644 --- a/Shaders/SmoothBilinear.fsh +++ b/Shaders/SmoothBilinear.fsh @@ -4,15 +4,15 @@ vec4 scale(sampler2D image) vec2 pixel = texCoord * textureDimensions - vec2(0.5, 0.5); - vec4 q11 = texture(image, vec2(floor(pixel.x) / textureDimensions.x, floor(pixel.y) / textureDimensions.y)); - vec4 q12 = texture(image, vec2(floor(pixel.x) / textureDimensions.x, ceil(pixel.y) / textureDimensions.y)); - vec4 q21 = texture(image, vec2(ceil(pixel.x) / textureDimensions.x, floor(pixel.y) / textureDimensions.y)); - vec4 q22 = texture(image, vec2(ceil(pixel.x) / textureDimensions.x, ceil(pixel.y) / textureDimensions.y)); + vec4 q11 = texture(image, (floor(pixel) + 0.5) / textureDimensions); + vec4 q12 = texture(image, (vec2(floor(pixel.x), ceil(pixel.y)) + 0.5) / textureDimensions); + vec4 q21 = texture(image, (vec2(ceil(pixel.x), floor(pixel.y)) + 0.5) / textureDimensions); + vec4 q22 = texture(image, (ceil(pixel) + 0.5) / textureDimensions); vec2 s = smoothstep(0., 1., fract(pixel)); - vec4 r1 = mix(q11, q21, fract(s.x)); - vec4 r2 = mix(q12, q22, fract(s.x)); + vec4 r1 = mix(q11, q21, s.x); + vec4 r2 = mix(q12, q22, s.x); - return mix (r1, r2, fract(s.y)); + return mix (r1, r2, s.y); } \ No newline at end of file