# HG changeset patch # User phoku@33b003aa-7bff-0310-803a-e67f0ece8222 # Date 1223727953 0 # Node ID afcd83f7fac8ff239dd36f6dea2bb8fc7e831100 # Parent 6e7d228def303cb6b5dc1ba877e505137351ab3c Backwards compatibility module fife_compat. Import and you'll get the old interface. This is just a start to make small API changes smoother. diff -r 6e7d228def30 -r afcd83f7fac8 engine/extensions/fife_compat.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/engine/extensions/fife_compat.py Sat Oct 11 12:25:53 2008 +0000 @@ -0,0 +1,28 @@ + +""" +FIFE Backwards Combatibility Layer +================================== + +This module can be imported if you want to +run code that wasn't adapted to API changes in FIFE. + +2008.1 +------ + + - Animation.addFrame now expects a fife.ResourcePtr instead of an fife.Image + + +""" + +import fife + +# 2008.1 compatibility functions + +def decorate_addFrame(f): + """ Revision 2616 - Animation.addFrame doesn't accept Image* anymore """ + def addFrame(self,image_ptr, delay): + resource_ptr = fife.ResourcePtr(image_ptr) + return f(self,resource_ptr,delay) + return addFrame + +fife.Animation.addFrame = decorate_addFrame(fife.Animation.addFrame) \ No newline at end of file diff -r 6e7d228def30 -r afcd83f7fac8 engine/extensions/serializers/xmlanimation.py --- a/engine/extensions/serializers/xmlanimation.py Sat Oct 11 12:03:59 2008 +0000 +++ b/engine/extensions/serializers/xmlanimation.py Sat Oct 11 12:25:53 2008 +0000 @@ -1,4 +1,5 @@ import fife +import fife_compat from serializers import * class XMLAnimationLoader(fife.ResourceLoader): @@ -50,6 +51,7 @@ image_index = self.imagepool.addResourceFromLocation(image_location) animation.addFrame(fife.ResourcePtr(self.imagepool,image_index), frame_delay) + #animation.addFrame(self.imagepool.get(image_index), frame_delay) #print "...",image_index,image_location.getFilename() animation.thisown = 0