So I am doing more tests loading a large XML tilemap into cocos. The XML
file is about 50 MB. Here is the error I get:
Traceback (most recent call last):
File "C:/Users/Art/Dropbox/TerrainApp/main.py", line 19, in <module>
main()
File "C:/Users/Art/Dropbox/TerrainApp/main.py", line 12, in main
my_scene = scenes.GameScene(director)
File "C:\Users\Art\Dropbox\TerrainApp\scenes.py", line 16, in __init__
self.scroller = layers.TerrainScroller(director, self.clock)
File "C:\Users\Art\Dropbox\TerrainApp\layers.py", line 15, in __init__
self.maptemplate = cocos.tiles.load('terrain.xml')['maptemplate']
File
"C:\Python27\lib\site-packages\cocos2d-0.5.5-py2.7.egg\cocos\tiles.py",
line 213, in load
obj = load_tiles(filename)
File
"C:\Python27\lib\site-packages\cocos2d-0.5.5-py2.7.egg\cocos\tiles.py",
line 226, in load_tiles
resource.handle(root)
File
"C:\Python27\lib\site-packages\cocos2d-0.5.5-py2.7.egg\cocos\tiles.py",
line 119, in handle
return self.factories[tag.tag](self, tag)
File
"C:\Python27\lib\site-packages\cocos2d-0.5.5-py2.7.egg\cocos\tiles.py",
line 181, in resource_factory
self.handle(child)
File
"C:\Python27\lib\site-packages\cocos2d-0.5.5-py2.7.egg\cocos\tiles.py",
line 119, in handle
return self.factories[tag.tag](self, tag)
File
"C:\Python27\lib\site-packages\cocos2d-0.5.5-py2.7.egg\cocos\tiles.py",
line 530, in rectmap_factory
properties = _handle_properties(cell)
File
"C:\Python27\lib\site-packages\cocos2d-0.5.5-py2.7.egg\cocos\tiles.py",
line 349, in _handle_properties
properties = {}
MemoryError
Claudio, I noticed that you use ElementTree and not cElementTree for
parsing XML. Would it be possible to change this so it uses cElementTree
instead since it is faster and uses less memory?
--
You received this message because you are subscribed to the Google Groups
"cocos2d discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/cocos-discuss.
For more options, visit https://groups.google.com/groups/opt_out.