Changeset 1459 for OGRE


Ignore:
Timestamp:
09/22/06 09:05:16 (18 years ago)
Author:
szirmay
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • OGRE/trunk/ogre_changes/Ogre1.2/OgreMain/src/SpriteSet.cpp

    r768 r1459  
    8888    void SpriteSet::genVertices(  const Billboard& bb) 
    8989    { 
    90         RGBA colour; 
     90                RGBA colour; 
    9191        Root::getSingleton().convertColourValue(bb.mColour, &colour); 
    9292                RGBA* pCol; 
     
    9696        const Ogre::FloatRect & r = 
    9797            bb.mUseTexcoordRect ? bb.mTexcoordRect : mTextureCoords[bb.mTexcoordIndex]; 
     98                 
     99                float width; 
     100                float height; 
     101                if(bb.hasOwnDimensions()) 
     102                { 
     103                        width = bb.getOwnWidth() / 2.0; 
     104                        height = bb.getOwnHeight() / 2.0; 
     105                } 
     106                else 
     107                { 
     108                        width = getDefaultWidth() / 2.0; 
     109                        height = getDefaultHeight() / 2.0; 
     110                } 
    98111 
    99                 /* 
    100             // Left-top 
    101             // Positions 
    102             *mLockPtr++ = -50 + bb.mPosition.x; 
    103             *mLockPtr++ = 50 + bb.mPosition.y; 
    104             *mLockPtr++ = 0  + bb.mPosition.z; 
    105             // Colour 
    106             // Convert float* to RGBA* 
    107             pCol = static_cast<RGBA*>(static_cast<void*>(mLockPtr)); 
    108             *pCol++ = colour; 
    109             // Update lock pointer 
    110             mLockPtr = static_cast<float*>(static_cast<void*>(pCol)); 
    111             // Texture coords 
    112             *mLockPtr++ = r.left; 
    113             *mLockPtr++ = r.bottom; 
    114  
    115             // Right-top 
    116             // Positions 
    117             *mLockPtr++ = 50 + bb.mPosition.x; 
    118             *mLockPtr++ = 50 + bb.mPosition.y; 
    119             *mLockPtr++ = 0 + bb.mPosition.z; 
    120             // Colour 
    121             // Convert float* to RGBA* 
    122             pCol = static_cast<RGBA*>(static_cast<void*>(mLockPtr)); 
    123             *pCol++ = colour; 
    124             // Update lock pointer 
    125             mLockPtr = static_cast<float*>(static_cast<void*>(pCol)); 
    126             // Texture coords 
    127             *mLockPtr++ = r.right; 
    128             *mLockPtr++ = r.bottom; 
    129  
    130             // Left-bottom 
    131             // Positions 
    132             *mLockPtr++ = -50 + bb.mPosition.x; 
    133             *mLockPtr++ = -50 + bb.mPosition.y; 
    134             *mLockPtr++ = 0 + bb.mPosition.z; 
    135             // Colour 
    136             // Convert float* to RGBA* 
    137             pCol = static_cast<RGBA*>(static_cast<void*>(mLockPtr)); 
    138             *pCol++ = colour; 
    139             // Update lock pointer 
    140             mLockPtr = static_cast<float*>(static_cast<void*>(pCol)); 
    141             // Texture coords 
    142             *mLockPtr++ = r.left; 
    143             *mLockPtr++ = r.top; 
    144  
    145             // Right-bottom 
    146             // Positions 
    147             *mLockPtr++ = 50 + bb.mPosition.x; 
    148             *mLockPtr++ = -50 + bb.mPosition.y; 
    149             *mLockPtr++ = 0 + bb.mPosition.z; 
    150             // Colour 
    151             // Convert float* to RGBA* 
    152             pCol = static_cast<RGBA*>(static_cast<void*>(mLockPtr)); 
    153             *pCol++ = colour; 
    154             // Update lock pointer 
    155             mLockPtr = static_cast<float*>(static_cast<void*>(pCol)); 
    156             // Texture coords 
    157             *mLockPtr++ = r.right; 
    158             *mLockPtr++ = r.top;*/ 
    159         
    160                 float width; 
    161                 if(bb.hasOwnDimensions()) 
    162                         width = bb.getOwnWidth() / 2.0; 
    163                 else 
    164                         width = getDefaultWidth() / 2.0; 
    165  
    166                 static float TexData[24] =  
     112                float TexData[24] =  
    167113                { 
    168                         r.left,         r.top,                  -width,  width,  
    169                         r.left,         r.bottom,               -width, -width,  
    170             r.right,    r.bottom,                width, -width,  
    171                         r.right,        r.top,                   width,  width,  
    172             r.left,             r.top,                  -width,  width,  
    173                         r.right,        r.bottom,                width, -width  
     114                        r.left,         r.top,                  -width,  height,  
     115                        r.left,         r.bottom,               -width, -height,  
     116            r.right,    r.bottom,                width, -height,  
     117                        r.right,        r.top,                   width,  height,  
     118            r.left,             r.top,                  -width,  height,  
     119                        r.right,        r.bottom,                width, -height  
    174120                }; 
    175121 
Note: See TracChangeset for help on using the changeset viewer.