Changeset 223

Show
Ignore:
Timestamp:
03/16/08 15:39:33 (5 months ago)
Author:
mattn
Message:

* hacked quake2 transparent surfaces support into the draw brush function

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • GtkRadiant/branches/ZeroRadiant/radiant/brush.cpp

    r197 r223  
    28902890} 
    28912891 
     2892#define Q2_SURF_TRANS33   0x00000010 
     2893#define Q2_SURF_TRANS66   0x00000020 
     2894 
    28922895void Brush_Draw(brush_t *b) 
    28932896{ 
     
    29082911  // guarantee the texture will be set first 
    29092912  bool bTrans; 
     2913        float transVal; 
    29102914        prev = NULL; 
    29112915        for (face = b->brush_faces,order = 0 ; face ; face=face->next, order++) 
     
    29172921                } 
    29182922 
    2919      bTrans = (face->pShader->getFlags() & QER_TRANS); 
     2923                bTrans = (face->pShader->getFlags() & QER_TRANS); 
     2924                transVal = face->pShader->getTrans(); 
     2925                // try to read the texture def surface flags to get trans 
     2926                if (!bTrans) { 
     2927                        if (face->texdef.flags & Q2_SURF_TRANS33) { 
     2928                                bTrans = true; 
     2929                                transVal = 0.33; 
     2930                        } else if (face->texdef.flags & Q2_SURF_TRANS66) { 
     2931                                bTrans = true; 
     2932                                transVal = 0.66; 
     2933                        } 
     2934                } 
    29202935 
    29212936          if (bTrans && !(nGLState & DRAW_GL_BLEND)) 
     
    29612976    { 
    29622977      if (!b->owner->eclass->fixedsize) 
    2963         material[3] = face->pShader->getTrans()
     2978        material[3] = transVal
    29642979      else 
    29652980        material[3] = 1; 
     
    29752990                        pShader = face->pShader; 
    29762991                        VectorCopy(pShader->getTexture()->color, material); 
    2977                         material[3] = identity[3] = pShader->getTrans()
     2992                        material[3] = identity[3] = transVal
    29782993 
    29792994                        if (nGLState & DRAW_GL_TEXTURE_2D)