annotate engine/extensions/fife_compat.py @ 151:afcd83f7fac8

Backwards compatibility module fife_compat. Import and you'll get the old interface. This is just a start to make small API changes smoother.
author phoku@33b003aa-7bff-0310-803a-e67f0ece8222
date Sat, 11 Oct 2008 12:25:53 +0000
parents
children 679ed3e15513
rev   line source
151
afcd83f7fac8 Backwards compatibility module fife_compat.
phoku@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
1
afcd83f7fac8 Backwards compatibility module fife_compat.
phoku@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
2 """
afcd83f7fac8 Backwards compatibility module fife_compat.
phoku@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
3 FIFE Backwards Combatibility Layer
afcd83f7fac8 Backwards compatibility module fife_compat.
phoku@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
4 ==================================
afcd83f7fac8 Backwards compatibility module fife_compat.
phoku@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
5
afcd83f7fac8 Backwards compatibility module fife_compat.
phoku@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
6 This module can be imported if you want to
afcd83f7fac8 Backwards compatibility module fife_compat.
phoku@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
7 run code that wasn't adapted to API changes in FIFE.
afcd83f7fac8 Backwards compatibility module fife_compat.
phoku@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
8
afcd83f7fac8 Backwards compatibility module fife_compat.
phoku@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
9 2008.1
afcd83f7fac8 Backwards compatibility module fife_compat.
phoku@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
10 ------
afcd83f7fac8 Backwards compatibility module fife_compat.
phoku@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
11
afcd83f7fac8 Backwards compatibility module fife_compat.
phoku@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
12 - Animation.addFrame now expects a fife.ResourcePtr instead of an fife.Image
afcd83f7fac8 Backwards compatibility module fife_compat.
phoku@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
13
afcd83f7fac8 Backwards compatibility module fife_compat.
phoku@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
14
afcd83f7fac8 Backwards compatibility module fife_compat.
phoku@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
15 """
afcd83f7fac8 Backwards compatibility module fife_compat.
phoku@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
16
afcd83f7fac8 Backwards compatibility module fife_compat.
phoku@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
17 import fife
afcd83f7fac8 Backwards compatibility module fife_compat.
phoku@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
18
afcd83f7fac8 Backwards compatibility module fife_compat.
phoku@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
19 # 2008.1 compatibility functions
afcd83f7fac8 Backwards compatibility module fife_compat.
phoku@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
20
afcd83f7fac8 Backwards compatibility module fife_compat.
phoku@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
21 def decorate_addFrame(f):
afcd83f7fac8 Backwards compatibility module fife_compat.
phoku@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
22 """ Revision 2616 - Animation.addFrame doesn't accept Image* anymore """
afcd83f7fac8 Backwards compatibility module fife_compat.
phoku@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
23 def addFrame(self,image_ptr, delay):
afcd83f7fac8 Backwards compatibility module fife_compat.
phoku@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
24 resource_ptr = fife.ResourcePtr(image_ptr)
afcd83f7fac8 Backwards compatibility module fife_compat.
phoku@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
25 return f(self,resource_ptr,delay)
afcd83f7fac8 Backwards compatibility module fife_compat.
phoku@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
26 return addFrame
afcd83f7fac8 Backwards compatibility module fife_compat.
phoku@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
27
afcd83f7fac8 Backwards compatibility module fife_compat.
phoku@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
28 fife.Animation.addFrame = decorate_addFrame(fife.Animation.addFrame)