Example #1
0
//--------------------------------------------------------------------
// repair damage
void mgTextureSurface::repair(
    mgRectangle& bounds)
{
    if (isDamaged())
    {
        mgGenSurface::repair(bounds);
        if (m_singleTile)
            updateSingleImage(bounds.m_x, bounds.m_y, bounds.right(), bounds.bottom());
        else updateTiledImage(bounds.m_x, bounds.m_y, bounds.right(), bounds.bottom());
    }
}
Example #2
0
void PhotoDetails::updateImageInfo() {

    if (m_photo.count() == 0) {
        disableFields();
    } else if (m_photo.count() == 1) {
        enableFields();
        updateSingleImage();
    } else if (m_photo.count() > 1) {
        enableFields();
        updateMultipleImage();
    }

}
Example #3
0
//--------------------------------------------------------------------
// create buffers, ready to send to display
void mgTextureSurface::createBuffers()
{
    if (m_tiles == NULL)
        return;

    if (m_singleTile)
    {
        if (m_tiles[0] == NULL)
            m_tiles[0] = mgDisplay->createTextureMemory(m_imageWidth, m_imageHeight, MG_MEMORY_FORMAT_BGRA, m_inworld);
    }
    else
    {
        for (int i = 0; i < m_vertTiles * m_horzTiles; i++)
        {
            if (m_tiles[i] == NULL)
                m_tiles[i] = mgDisplay->createTextureMemory(SURFACE_TILE_SIZE, SURFACE_TILE_SIZE, MG_MEMORY_FORMAT_BGRA, m_inworld);
        }
    }

    // recreate tiles from Bitmaps
    if (m_singleTile)
        updateSingleImage(0, 0, m_imageWidth, m_imageHeight);
    else updateTiledImage(0, 0, m_imageWidth, m_imageHeight);
}