Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 2791 for code


Ignore:
Timestamp:
Mar 16, 2009, 1:21:57 PM (16 years ago)
Author:
rgrieder
Message:

Please never commit any changes to the external libraries! It doesn't make updating easier…

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/trunk/src/ogreceguirenderer/OgreCEGUIRenderer.cpp

    r2790 r2791  
    33        created:        11/5/2004
    44        author:         Paul D Turner
    5 
     5       
    66        purpose:        Implementation of Renderer class for Ogre engine
    77*************************************************************************/
     
    5454        Utility function to create a render operation and vertex buffer to render quads
    5555*************************************************************************/
    56 static void createQuadRenderOp(Ogre::RenderOperation &d_render_op,
     56static void createQuadRenderOp(Ogre::RenderOperation &d_render_op, 
    5757    Ogre::HardwareVertexBufferSharedPtr &d_buffer, size_t nquads)
    5858{
     
    7272
    7373        // create hardware vertex buffer
    74         d_buffer = HardwareBufferManager::getSingleton().createVertexBuffer(vd->getVertexSize(0), nquads,
     74        d_buffer = HardwareBufferManager::getSingleton().createVertexBuffer(vd->getVertexSize(0), nquads, 
    7575        HardwareBuffer::HBU_DYNAMIC_WRITE_ONLY_DISCARDABLE, false);
    7676
     
    8383}
    8484
    85 static void destroyQuadRenderOp(Ogre::RenderOperation &d_render_op,
     85static void destroyQuadRenderOp(Ogre::RenderOperation &d_render_op, 
    8686    Ogre::HardwareVertexBufferSharedPtr &d_buffer)
    8787{
     
    146146                d_sorted = false;
    147147                QuadInfo quad;
    148 
     148               
    149149                // set quad position, flipping y co-ordinates, and applying appropriate texel origin offset
    150150                quad.position.d_left    = dest_rect.d_left;
     
    170170                quad.bottomLeftCol      = colourToOgre(colours.d_top_left);
    171171                quad.bottomRightCol     = colourToOgre(colours.d_top_right);
    172 
     172               
    173173                // set quad split mode
    174174                quad.splitMode = quad_split_mode;
     
    229229                buffmem->tv1 = quad.texPosition.d_bottom;
    230230                ++buffmem;
    231 
     231   
    232232                // setup Vertex 2...
    233 
     233               
    234234                // top-left to bottom-right diagonal
    235235                if (quad.splitMode == TopLeftToBottomRight)
     
    253253                }
    254254                ++buffmem;
    255 
     255   
    256256                // setup Vertex 3...
    257257                buffmem->x = quad.position.d_left;
     
    262262                buffmem->tv1 = quad.texPosition.d_top;
    263263                ++buffmem;
    264 
     264   
    265265                // setup Vertex 4...
    266266                buffmem->x = quad.position.d_right;
     
    271271                buffmem->tv1 = quad.texPosition.d_bottom;
    272272                ++buffmem;
    273 
     273   
    274274                // setup Vertex 5...
    275275                buffmem->x = quad.position.d_right;
     
    280280                buffmem->tv1 = quad.texPosition.d_top;
    281281                ++buffmem;
    282 
     282   
    283283                // setup Vertex 6...
    284 
     284               
    285285                // top-left to bottom-right diagonal
    286286                if (quad.splitMode == TopLeftToBottomRight)
     
    305305                ++buffmem;
    306306            }
    307 
     307   
    308308            // ensure we leave the buffer in the unlocked state
    309309            d_buffer->unlock();
    310310        }
    311 
     311       
    312312        /// Render the buffer
    313313        d_bufferPos = 0;
     
    318318        while(i != d_quadlist.end())
    319319        {
    320 
     320           
    321321            d_currTexture = i->texture;
    322322            d_render_op.vertexData->vertexStart = d_bufferPos;
     
    426426
    427427/*************************************************************************
    428         setup states etc
     428        setup states etc       
    429429*************************************************************************/
    430430void OgreCEGUIRenderer::initRenderStates(void)
     
    469469
    470470
    471 
    472 /*************************************************************************
    473         sort quads list according to texture
     471 
     472/*************************************************************************
     473        sort quads list according to texture   
    474474*************************************************************************/
    475475void OgreCEGUIRenderer::sortQuads(void)
     
    525525
    526526                // setup Vertex 2...
    527 
     527               
    528528                // top-left to bottom-right diagonal
    529529                if (quad_split_mode == TopLeftToBottomRight)
     
    577577
    578578                // setup Vertex 6...
    579 
     579               
    580580                // top-left to bottom-right diagonal
    581581                if (quad_split_mode == TopLeftToBottomRight)
     
    614614/*************************************************************************
    615615        convert ARGB colour value to whatever the Ogre render system is
    616         expecting.
     616        expecting.     
    617617*************************************************************************/
    618618uint32 OgreCEGUIRenderer::colourToOgre(const colour& col) const
     
    628628
    629629/*************************************************************************
    630         Set the scene manager to be used for rendering the GUI.
     630        Set the scene manager to be used for rendering the GUI. 
    631631*************************************************************************/
    632632void OgreCEGUIRenderer::setTargetSceneManager(Ogre::SceneManager* scene_manager)
     
    650650
    651651/*************************************************************************
    652         Set the target render queue for GUI rendering.
     652        Set the target render queue for GUI rendering. 
    653653*************************************************************************/
    654654void OgreCEGUIRenderer::setTargetRenderQueue(Ogre::uint8 queue_id, bool post_queue)
     
    724724
    725725/*************************************************************************
    726         Create a texture from an existing Ogre::TexturePtr object
     726        Create a texture from an existing Ogre::TexturePtr object       
    727727*************************************************************************/
    728728Texture* OgreCEGUIRenderer::createTexture(Ogre::TexturePtr& texture)
     
    749749
    750750/*************************************************************************
    751 Set the size of the display in pixels.
     751Set the size of the display in pixels. 
    752752*************************************************************************/
    753753void OgreCEGUIRenderer::setDisplaySize(const Size& sz)
     
    767767        is rendered
    768768*************************************************************************/
    769 void CEGUIRQListener::renderQueueStarted(Ogre::uint8 id, const Ogre::String& invocation,
     769void CEGUIRQListener::renderQueueStarted(Ogre::uint8 id, const Ogre::String& invocation, 
    770770                                                                                 bool& skipThisQueue)
    771771{
Note: See TracChangeset for help on using the changeset viewer.