Exemplo n.º 1
0
void CCTextureManager::invalidateAllTextureHandles()
{
    currentGLTexture = NULL;
    totalTexturesLoaded = 0;
    totalUsedTextureSpace = 0;

    for( int i=0; i<textureHandles.length; ++i )
    {
        CCTextureHandle *handle = textureHandles.list[i];
        if( handle->texture != NULL )
        {
            totalUsedTextureSpace -= handle->texture->getBytes();
            delete handle->texture;
            handle->texture = NULL;
        }
    }

    // Load in a 1x1 white texture to use for untextured draws
    assignTextureIndex( "transparent.png", Resource_Packaged, false, true, true );
    assignTextureIndex( "white.png", Resource_Packaged, false, true, true );

    setTextureIndex( 0 );

    CCSetTexCoords( NULL );
	CCDefaultTexCoords();
}
Exemplo n.º 2
0
void CCTextureManager::load()
{
    // Load in a 1x1 white texture to use for untextured draws
    assignTextureIndex( "Resources/Textures/white.png", Resource_Packaged, false, true, true );
    setTextureIndex( 0 );
}
Exemplo n.º 3
0
float CCTextureManager::getTextureWidth(const char *filePath, const CCResourceType resourceType)
{
    const uint textureHandleIndex = assignTextureIndex( filePath, resourceType, false, false, false );
    const CCTextureBase *texture = getTexture( textureHandleIndex );
    return texture->getImageWidth();
}