gnash-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gnash-dev] [PATCH 2/2] Work around rendering problem in GemCraft Chapte


From: Jürgen Rühle
Subject: [Gnash-dev] [PATCH 2/2] Work around rendering problem in GemCraft Chapter One
Date: Wed, 16 Jan 2013 22:37:24 +0100

Currently the tower defense game GemCraft Chapter One from
gameinabottle.com/games/gemcraft1.swf doesn't draw the play map correctly,
making the game unplayable.

It turns out that the problem is clipping: the clipping check thinks that the
MovieClip is completely outside the update area and therefore isn't drawn at
all. This happens because the clipping check uses the MovieClip's world
Matrix that is potentially (and in this case actually) different from the
transform used while drawing the MovieClip into the bitmap.

This patch works around the problem by temporarily resetting the MovieClip's
Matrix during the draw operation.

This fixes the problem in GemCraft Chapter One and actually makes the game
playable (though some minor problems remain).

A real fix should probably review the usage of a different transformation
for the clipping check compared to the actual drawing operation.
---
 libcore/asobj/flash/display/BitmapData_as.cpp |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/libcore/asobj/flash/display/BitmapData_as.cpp 
b/libcore/asobj/flash/display/BitmapData_as.cpp
index 4d36794..a9cfb4f 100644
--- a/libcore/asobj/flash/display/BitmapData_as.cpp
+++ b/libcore/asobj/flash/display/BitmapData_as.cpp
@@ -1107,7 +1107,11 @@ bitmapdata_draw(const fn_call& fn)
     fillRect(*ptr, t.matrix.tx() / 20, t.matrix.ty() / 20, (int) 
(t.matrix.get_x_scale() * 25), (int) (t.matrix.get_y_scale() * 25), 0x80000000 
| (color << 19) | (color << 12) | (color << 3));
 #endif
 
+    SWFMatrix oldM = mc->transform().matrix;
+    mc->setMatrix(t.matrix, true);
     ptr->draw(*mc, t);
+    mc->setMatrix(oldM, true);
+
     return as_value();
 }
 
-- 
1.7.4.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]