Changeset 54 for trunk/orca/gl

Show
Ignore:
Timestamp:
02/17/06 15:30:01 (3 years ago)
Author:
krobillard
Message:

Now using orDecimal() & orInt() where appropriate.

Location:
trunk/orca/gl
Files:
4 modified

Legend:

Unmodified
Added
Removed
  • trunk/orca/gl/dlist.c

    r43 r54  
    113113{ 
    114114    if( val->type == OT_DECIMAL ) 
    115         return (GLfloat) val->num.decimal; 
     115        return (GLfloat) orDecimal(val); 
    116116    else if( val->type == OT_INTEGER ) 
    117         return (GLfloat) val->integer; 
     117        return (GLfloat) orInt(val); 
    118118    return 0.0f; 
    119119} 
     
    132132    else if( val->type == OT_DECIMAL ) 
    133133    { 
    134         GLfloat f = (GLfloat) val->num.decimal; 
     134        GLfloat f = (GLfloat) orDecimal(val); 
    135135        pc[0].f = pc[1].f = pc[2].f = f; 
    136136    } 
    137137    else if( val->type == OT_INTEGER ) 
    138138    { 
    139         GLfloat f = (GLfloat) val->integer; 
     139        GLfloat f = (GLfloat) orInt(val); 
    140140        pc[0].f = pc[1].f = pc[2].f = f; 
    141141    } 
     
    238238        pc = ((RenderWord*) prog->buf) + prog->used; 
    239239 
    240         switch( match->integer ) 
     240        switch( orInt(match) ) 
    241241        { 
    242242            case DLP_CALL_INT: 
     
    508508            return; 
    509509        } 
    510         key = a1->integer; 
     510        key = orInt(a1); 
    511511    } 
    512512    else 
     
    573573            { 
    574574                case PRIM_KEY_VERTEX: 
    575                     vindex = idx->integer * 3; 
     575                    vindex = orInt(idx) * 3; 
    576576                    getVector( 3, gEnv.state.vertVals + vindex, vec ); 
    577577                    glVertex3dv( vec ); 
     
    580580 
    581581                case PRIM_KEY_NORMAL: 
    582                     vindex = idx->integer * 3; 
     582                    vindex = orInt(idx) * 3; 
    583583                    getVector( 3, gEnv.state.normVals + vindex, vec ); 
    584584                    glNormal3dv( vec ); 
     
    588588                case PRIM_KEY_COLOR: 
    589589                { 
    590                     OValue* cval = gEnv.state.colorVals + idx->integer; 
     590                    OValue* cval = gEnv.state.colorVals + orInt(idx); 
    591591                    if( orIs(cval, OT_TUPLE) ) 
    592592                    { 
     
    600600 
    601601                case PRIM_KEY_UV0: 
    602                     vindex = idx->integer * 2; 
     602                    vindex = orInt(idx) * 2; 
    603603                    getVector( 2, gEnv.state.uvVals + vindex, vec ); 
    604604                    //printf( "KR UV0 %g %g\n", vec[0], vec[1] ); 
  • trunk/orca/gl/gx.c

    r42 r54  
    325325    { 
    326326        if( val->type == OT_DECIMAL ) 
    327             *vec++ = val->num.decimal; 
     327            *vec++ = orDecimal(val); 
    328328        else if( val->type == OT_INTEGER ) 
    329             *vec++ = (GLdouble) val->integer; 
     329            *vec++ = (GLdouble) orInt(val); 
    330330        else 
    331331            *vec++ = 0.0; 
     
    704704    if( a1->type == OT_INTEGER ) 
    705705    { 
    706         glCallList( a1->integer ); 
     706        glCallList( orInt(a1) ); 
    707707    } 
    708708    else 
    709709    { 
    710         DrawListResource* res = gxDList( a1->integer ); 
     710        DrawListResource* res = gxDList( orInt(a1) ); 
    711711        if( res && res->prog ) 
    712712            gxRunRenderProgram( res->prog ); 
     
    736736        else 
    737737        { 
    738             mode.id     = a1->integer; 
     738            mode.id     = orInt(a1); 
    739739            mode.width  = 0; 
    740740            mode.height = 0; 
     
    832832        if( it->type == OT_WORD ) 
    833833        { 
    834             cp = orAtomCString( it->word.atom ); 
     834            cp = orAtomCString( orAtom(it) ); 
    835835            strLen = 0; 
    836836            while( cp[ strLen ] ) 
     
    840840        else if( it->type == OT_CHAR ) 
    841841        { 
    842             ch = it->integer; 
     842            ch = orInt(it); 
    843843            if( ! ch ) 
    844844                ch = -1; 
     
    11151115    { 
    11161116        if( val->type == OT_INTEGER ) 
    1117             *dim = (double) val->integer; 
     1117            *dim = (double) orInt(val); 
    11181118        else if( val->type == OT_DECIMAL ) 
    1119             *dim = val->num.decimal; 
     1119            *dim = orDecimal(val); 
    11201120        else 
    11211121        { 
     
    11341134#define toDecimal(idx,dim) \ 
    11351135    if( val->type == OT_DECIMAL ) \ 
    1136         num[idx] = val->num.decimal * dim; \ 
     1136        num[idx] = orDecimal(val) * dim; \ 
    11371137    else if( val->type == OT_INTEGER ) \ 
    1138         num[idx] = (double) val->integer; \ 
     1138        num[idx] = (double) orInt(val); \ 
    11391139    else return 0; 
    11401140 
     
    12681268    if( a1->type == OT_WORD ) 
    12691269    { 
    1270         if( a1->word.atom == gEnv.atom_model ) 
     1270        if( orAtom(a1) == gEnv.atom_model ) 
    12711271        { 
    12721272            gxStateModel(); 
    12731273        } 
    1274         else if( a1->word.atom == gEnv.atom_solid ) 
     1274        else if( orAtom(a1) == gEnv.atom_solid ) 
    12751275        { 
    12761276            gxStateSolid(); 
     
    13891389        { 
    13901390            if( it->type == OT_DECIMAL ) 
    1391                 *pf += (float) it->num.decimal; 
     1391                *pf += (float) orDecimal(it); 
    13921392            else if( it->type == OT_INTEGER ) 
    1393                 *pf += (float) it->integer; 
     1393                *pf += (float) orInt(it); 
    13941394 
    13951395            ++pf; 
     
    14121412 
    14131413        if( a3->type == OT_DECIMAL ) 
    1414             angle = a3->num.decimal; 
     1414            angle = orDecimal(a3); 
    14151415        else if( a3->type == OT_INTEGER ) 
    1416             angle = (double) a3->integer; 
     1416            angle = (double) orInt(a3); 
    14171417        else 
    14181418            angle = 0.0; 
     
    14291429void keyRepeatNative( OValue* a1 ) 
    14301430{ 
    1431     glv_filterRepeatKeys( gView, a1->integer ); 
     1431    glv_filterRepeatKeys( gView, orInt(a1) ); 
    14321432} 
    14331433 
     
    15541554 
    15551555    if( a1->type == OT_INTEGER ) 
    1556         key = a1->integer; 
     1556        key = orInt(a1); 
    15571557    else 
    15581558        key = gxHashString(a1); 
     
    15791579 
    15801580    if( a1->type == OT_INTEGER ) 
    1581         id = a1->integer; 
     1581        id = orInt(a1); 
    15821582    else if( a1->type == OT_WORD ) 
    1583         id = a1->word.atom; 
     1583        id = orAtom(a1); 
    15841584 
    15851585    if( orRefineSet(REF_RG_FREE) ) 
  • trunk/orca/gl/joystick.c

    r1 r54  
    7070        val = cblk->values + JV_FD; 
    7171        orSetTF( val, OT_INTEGER ); 
    72         val->integer = fd; 
     72        orInt(val) = fd; 
    7373 
    7474        i = orMakeCString( name, -1 ); 
     
    7979        val = cblk->values + JV_AXIS_COUNT; 
    8080        orSetTF( val, OT_INTEGER ); 
    81         val->integer = axes; 
     81        orInt(val) = axes; 
    8282 
    8383        val = cblk->values + JV_BTN_COUNT; 
    8484        orSetTF( val, OT_INTEGER ); 
    85         val->integer = buttons; 
     85        orInt(val) = buttons; 
    8686 
    8787        blk = orMakeBlock( axes + buttons ); 
     
    9292        { 
    9393            orSetTF( val, OT_INTEGER ); 
    94             val->integer = 0; 
     94            orInt(val) = 0; 
    9595            ++val; 
    9696        } 
     
    119119    if( orIs( val, OT_INTEGER ) ) 
    120120    { 
    121         fd = val->integer; 
     121        fd = orInt(val); 
    122122        if( fd > -1 ) 
    123123        { 
     
    141141    val = vblk->values + JV_FD; 
    142142 
    143     if( orIs( val, OT_INTEGER ) && (val->integer > -1) ) 
     143    if( orIs( val, OT_INTEGER ) && (orInt(val) > -1) ) 
    144144    { 
    145145        int axes; 
     
    148148        OBlock* blk; 
    149149 
    150         fd = val->integer; 
     150        fd = orInt(val); 
    151151 
    152152        val = vblk->values + JV_AXIS_COUNT; 
    153         axes = val->integer; 
     153        axes = orInt(val); 
    154154 
    155155        val = vblk->values + JV_INPUT; 
  • trunk/orca/gl/ttf_load.c

    r37 r54  
    636636    tf  = &res->tfont; 
    637637 
    638     psize = (a1 + 2)->integer; 
     638    psize = orInt(a1 + 2); 
    639639    if( psize < 1 ) 
    640640        psize = 20; 
     
    657657        if( arg->type == OT_INTEGER ) 
    658658        { 
    659             tf->tex_width  = arg->integer; 
    660             tf->tex_height = arg->integer; 
     659            tf->tex_width  = orInt(arg); 
     660            tf->tex_height = orInt(arg); 
    661661        } 
    662662        else