Ejemplo n.º 1
0
void gr_text_destroy( int textid )
{
    if ( !textid )
    {
        for ( textid = 1 ; textid < text_nextid ; textid++ )
        {
            if ( texts[textid].on )
            {
                gr_destroy_object( texts[textid].objectid );
                if ( texts[textid].text ) free( texts[textid].text ) ;
                texts[textid].on = 0 ;
            }
        }
        text_count = 0 ;
        text_nextid = 1 ;
        return ;
    }
    if ( textid > 0 && textid < text_nextid )
    {
        if ( !texts[textid].on ) return ;

        gr_destroy_object( texts[textid].objectid );
        if ( texts[textid].text ) free( texts[textid].text ) ;
        texts[textid].on = 0 ;
        if ( textid == text_nextid - 1 )
        {
            while ( text_nextid > 1 && !texts[text_nextid-1].on ) text_nextid-- ;
        }
        text_count-- ;
    }
}
Ejemplo n.º 2
0
void scroll_start( int n, int fileid, int graphid, int backid, int region, int flags )
{
    SCROLL_EXTRA_DATA * data;

    if ( n >= 0 && n <= 9 )
    {
        if ( region < 0 || region > 31 ) region = 0 ;

        scrolls[n].graph = graphid ? bitmap_get( fileid, graphid ) : 0 ;
        scrolls[n].back  = backid  ? bitmap_get( fileid, backid )  : 0 ;

        if ( !graphid || !scrolls[n].graph ) return ; // El fondo de scroll no existe
        if ( backid && !scrolls[n].back ) return ; // Grafico no existe

        scrolls[n].active  = 1 ;
        scrolls[n].fileid  = fileid ;
        scrolls[n].graphid = graphid ;
        scrolls[n].backid  = backid ;
        scrolls[n].region  = &regions[region] ;
        scrolls[n].flags   = flags ;

        data = &(( SCROLL_EXTRA_DATA * ) & GLODWORD( libscroll, SCROLLS ) )[n] ;

        data->reserved[0] = ( int32_t ) & scrolls[n]; /* First reserved dword point to internal scrolldata struct */

        if ( scrolls_objects[n] ) gr_destroy_object( scrolls_objects[n] );
        scrolls_objects[n] = ( int )gr_new_object( 0, info_scroll, draw_scroll, n );
    }
}
Ejemplo n.º 3
0
void scroll_start( int n, int fileid, int graphid, int backid, int region, int flags, int destfile, int destid )
{
    SCROLL_EXTRA_DATA * data;

    if ( n >= 0 && n <= 9 )
    {
        if ( region < 0 || region > 31 ) region = 0 ;

        scrolls[n].active   = 1 ;
        scrolls[n].fileid   = fileid ;
        scrolls[n].graphid  = graphid ;
        scrolls[n].backid   = backid ;
        scrolls[n].region   = &regions[region] ;
        scrolls[n].flags    = flags ;
        scrolls[n].destfile = destfile;
        scrolls[n].destid   = destid;

        data = &(( SCROLL_EXTRA_DATA * ) &GLODWORD( libscroll, SCROLLS ) )[n] ;

        data->reserved[0] = ( int32_t ) &scrolls[n]; /* First reserved dword point to internal scrolldata struct */

        if ( scrolls_objects[n] ) gr_destroy_object( scrolls_objects[n] );
        scrolls_objects[n] = ( int )gr_new_object( 0, info_scroll, draw_scroll, n );
    }
}
Ejemplo n.º 4
0
void scroll_stop( int n )
{
    if ( n >= 0 && n <= 9 )
    {
        if ( scrolls_objects[n] )
        {
            gr_destroy_object( scrolls_objects[n] );
            scrolls_objects[n] = 0;
            scrolls[n].active = 0 ;
        }
    }
}
Ejemplo n.º 5
0
void __bgdexport( librender, instance_destroy_hook )( INSTANCE * r )
{
    if ( LOCDWORD( librender, r, OBJECTID ) ) gr_destroy_object( LOCDWORD( librender, r, OBJECTID ) );
}