shortcomming of ptr_first from external language

Posted By: LazyDog

shortcomming of ptr_first from external language - 05/16/06 23:48

hello,

the scenario is using external language and no c-script.
call game_load to restore a game.
this works great but all of our pointers to our entities,bmaps,etc
were stored in global variables in our external langauge so they are not restored during the game_load. We need to use ptr_first to retrieve all the pointers.
The shortcomming is that ptr_first requires a valid pointer to the object type that you want to retrieve; however, in this scenario, we don't have a valid object pointer to pass to ptr_first so a work around is a requirement to create a temporary object using str_create, etc to pass to ptr_first.

so the thought is perhaps we need the functionality of ent_next where you can pass a nil value to receive the first entity in the list. which means....
action_next, string_next, bmap_next, view_next, panel_next, text_next, font_next, sound_next, material_next.

LazyDog
Posted By: TripleX

Re: shortcomming of ptr_first from external language - 05/17/06 11:32

http://www.coniserver.net/ubbthreads/sho...true#Post624109

in eng:
long BmapType = HBYTE_BMAP<<24;
BMAP *bmap = ptr_first(&BmapType);

=> first bitmap.

TripleX
Posted By: LazyDog

Re: shortcomming of ptr_first from external language - 05/17/06 23:27

works great, danke!!
© 2023 lite-C Forums