Re: AW: [AD] Paletted Bitmap Grabber PlugIn & Allegro Extension

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


AArrgh! And I think both of you don't understand my problem.

The plugin-interface only provides functions for saving. I can register a
struct with function pointers which allow me to save my object into a
datafile and grab objects from external file formats, but NO function for
loading the object from a datafile. This function needs to be registered
with the thing Bob mentioned below. But there is no point in the plugin
system, where I can execute this function. For that I'd need to edit
'grabber.c' directly, which is not the purpose of the plug-in system, isn't
it? Each plugin comes with a .INC file:

/* registration code for setting up the font object plugin */
{
   extern DATEDIT_OBJECT_INFO datfont_info;
   extern DATEDIT_GRABBER_INFO datfont_grabber;

   datedit_register_object(&datfont_info);
   datedit_register_grabber(&datfont_grabber);
}

I tried to include the register_datafile_object() into the .INC file, but
that didn't work, because the INC file doesn't know anything about a
function called 'read_pal_bitmap_object_from_datafile()' unless it is
declared in ALLEGRO.H. I think we should add function pointers for
loading/destroying new objects, too, to DATEDIT_OBJECT_INFO, otherwise the
plugin system is senseless. In my game code it is no problem to call the
'register_datafile_object' but I want the grabber to be able to read this
new object, too.

Jörg
------------------------------
joerg@xxxxxxxxxx
home: http://www.sharky-x.de
music: http://mp3.sharky-x.de
-----------------(SHX '00)----



>
> [From allegro.txt]
>
> void register_datafile_object(int id, void *(*load)(PACKFILE *f, long
> size),
>                                       void (*destroy)(void *data));
>    Used to add custom object types, specifying functions to load and
> destroy
>    objects of this type. See grabber.txt for more information.
>
>
> --
>
> - Robert J Ohannessian
>



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/