Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWalter Bender <walter.bender@gmail.com>2012-10-29 15:16:27 (GMT)
committer Walter Bender <walter.bender@gmail.com>2012-10-29 15:16:27 (GMT)
commite154ae8fa0df49ee30178551e102d4d507dacb92 (patch)
tree26624305ef33f14656a97fb001412d37953d5a5d
parent606160a2ff1971667cc20aa63b383883563108ac (diff)
minor fixes to gtk3 port
-rw-r--r--game.py2
-rw-r--r--sprites.pycbin18232 -> 0 bytes
-rw-r--r--utils.py10
3 files changed, 11 insertions, 1 deletions
diff --git a/game.py b/game.py
index e9ddb29..aad44d1 100644
--- a/game.py
+++ b/game.py
@@ -411,7 +411,7 @@ class Game():
for i in range(6):
surface = cairo.ImageSurface(cairo.FORMAT_ARGB32, nw, nh)
context = cairo.Context(surface)
- Gdk.cairo_set_source_pixbuf(context, pixbuf, 0, 0)
+ Gdk.cairo_set_source_pixbuf(context, image, 0, 0)
context.translate(nw / 2., nh / 2.)
context.rotate((30 + i * 60) * pi / 180.)
context.translate(-nw / 2., -nh / 2.)
diff --git a/sprites.pyc b/sprites.pyc
deleted file mode 100644
index 2b46a25..0000000
--- a/sprites.pyc
+++ /dev/null
Binary files differ
diff --git a/utils.py b/utils.py
index ffab831..0f9fd16 100644
--- a/utils.py
+++ b/utils.py
@@ -10,6 +10,7 @@
# Foundation, 51 Franklin Street, Suite 500 Boston, MA 02110-1335 USA
+from gi.repository import GdkPixbuf
from StringIO import StringIO
try:
OLD_SUGAR_SYSTEM = False
@@ -51,3 +52,12 @@ def json_dump(data):
_io = StringIO()
jdump(data, _io)
return _io.getvalue()
+
+
+def svg_str_to_pixbuf(svg_string):
+ ''' Load pixbuf from SVG string '''
+ pl = GdkPixbuf.PixbufLoader.new_with_type('svg')
+ pl.write(svg_string)
+ pl.close()
+ pixbuf = pl.get_pixbuf()
+ return pixbuf