Changeset 3598 for trunk/src/opengl/mesa/translate.c
- Timestamp:
- May 23, 2000, 10:41:28 PM (25 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/opengl/mesa/translate.c
r2938 r3598 1 /* $Id: translate.c,v 1. 1 2000-02-29 00:50:12 sandervlExp $ */1 /* $Id: translate.c,v 1.2 2000-05-23 20:40:58 jeroen Exp $ */ 2 2 3 3 /* 4 4 * Mesa 3-D graphics library 5 * Version: 3. 15 * Version: 3.3 6 6 * 7 7 * Copyright (C) 1999 Brian Paul All Rights Reserved. … … 30 30 31 31 32 #include "glheader.h" 32 33 #include "types.h" 33 34 #include "translate.h" 34 35 #include "mmath.h" 36 #include "mem.h" 37 38 #undef CHECK 35 39 36 40 trans_1ui_func gl_trans_1ui_tab[MAX_TYPES]; … … 50 54 51 55 52 #define TAB(x) gl_trans _##x##_tab56 #define TAB(x) gl_trans##x##_tab 53 57 #define ARGS GLuint start, GLuint n 54 58 #define SRC_START start … … 108 112 #define SRC GLubyte 109 113 #define SRC_IDX TYPE_IDX(GL_UNSIGNED_BYTE) 110 #define TRX_3F(f,n) 111 #define TRX_4F(f,n) 112 #define TRX_UB(ub, f,n) 114 #define TRX_3F(f,n) /* unused */ 115 #define TRX_4F(f,n) /* unused */ 116 #define TRX_UB(ub, f,n) ub = PTR_ELT(f,n) 113 117 #define TRX_UI(f,n) (GLuint)PTR_ELT(f,n) 114 118 … … 274 278 #define TRX_4F(f,n) (GLfloat)( PTR_ELT(f,n) ) 275 279 #define TRX_UB(ub, f,n) ub = (GLubyte) (PTR_ELT(f,n) >> 24) 276 #define TRX_UI(f,n) 280 #define TRX_UI(f,n) PTR_ELT(f,n) 277 281 278 282 … … 387 391 388 392 static void trans_4_GLubyte_4ub_raw (GLubyte (*t)[4], 389 390 393 const struct gl_client_array *from, 394 ARGS ) 391 395 { 392 396 GLuint stride = from->StrideB; … … 398 402 */ 399 403 for (i = DST_START ; i < n ; i++, f += stride) { 400 404 COPY_4UBV( t[i], f ); 401 405 } 402 406 } else { 403 407 for (i = DST_START ; i < n ; i++, f += stride) { 404 405 406 407 408 t[i][0] = f[0]; 409 t[i][1] = f[1]; 410 t[i][2] = f[2]; 411 t[i][3] = f[3]; 408 412 } 409 413 } … … 413 417 static void init_translate_raw(void) 414 418 { 415 MEMSET( TAB( 1ui), 0, sizeof(TAB(1ui)) );416 MEMSET( TAB( 1ub), 0, sizeof(TAB(1ub)) );417 MEMSET( TAB( 3f), 0, sizeof(TAB(3f)) );418 MEMSET( TAB( 4ub), 0, sizeof(TAB(4ub)) );419 MEMSET( TAB( 4f), 0, sizeof(TAB(4f)) );420 421 TAB( 4ub)[4][TYPE_IDX(GL_UNSIGNED_BYTE)] = trans_4_GLubyte_4ub_raw;419 MEMSET( TAB(_1ui), 0, sizeof(TAB(_1ui)) ); 420 MEMSET( TAB(_1ub), 0, sizeof(TAB(_1ub)) ); 421 MEMSET( TAB(_3f), 0, sizeof(TAB(_3f)) ); 422 MEMSET( TAB(_4ub), 0, sizeof(TAB(_4ub)) ); 423 MEMSET( TAB(_4f), 0, sizeof(TAB(_4f)) ); 424 425 TAB(_4ub)[4][TYPE_IDX(GL_UNSIGNED_BYTE)] = trans_4_GLubyte_4ub_raw; 422 426 423 427 init_trans_4_GLbyte_raw(); … … 476 480 * That the correct value for normal is used. 477 481 */ 478 #define TAB(x) gl_trans_elt _##x##_tab482 #define TAB(x) gl_trans_elt##x##_tab 479 483 #define ARGS GLuint *flags, GLuint *elts, GLuint match, \ 480 484 GLuint start, GLuint n … … 482 486 #define DST_START start 483 487 #define CHECK if ((flags[i]&match) == VERT_ELT) 484 #define NEXT_F 1488 #define NEXT_F (void)1 485 489 #define NEXT_F2 f = first + elts[i] * stride; 486 490 … … 532 536 #define SRC GLubyte 533 537 #define SRC_IDX TYPE_IDX(GL_UNSIGNED_BYTE) 534 #define TRX_3F(f,n) 535 #define TRX_4F(f,n) 536 #define TRX_UB(ub, f,n) 538 #define TRX_3F(f,n) /* unused */ 539 #define TRX_4F(f,n) /* unused */ 540 #define TRX_UB(ub, f,n) ub = PTR_ELT(f,n) 537 541 #define TRX_UI(f,n) (GLuint)PTR_ELT(f,n) 538 542 … … 698 702 #define TRX_4F(f,n) (GLfloat)( PTR_ELT(f,n) ) 699 703 #define TRX_UB(ub, f,n) ub = (GLubyte) (PTR_ELT(f,n) >> 24) 700 #define TRX_UI(f,n) 704 #define TRX_UI(f,n) PTR_ELT(f,n) 701 705 702 706 … … 810 814 811 815 static void trans_4_GLubyte_4ub(GLubyte (*t)[4], 812 813 816 const struct gl_client_array *from, 817 ARGS ) 814 818 { 815 819 GLuint stride = from->StrideB; … … 822 826 */ 823 827 for (i = DST_START ; i < n ; i++, NEXT_F) { 824 825 826 827 828 CHECK { 829 NEXT_F2; 830 COPY_4UBV( t[i], f ); 831 } 828 832 } 829 833 } else { 830 834 for (i = DST_START ; i < n ; i++, NEXT_F) { 831 832 833 834 835 836 837 835 CHECK { 836 NEXT_F2; 837 t[i][0] = f[0]; 838 t[i][1] = f[1]; 839 t[i][2] = f[2]; 840 t[i][3] = f[3]; 841 } 838 842 } 839 843 } … … 843 847 static void init_translate_elt(void) 844 848 { 845 MEMSET( TAB( 1ui), 0, sizeof(TAB(1ui)) );846 MEMSET( TAB( 1ub), 0, sizeof(TAB(1ub)) );847 MEMSET( TAB( 3f), 0, sizeof(TAB(3f)) );848 MEMSET( TAB( 4ub), 0, sizeof(TAB(4ub)) );849 MEMSET( TAB( 4f), 0, sizeof(TAB(4f)) );850 851 TAB( 4ub)[4][TYPE_IDX(GL_UNSIGNED_BYTE)] = trans_4_GLubyte_4ub;849 MEMSET( TAB(_1ui), 0, sizeof(TAB(_1ui)) ); 850 MEMSET( TAB(_1ub), 0, sizeof(TAB(_1ub)) ); 851 MEMSET( TAB(_3f), 0, sizeof(TAB(_3f)) ); 852 MEMSET( TAB(_4ub), 0, sizeof(TAB(_4ub)) ); 853 MEMSET( TAB(_4f), 0, sizeof(TAB(_4f)) ); 854 855 TAB(_4ub)[4][TYPE_IDX(GL_UNSIGNED_BYTE)] = trans_4_GLubyte_4ub; 852 856 853 857 init_trans_4_GLbyte_elt();
Note:
See TracChangeset
for help on using the changeset viewer.