To make the image handling work (and it (ab)uses objects, so that
part'll need to change in the near future), I had to hard-code the image
size.
Applying the attached patch will demonstrate my current problem in keyed
access to a ManagedStruct. It's not for checkin. It's only here to
demonstrate the problem.
Bugfixes and advice warmly welcomed.
-- c
> To make the image handling work (and it (ab)uses objects, so that
> part'll need to change in the near future), I had to hard-code the image
> size.
You seem to be mixing params for _SDL_Image_draw():
screen, surface, color <-> parrot, screen, color
So 'parrot -t' thinks that you are accessing an UnManagedStruct (w/o
attached layout) by object attribute accessors.
That's as of current CVS.
> Applying the attached patch will demonstrate my current problem in keyed
> access to a ManagedStruct. It's not for checkin. It's only here to
> demonstrate the problem.
> .sub _SDL_Surface_height prototyped
> .param pmc surface
>
> + .sym pmc layout
> + layout = _SDL_Surface_layout()
> + assign surface, layout
You sould probably attach the structure layout, when the Surface is
created.
BTW: could you change the INIT_Flags to 0x21 or so (doesn't trigger
loading of esd if that's not running)
leo
> You sould probably attach the structure layout, when the Surface is
> created.
Good idea. I've done this for surfaces, screens, and images. Now we
can use images of different sizes than Leon's parrot logo.
I figured out the segfault problem. Inline struct definitions of this
sort (taken from the declaration of SDL_Surface):
/* info for fast blit mapping to other surfaces */
struct SDL_BlitMap *map; /* Private */
require .DATATYPE_PTR, not .DATATYPE_STRUCT_PTR. Since there is no
struct body, I wasn't attaching a '_struct' property, which of course
caused segfaults in calc_offsets() in unmanagedstruct.c.
Fixed now.
> BTW: could you change the INIT_Flags to 0x21 or so (doesn't trigger
> loading of esd if that's not running)
Also fixed.
When Jens and I are satisfied with a flag scheme, I'll change the
examples. For now, it's 32, which should suffice.
-- c