Changeset 390 for branches/thune/thread_safe/gl/draw_list.c
- Timestamp:
- 05/17/07 18:27:45 (18 months ago)
- Files:
-
- 1 modified
-
branches/thune/thread_safe/gl/draw_list.c (modified) (24 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/thune/thread_safe/gl/draw_list.c
r383 r390 283 283 The pen is moved to the end of text. 284 284 */ 285 void gr_drawText( const char* it, const char* end )285 void gr_drawText( UThread* ut, const char* it, const char* end ) 286 286 { 287 287 GLfloat x, y; … … 328 328 329 329 330 void gr_drawTextCell( UThread* u r_thread, UCell* cell )330 void gr_drawTextCell( UThread* ut, UCell* cell ) 331 331 { 332 332 char* cpA; 333 333 char* cpB; 334 334 335 if( ur_stringSlice( cell, &cpA, &cpB ) )336 { 337 gr_drawText( cpA, cpB );335 if( ur_stringSlice( ut, cell, &cpA, &cpB ) ) 336 { 337 gr_drawText( ut, cpA, cpB ); 338 338 } 339 339 else 340 340 { 341 UString* str; 342 str = ur_binPtr( ur_thread->callTempBinN ); 341 UString* str = ur_threadTmp( ut ); 343 342 str->used = 0; 344 343 ur_toStr( cell, str, 0 ); 345 gr_drawText( str->ptr.c, str->ptr.c + str->used );344 gr_drawText( ut, str->ptr.c, str->ptr.c + str->used ); 346 345 } 347 346 } … … 375 374 376 375 377 static void dop_camera( U Cell* ctx )376 static void dop_camera( UThread* ut, UCell* ctx ) 378 377 { 379 378 double w, h; … … 466 465 467 466 468 static void dop_light( UThread* u r_thread, UCell* val, int light )467 static void dop_light( UThread* ut, UCell* val, int light ) 469 468 { 470 469 if( ur_is(val, UT_LOGIC) ) … … 497 496 498 497 default: 499 val = ur_wordCell( u r_thread, it );498 val = ur_wordCell( ut, it ); 500 499 if( val ) 501 500 { … … 532 531 Camera must be set up for light before calling shadow-begin. 533 532 */ 534 static void dop_shadow_begin( /*UThread* u r_thread,*/ UCell* fbCell )533 static void dop_shadow_begin( /*UThread* ut,*/ UCell* fbCell ) 535 534 { 536 535 // Save matrices for shadow-end. … … 604 603 Returns pc at last argument or zero if arguments are bad. 605 604 */ 606 static UCell* dop_attrib( UThread* u r_thread, UCell* pc )605 static UCell* dop_attrib( UThread* ut, UCell* pc ) 607 606 { 608 607 GrVertexAttribute* attr; … … 614 613 if( ur_is(pc, UT_SELECT) ) 615 614 { 616 UCell* val = ur_wordCell( u r_thread, pc );615 UCell* val = ur_wordCell( ut, pc ); 617 616 if( ! val ) 618 617 return 0; … … 673 672 icell is an int array! 674 673 */ 675 static void _drawPrims( U Cell* icell, const char* key )674 static void _drawPrims( UThread* ut, UCell* icell, const char* key ) 676 675 { 677 676 //GLdouble vec[3]; … … 771 770 #define VAL_WORD_OR_PC \ 772 771 if( ur_is(pc, UT_WORD) ) { \ 773 val = ur_wordCell( u r_thread, pc ); \772 val = ur_wordCell( ut, pc ); \ 774 773 if( ! val ) return 0; \ 775 774 } \ … … 779 778 Returns zero if an error occurred. 780 779 */ 781 static int _runDrawList( UThread* u r_thread, UCell* val )780 static int _runDrawList( UThread* ut, UCell* val ) 782 781 { 783 782 UBlock* blk = ur_blockPtr( val->series.n ); … … 811 810 glCallList( ur_dlGL(val) ); 812 811 } 813 else if( ! _runDrawList( u r_thread, val ) )812 else if( ! _runDrawList( ut, val ) ) 814 813 return 0; 815 814 } … … 867 866 VAL_WORD_OR_PC 868 867 if( ur_is(val, UT_CONTEXT) ) 869 dop_camera( val );868 dop_camera( ut, val ); 870 869 } 871 870 break; … … 877 876 ++pc; 878 877 VAL_WORD_OR_PC 879 dop_light( u r_thread, val, GL_LIGHT0 + light );878 dop_light( ut, val, GL_LIGHT0 + light ); 880 879 } 881 880 break; … … 946 945 947 946 case DOP_ATTRIB: 948 pc = dop_attrib( u r_thread, pc );947 pc = dop_attrib( ut, pc ); 949 948 if( ! pc ) 950 949 return 0; … … 965 964 { 966 965 glBegin( _primBegin[ ur_opcode(pc-2) - DOP_POINTS ] ); 967 _drawPrims( pc, ur_atomCStr( ur_atom(pc-1), 0 ) );966 _drawPrims( ut, pc, ur_atomCStr( ur_atom(pc-1), 0 ) ); 968 967 glEnd(); 969 968 } … … 1047 1046 VAL_WORD_OR_PC 1048 1047 } 1049 gr_drawTextCell( u r_thread, val );1048 gr_drawTextCell( ut, val ); 1050 1049 break; 1051 1050 … … 1053 1052 ++pc; 1054 1053 VAL_WORD_OR_PC 1055 loadShader( val );1054 loadShader( ut, val ); 1056 1055 break; 1057 1056 … … 1069 1068 VAL_WORD_OR_PC 1070 1069 if( ur_is(val, UT_FBO) ) 1071 dop_shadow_begin( /*u r_thread,*/ val );1070 dop_shadow_begin( /*ut,*/ val ); 1072 1071 break; 1073 1072 … … 1097 1096 UCell* res = ur_s_prev(tos); 1098 1097 1099 ops = ur_resolve ArgPath( UT_WORD, UR_ATOM_DRAW_LIST_OPCODES, UT_NONE );1098 ops = ur_resolvePath( ut, UR_ATOM_DRAW_LIST_OPCODES, UT_NONE ); 1100 1099 if( ! ops ) 1101 1100 { … … 1106 1105 if( ur_is(tos, UT_BLOCK) ) 1107 1106 { 1108 ur_infuse( u r_thread, ur_block(tos), ops );1107 ur_infuse( ut, ur_block(tos), ops ); 1109 1108 1110 1109 ur_initType(res, UT_DRAWLIST); … … 1117 1116 int pool; 1118 1117 1119 ur_infuse( u r_thread, ur_block(tos), ops );1118 ur_infuse( ut, ur_block(tos), ops ); 1120 1119 1121 1120 ur_initType(res, UT_DRAWLIST); … … 1130 1129 glNewList( ur_dlGL(res), GL_COMPILE ); 1131 1130 1132 if( ! _runDrawList( u r_thread, tos ) )1131 if( ! _runDrawList( ut, tos ) ) 1133 1132 { 1134 1133 ur_throwErr( UR_ERR_SCRIPT, "runDrawList failed" ); … … 1160 1159 glCallList( ur_dlGL(tos) ); 1161 1160 else 1162 _runDrawList( u r_thread, tos );1161 _runDrawList( ut, tos ); 1163 1162 } 1164 1163 UR_S_DROP;
