Changeset 310 for trunk/thune/make.c

Show
Ignore:
Timestamp:
11/20/06 03:13:29 (2 years ago)
Author:
krobillard
Message:

Thune -

Renamed UBuffer to UResource.
coord! 'make now resolves words.

Thune GL -

Added framebuffer! datatype.
Added 'framebuffer, 'particle, and 'rotate draw list opcodes.
Can now load grayscale PNG with alpha (alpha is ignored).

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/thune/make.c

    r301 r310  
    213213  If retp is non-zero it will be set to the new buffer. 
    214214*/ 
    215 UIndex ur_makeBuffer( int dataType, int size, UBuffer** retp ) 
    216 { 
    217     UBuffer* buf; 
    218     UGCArray* gc = &ur_env->buffers; 
     215UIndex ur_makeResource( int dataType, int size, UResource** retp ) 
     216{ 
     217    UResource* buf; 
     218    UGCArray* gc = &ur_env->resources; 
    219219    UArray* ca = &gc->arr; 
    220220 
     
    224224#endif 
    225225 
    226     if( ur_env->buffers.freeCount ) 
     226    if( ur_env->resources.freeCount ) 
    227227    { 
    228228#ifndef GC_STRESS_TEST 
    229229getFree: 
    230230#endif 
    231         buf = ((UBuffer*) ca->ptr.v) + gc->freeList; 
     231        buf = ((UResource*) ca->ptr.v) + gc->freeList; 
    232232 
    233233        assert( gc->freeList > -1 ); 
     
    244244    { 
    245245        ur_recycle( ur_env ); 
    246         if( ur_env->buffers.freeCount ) 
     246        if( ur_env->resources.freeCount ) 
    247247            goto getFree; 
    248248    } 
    249249#endif 
    250250 
    251     UR_EXPAND_1( UBuffer, ca, buf ); 
     251    UR_EXPAND_1( UResource, ca, buf ); 
    252252 
    253253init: 
     
    259259        *retp = buf; 
    260260 
    261     return buf - ((UBuffer*) ca->ptr.v); 
     261    return buf - ((UResource*) ca->ptr.v); 
    262262} 
    263263 
     
    374374                              blk->ptr.cells + blk->used, 
    375375                              rblk->ptr.cells ); 
     376#if 0 
     377                // Deep copy 
     378                it   = rblk->ptr.cells; 
     379                rend = rblk->ptr.cells + size; 
     380                while( it != rend ) 
     381                { 
     382                    ur_clone( it, UR_COPY_ALL, 2 ); 
     383                    ++it; 
     384                } 
     385#endif 
    376386 
    377387                // Init new words to none. 
     
    888898 
    889899 
    890 void ur_makeCoordBlk( UCell* res, UCell* blkCell ) 
     900static void ur_makeCoordBlk( UThread* ur_thread, UCell* res, UCell* blkCell ) 
    891901{ 
    892902    int len; 
     
    905915            if( len == UR_COORD_MAX ) 
    906916                break; 
     917        } 
     918        else if( ur_isAWord(it) ) 
     919        { 
     920            UCell* val = ur_wordCell( ur_thread, it ); 
     921            if( ! val ) 
     922                return; 
     923            if( ur_is(val, UT_INT) || ur_is(val, UT_CHAR) ) 
     924            { 
     925                res->coord.elem[ len++ ] = ur_int(val); 
     926                if( len == UR_COORD_MAX ) 
     927                    break; 
     928            } 
    907929        } 
    908930        ++it; 
     
    12541276            else if( ur_is(tos, UT_BLOCK) ) 
    12551277            { 
    1256                 ur_makeCoordBlk( res, tos ); 
     1278                ur_makeCoordBlk( ur_thread, res, tos ); 
    12571279            } 
    12581280            else