aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2013-10-14 10:35:53 -0700
committerAlon Zakai <alonzakai@gmail.com>2013-10-14 10:35:53 -0700
commitf450405e52d801c0e7b4ac41860a0fb717e2190e (patch)
tree3d59c2a76418ea5a4acacd4f29e5f5fbd285dba8
parentae7378a008fd3b6e9a7cd46a9a33aba3ffd61eb1 (diff)
parent6340c6d53aa6cbada8220dff9642bb6bdda1f7d3 (diff)
Merge branch 'fix-rotozoom' of github.com:fhd/emscripten into incoming
-rw-r--r--src/library_sdl.js2
-rw-r--r--tests/sdl_rotozoom.c2
-rw-r--r--tests/sdl_rotozoom.pngbin431168 -> 711242 bytes
-rw-r--r--tests/test_browser.py2
4 files changed, 3 insertions, 3 deletions
diff --git a/src/library_sdl.js b/src/library_sdl.js
index 27f2c0da..e64f117f 100644
--- a/src/library_sdl.js
+++ b/src/library_sdl.js
@@ -1122,7 +1122,7 @@ var LibrarySDL = {
var ret = SDL.makeSurface(diagonal, diagonal, srcData.flags, false, 'rotozoomSurface');
var dstData = SDL.surfaces[ret];
dstData.ctx.translate(diagonal / 2, diagonal / 2);
- dstData.ctx.rotate(angle * Math.PI / 180);
+ dstData.ctx.rotate(-angle * Math.PI / 180);
dstData.ctx.drawImage(srcData.canvas, -w / 2, -h / 2, w, h);
return ret;
},
diff --git a/tests/sdl_rotozoom.c b/tests/sdl_rotozoom.c
index cdbdcc6f..2c0d35df 100644
--- a/tests/sdl_rotozoom.c
+++ b/tests/sdl_rotozoom.c
@@ -38,7 +38,7 @@ int main(int argc, char **argv) {
sprite[2] = zoomSurface(sprite[0], 0.5, 0.5, SMOOTHING_ON);
sprite[3] = zoomSurface(sprite[1], 0.5, 0.5, SMOOTHING_ON);
sprite[4] = rotozoomSurface(sprite[0], -20, 0.3, SMOOTHING_ON);
- sprite[5] = rotozoomSurface(sprite[1], 45, 0.5, SMOOTHING_ON);
+ sprite[5] = rotozoomSurface(sprite[1], 20, 1, SMOOTHING_ON);
sprite[6] = zoomSurface(sprite[0], -0.5, 0.5, SMOOTHING_ON);
sprite[7] = zoomSurface(sprite[0], -0.5, -0.5, SMOOTHING_ON);
sprite[8] = rotozoomSurface(sprite[1], 0, 0.5, SMOOTHING_ON);
diff --git a/tests/sdl_rotozoom.png b/tests/sdl_rotozoom.png
index 5933754f..ebde79f2 100644
--- a/tests/sdl_rotozoom.png
+++ b/tests/sdl_rotozoom.png
Binary files differ
diff --git a/tests/test_browser.py b/tests/test_browser.py
index 24113511..1eba2ef5 100644
--- a/tests/test_browser.py
+++ b/tests/test_browser.py
@@ -1389,7 +1389,7 @@ keydown(100);keyup(100); // trigger the end
def test_sdl_rotozoom(self):
shutil.copyfile(path_from_root('tests', 'screenshot.png'), os.path.join(self.get_dir(), 'screenshot.png'))
- self.btest('sdl_rotozoom.c', reference='sdl_rotozoom.png', args=['--preload-file', 'screenshot.png'], reference_slack=5)
+ self.btest('sdl_rotozoom.c', reference='sdl_rotozoom.png', args=['--preload-file', 'screenshot.png'])
def test_sdl_gfx_primitives(self):
self.btest('sdl_gfx_primitives.c', reference='sdl_gfx_primitives.png', reference_slack=1)