Beispiel #1
0
static void printDesc( CFDictionaryRef desc )
{
    char * msg;
    if ( CFDictionaryGetValue(desc, kCGDisplayModeUsableForDesktopGUI) == kCFBooleanTrue )
        msg = "Supports Aqua GUI";
    else
        msg = "Not for Aqua GUI";

    printf( "\t%d x %d,\t%d BPP,\t%d Hz\t(%s)\n",
            numberForKey(desc, kCGDisplayWidth),
            numberForKey(desc, kCGDisplayHeight),
            numberForKey(desc, kCGDisplayBitsPerPixel),
            numberForKey(desc, kCGDisplayRefreshRate),
            msg );
}
Beispiel #2
0
int MACOS_GetHertz( CFDictionaryRef desc )
{	
	return numberForKey(desc, kCGDisplayRefreshRate);
}
Beispiel #3
0
int MACOS_GetBPP( CFDictionaryRef desc )
{	
	return numberForKey(desc, kCGDisplayBitsPerPixel);
}
Beispiel #4
0
int MACOS_GetHeight( CFDictionaryRef desc )
{	
	return numberForKey(desc, kCGDisplayHeight);
}
Beispiel #5
0
int MACOS_GetWidth( CFDictionaryRef desc )
{	
	return numberForKey(desc, kCGDisplayWidth);
}
Beispiel #6
0
NS_DOROTHY_BEGIN

oParticleDef* oParticleCache::load( const char* filename )
{
    auto it = _parDict.find(filename);
    if (it != _parDict.end())
    {
        return it->second;
    }
    else
    {
        unsigned long size;
        auto data = oSharedContent.loadFile(filename, size);
        auto dict = CCDictionary::createWithContents(data, (unsigned int)size);

        oParticleDef* type = new oParticleDef();
        type->autorelease();

        type->maxParticles = (int)dict->numberForKey("maxParticles");
        type->angle = (float)dict->numberForKey("angle");
        type->angleVariance = (float)dict->numberForKey("angleVariance");
        type->duration = (float)dict->numberForKey("duration");
        type->blendFuncSource = (float)dict->numberForKey("blendFuncSource");
        type->blendFuncDestination = (float)dict->numberForKey("blendFuncDestination");
        type->startColorRed = (float)dict->numberForKey("startColorRed");
        type->startColorGreen = (float)dict->numberForKey("startColorGreen");
        type->startColorBlue = (float)dict->numberForKey("startColorBlue");
        type->startColorAlpha = (float)dict->numberForKey("startColorAlpha");
        type->startColorVarianceRed = (float)dict->numberForKey("startColorVarianceRed");
        type->startColorVarianceGreen = (float)dict->numberForKey("startColorVarianceGreen");
        type->startColorVarianceBlue = (float)dict->numberForKey("startColorVarianceBlue");
        type->startColorVarianceAlpha = (float)dict->numberForKey("startColorVarianceAlpha");
        type->finishColorRed = (float)dict->numberForKey("finishColorRed");
        type->finishColorGreen = (float)dict->numberForKey("finishColorGreen");
        type->finishColorBlue = (float)dict->numberForKey("finishColorBlue");
        type->finishColorAlpha = (float)dict->numberForKey("finishColorAlpha");
        type->finishColorVarianceRed = (float)dict->numberForKey("finishColorVarianceRed");
        type->finishColorVarianceGreen = (float)dict->numberForKey("finishColorVarianceGreen");
        type->finishColorVarianceBlue = (float)dict->numberForKey("finishColorVarianceBlue");
        type->finishColorVarianceAlpha = (float)dict->numberForKey("finishColorVarianceAlpha");
        type->startParticleSize = (float)dict->numberForKey("startParticleSize");
        type->startParticleSizeVariance = (float)dict->numberForKey("startParticleSizeVariance");
        type->finishParticleSize = (float)dict->numberForKey("finishParticleSize");
        type->finishParticleSizeVariance = (float)dict->numberForKey("finishParticleSizeVariance");
        type->sourcePositionx = (float)dict->numberForKey("sourcePositionx");
        type->sourcePositiony = (float)dict->numberForKey("sourcePositiony");
        type->sourcePositionVariancex = (float)dict->numberForKey("sourcePositionVariancex");
        type->sourcePositionVariancey = (float)dict->numberForKey("sourcePositionVariancey");
        type->rotationStart = (float)dict->numberForKey("rotationStart");
        type->rotationStartVariance = (float)dict->numberForKey("rotationStartVariance");
        type->rotationEnd = (float)dict->numberForKey("rotationEnd");
        type->rotationEndVariance = (float)dict->numberForKey("rotationEndVariance");
        type->emissionRate = (float)dict->numberForKey("emissionRate");
        type->emitterType = (int)dict->numberForKey("emitterType");
        type->gravityx = (float)dict->numberForKey("gravityx");
        type->gravityy = (float)dict->numberForKey("gravityy");
        type->speed = (float)dict->numberForKey("speed");
        type->speedVariance = (float)dict->numberForKey("speedVariance");
        type->radialAcceleration = (float)dict->numberForKey("radialAcceleration");
        type->radialAccelVariance = (float)dict->numberForKey("radialAccelVariance");
        type->tangentialAcceleration = (float)dict->numberForKey("tangentialAcceleration");
        type->tangentialAccelVariance = (float)dict->numberForKey("tangentialAccelVariance");
        type->rotationIsDir = dict->numberForKey("rotationIsDir") != 0;
        type->maxRadius = (float)dict->numberForKey("maxRadius");
        type->maxRadiusVariance = (float)dict->numberForKey("maxRadiusVariance");
        type->minRadius = (float)dict->numberForKey("minRadius");
        type->minRadiusVariance = (float)dict->numberForKey("minRadiusVariance");
        type->rotatePerSecond = (float)dict->numberForKey("rotatePerSecond");
        type->rotatePerSecondVariance = (float)dict->numberForKey("rotatePerSecondVariance");
        type->particleLifespan = (float)dict->numberForKey("particleLifespan");
        type->particleLifespanVariance = (float)dict->numberForKey("particleLifespanVariance");
        type->emissionRate = (float)(type->maxParticles) / type->particleLifespan;
        type->textureFileName = dict->stringForKey("textureFileName");
        const char* textureData = dict->stringForKey("textureImageData");
        if (textureData[0])
        {
            CCParticleSystem::dataToTexture(type->textureFileName.c_str(), textureData);
        }
        float textureRectx = (float)dict->numberForKey("textureRectx");
        float textureRecty = (float)dict->numberForKey("textureRecty");
        float textureRectw = (float)dict->numberForKey("textureRectw");
        float textureRecth = (float)dict->numberForKey("textureRecth");
        CCRect textureRect(textureRectx, textureRecty, textureRectw, textureRecth);
        type->textureRect = textureRect;
        _parDict[filename] = type;
        return type;
    }
}