fredreichbier / genie

A Python module to access Genie engine (Age of Empires, ...) files
BSD 2-Clause "Simplified" License
19 stars 5 forks source link

OverflowError :: interfac.drs :: 50155.slp #4

Closed phrohdoh closed 9 years ago

phrohdoh commented 9 years ago
We're now browsing `interfac.drs`
genie> ls
[...snip...]
genie> show 50155
Now showing '50155'. Keys:
    q   return to prompt
    +/- zoom
    a   show the frame hotspot

Traceback (most recent call last):
  File "browse_slp.py", line 286, in do_show
    self.loader.show_filename(name)
  File "browse_slp.py", line 59, in show_filename
    self.show_resource(resource_id)
  File "browse_slp.py", line 80, in show_resource
    frames = self.get_frames(resource_id)
  File "browse_slp.py", line 74, in get_frames
    return [frame.parse_stream(player=self.player) for frame in slp_file.frames]
  File "/Users/thill/projects/genie/genie/slp/__init__.py", line 75, in parse_stream
    adapter = image_adapter_cls(self)
  File "/Users/thill/projects/genie/genie/slp/pyglet_adapter.py", line 10, in __init__
    RawAdapter.__init__(self, frame)
  File "/Users/thill/projects/genie/genie/slp/raw_adapter.py", line 29, in __init__
    self.array = bytearray(self.stride * frame.height)
OverflowError: cannot fit 'long' into an index-sized integer

Another issue (polish) (sorry if you want this in its own issue report): the left/right keys for cycling frames aren't shown in the Keys readout.

fredreichbier commented 9 years ago

Thanks again for the report! Are you using AOE1 or AOE2 files here? For AOE1, frame.height is -2139325312 for me, which does not seem right. So either 50155 in interfac.drs is not a SLP file or the parsing code is incorrect (which might very well be the case!). For AOE2, it displays an image with totally wrong colors, but it seems to be some background of some screen.

I've added an export command to export the raw data from the DRS file, maybe that helps.

As for the Keys readout, I added the arrow keys to the help. Thanks!

phrohdoh commented 9 years ago

AOE1, my renderer also dies on 50155 so I am going to assume it is not actually a valid SLP graphic.

fredreichbier commented 9 years ago

So, can we close this issue? What do you think?

phrohdoh commented 9 years ago

Yeah I'll close it, good call. If I end up figuring out how to make use of the file I'm sure I'll file a pull request.