Ignore:
Timestamp:
May 23, 2000, 10:41:28 PM (25 years ago)
Author:
jeroen
Message:

* empty log message *

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/opengl/mesa/3dfx/fxvsetup.h

    r2938 r3598  
    33/*
    44 * Mesa 3-D graphics library
    5  * Version:  3.1
     5 * Version:  3.3
    66 *
    77 * Copyright (C) 1999  Brian Paul   All Rights Reserved.
     
    4848
    4949
    50 #define VARS_W 
     50#define VARS_W
    5151
    5252#define VARS_Z
    5353
    54 #define VARS_TMU0                                                       \
    55   GLuint tmu0_source = fxMesa->tmu_source[0];                           \
    56   GLfloat *tmu0_data = VEC_ELT(VB->TexCoordPtr[tmu0_source],            \
    57                                GLfloat, start);                         \
    58   GLuint tmu0_stride = VB->TexCoordPtr[tmu0_source]->stride;            \
    59   GLuint tmu0_sz = VB->TexCoordPtr[tmu0_source]->size;                  \
    60   struct gl_texture_unit *t0 = &ctx->Texture.Unit[tmu0_source];         \
    61   GLfloat sscale0 = FX_TEXTURE_DATA(t0)->sScale;        \
     54#define VARS_TMU0                                                       \
     55  GLuint tmu0_source = fxMesa->tmu_source[0];                           \
     56  GLfloat *tmu0_data = VEC_ELT(VB->TexCoordPtr[tmu0_source],            \
     57                               GLfloat, start);                         \
     58  GLuint tmu0_stride = VB->TexCoordPtr[tmu0_source]->stride;            \
     59  GLuint tmu0_sz = VB->TexCoordPtr[tmu0_source]->size;                  \
     60  struct gl_texture_unit *t0 = &ctx->Texture.Unit[tmu0_source];         \
     61  GLfloat sscale0 = FX_TEXTURE_DATA(t0)->sScale;        \
    6262  GLfloat tscale0 = FX_TEXTURE_DATA(t0)->tScale;
    6363
    64 #define VARS_TMU1                                                       \
    65   GLuint tmu1_source = fxMesa->tmu_source[1];                           \
    66   GLfloat *tmu1_data = VEC_ELT(VB->TexCoordPtr[tmu1_source],            \
    67                                GLfloat, start);                         \
    68   GLuint tmu1_stride = VB->TexCoordPtr[tmu1_source]->stride;            \
    69   GLuint tmu1_sz = VB->TexCoordPtr[tmu1_source]->size;                  \
    70   struct gl_texture_unit *t1 = &ctx->Texture.Unit[tmu1_source];         \
    71   GLfloat sscale1 = FX_TEXTURE_DATA(t1)->sScale;        \
     64#define VARS_TMU1                                                       \
     65  GLuint tmu1_source = fxMesa->tmu_source[1];                           \
     66  GLfloat *tmu1_data = VEC_ELT(VB->TexCoordPtr[tmu1_source],            \
     67                               GLfloat, start);                         \
     68  GLuint tmu1_stride = VB->TexCoordPtr[tmu1_source]->stride;            \
     69  GLuint tmu1_sz = VB->TexCoordPtr[tmu1_source]->size;                  \
     70  struct gl_texture_unit *t1 = &ctx->Texture.Unit[tmu1_source];         \
     71  GLfloat sscale1 = FX_TEXTURE_DATA(t1)->sScale;        \
    7272  GLfloat tscale1 = FX_TEXTURE_DATA(t1)->tScale;
    7373
    74 #define VARS_RGBA                                               \
    75   GLubyte *color = VEC_ELT(VB->ColorPtr, GLubyte, start);       \
    76   GLuint col_stride = VB->ColorPtr->stride; 
     74#define VARS_RGBA                                               \
     75  GLubyte *color = VEC_ELT(VB->ColorPtr, GLubyte, start);       \
     76  GLuint col_stride = VB->ColorPtr->stride;
    7777
    78 #define VARS_XY GLfloat *win = VB->Win.data[start]; 
     78#define VARS_XY GLfloat *win = VB->Win.data[start];
    7979
    8080#define INCR_XY win += 4
     
    8282
    8383#ifdef FX_V2
    84 #  define DO_SETUP_XY                           \
    85   v[XCOORD]=win[0];                             \
    86   v[YCOORD]=win[1]; 
     84#  define DO_SETUP_XY                           \
     85  v[XCOORD]=win[0];                             \
     86  v[YCOORD]=win[1];
    8787#else
    8888#ifdef DRIVERTS
    89 #  define DO_SETUP_XY                           \
    90   v[XCOORD]=win[0]+fxMesa->x_offset;            \
    91   v[YCOORD]=win[1]+fxMesa->y_delta;             
     89#  define DO_SETUP_XY                           \
     90  v[XCOORD]=win[0]+fxMesa->x_offset;            \
     91  v[YCOORD]=win[1]+fxMesa->y_delta;
    9292#else
    9393#  if (defined(__linux__) && defined(__i386__)) || defined(macintosh)
    94 #    define DO_SETUP_XY {                       \
    95        GLfloat t1 = win[0] + snapper;   \
    96        GLfloat t2 = win[1] + snapper;   \
    97        v[XCOORD] = t1 - snapper;                        \
    98        v[YCOORD] = t2 - snapper;                        \
     94#    define DO_SETUP_XY {                       \
     95       GLfloat t1 = win[0] + snapper;   \
     96       GLfloat t2 = win[1] + snapper;   \
     97       v[XCOORD] = t1 - snapper;                        \
     98       v[YCOORD] = t2 - snapper;                        \
    9999     }
    100100#  else
    101 #    define DO_SETUP_XY {                               \
    102         /* trunc (x,y) to multiple of 1/16 */           \
    103         v[XCOORD]=((int)(win[0]*16.0f))*(1.0f/16.0f);   \
    104         v[YCOORD]=((int)(win[1]*16.0f))*(1.0f/16.0f);   \
     101#    define DO_SETUP_XY {                               \
     102        /* trunc (x,y) to multiple of 1/16 */           \
     103        v[XCOORD]=((int)(win[0]*16.0f))*(1.0f/16.0f);   \
     104        v[YCOORD]=((int)(win[1]*16.0f))*(1.0f/16.0f);   \
    105105     }
    106106#  endif
     
    109109
    110110
    111 #define DO_SETUP_W {                            \
    112    v[OOWCOORD]=win[3];                  \
     111#define DO_SETUP_W {                            \
     112   v[OOWCOORD]=win[3];                  \
    113113}
    114114
    115115#define DO_SETUP_Z v[ZCOORD]=win[2];
    116116
    117 #define DO_SETUP_TMU0                                   \
    118 {                                                       \
    119   v[S0COORD]=sscale0*tmu0_data[0]*v[OOWCOORD];          \
    120   v[T0COORD]=tscale0*tmu0_data[1]*v[OOWCOORD];          \
    121 } 
     117#define DO_SETUP_TMU0                                   \
     118{                                                       \
     119  v[S0COORD]=sscale0*tmu0_data[0]*v[OOWCOORD];          \
     120  v[T0COORD]=tscale0*tmu0_data[1]*v[OOWCOORD];          \
     121}
    122122
    123123#define INCR_TMU0 STRIDE_F(tmu0_data, tmu0_stride)
    124124
    125 #define DO_SETUP_TMU1                           \
    126 {                                               \
    127   v[S1COORD]=sscale1*tmu1_data[0]*v[OOWCOORD];  \
    128   v[T1COORD]=tscale1*tmu1_data[1]*v[OOWCOORD];  \
     125#define DO_SETUP_TMU1                           \
     126{                                               \
     127  v[S1COORD]=sscale1*tmu1_data[0]*v[OOWCOORD];  \
     128  v[T1COORD]=tscale1*tmu1_data[1]*v[OOWCOORD];  \
    129129}
    130130
     
    132132
    133133#if FX_USE_PARGB
    134 #define DO_SETUP_RGBA   \
     134#define DO_SETUP_RGBA   \
    135135 { GET_PARGB(v) = color[ACOMP] << 24 | color[RCOMP] << 16 | color[GCOMP] << 8 | color[BCOMP];}
    136  
     136
    137137#else
    138 #define DO_SETUP_RGBA                                   \
    139 {                                                       \
    140   UBYTE_COLOR_TO_FLOAT_255_COLOR2(v[RCOORD], color[0]); \
    141   UBYTE_COLOR_TO_FLOAT_255_COLOR2(v[GCOORD], color[1]); \
    142   UBYTE_COLOR_TO_FLOAT_255_COLOR2(v[BCOORD], color[2]); \
    143   UBYTE_COLOR_TO_FLOAT_255_COLOR2(v[ACOORD], color[3]); \
     138#define DO_SETUP_RGBA                                   \
     139{                                                       \
     140  UBYTE_COLOR_TO_FLOAT_255_COLOR2(v[RCOORD], color[0]); \
     141  UBYTE_COLOR_TO_FLOAT_255_COLOR2(v[GCOORD], color[1]); \
     142  UBYTE_COLOR_TO_FLOAT_255_COLOR2(v[BCOORD], color[2]); \
     143  UBYTE_COLOR_TO_FLOAT_255_COLOR2(v[ACOORD], color[3]); \
    144144}
    145145#endif
     
    148148
    149149
    150 #define _FIXUP_PRE                                                      \
    151    GLuint hs = fxMesa->stw_hint_state & ~(GR_STWHINT_W_DIFF_TMU0 |      \
    152                                           GR_STWHINT_W_DIFF_TMU1);
     150#define _FIXUP_PRE                                                      \
     151   GLuint hs = fxMesa->stw_hint_state & ~(GR_STWHINT_W_DIFF_TMU0 |      \
     152                                          GR_STWHINT_W_DIFF_TMU1);
    153153
    154 #define _FIXUP_TMU0                                                     \
    155    if (tmu0_sz == 4) {                                                  \
    156       project_texcoords( VB, 0, tmu0_source, start, end );              \
    157       hs |= GR_STWHINT_W_DIFF_TMU0;                     \
    158    } 
     154#define _FIXUP_TMU0                                                     \
     155   if (tmu0_sz == 4) {                                                  \
     156      project_texcoords( VB, 0, tmu0_source, start, end );              \
     157      hs |= GR_STWHINT_W_DIFF_TMU0;                     \
     158   }
    159159
    160160
    161 #define _FIXUP_TMU1                                                     \
    162    if (tmu1_sz == 4) {                                                  \
    163       project_texcoords( VB, 1, tmu1_source, start, end );              \
    164       hs |= GR_STWHINT_W_DIFF_TMU1;                     \
    165    } 
     161#define _FIXUP_TMU1                                                     \
     162   if (tmu1_sz == 4) {                                                  \
     163      project_texcoords( VB, 1, tmu1_source, start, end );              \
     164      hs |= GR_STWHINT_W_DIFF_TMU1;                     \
     165   }
    166166
    167167
    168 #define _FIXUP_TMU01                                            \
    169    if (tmu0_sz == 4) {                                          \
    170       project_texcoords( VB, 0, tmu0_source, start, end );      \
    171       if (tmu1_sz == 4)                                         \
    172          project_texcoords( VB, 1, tmu1_source, start, end );   \
    173       else                                                      \
    174          copy_w( VB, 1, start, end );                           \
    175       hs |= (GR_STWHINT_W_DIFF_TMU0|GR_STWHINT_W_DIFF_TMU1);    \
    176    } else if (tmu1_sz == 4) {                                   \
    177       project_texcoords( VB, 1, tmu1_source, start, end );      \
    178       hs |= GR_STWHINT_W_DIFF_TMU1;                             \
     168#define _FIXUP_TMU01                                            \
     169   if (tmu0_sz == 4) {                                          \
     170      project_texcoords( VB, 0, tmu0_source, start, end );      \
     171      if (tmu1_sz == 4)                                         \
     172         project_texcoords( VB, 1, tmu1_source, start, end );   \
     173      else                                                      \
     174         copy_w( VB, 1, start, end );                           \
     175      hs |= (GR_STWHINT_W_DIFF_TMU0|GR_STWHINT_W_DIFF_TMU1);    \
     176   } else if (tmu1_sz == 4) {                                   \
     177      project_texcoords( VB, 1, tmu1_source, start, end );      \
     178      hs |= GR_STWHINT_W_DIFF_TMU1;                             \
    179179   }
    180180
    181 #define _FIXUP_POST                                     \
    182    if (hs != fxMesa->stw_hint_state) {                  \
    183       fxMesa->stw_hint_state = hs;                      \
    184       FX_grHints(GR_HINT_STWHINT, hs);                  \
     181#define _FIXUP_POST                                     \
     182   if (hs != fxMesa->stw_hint_state) {                  \
     183      fxMesa->stw_hint_state = hs;                      \
     184      FX_grHints(GR_HINT_STWHINT, hs);                  \
    185185   }
    186186
Note: See TracChangeset for help on using the changeset viewer.