Exemple #1
0
int ded_s::getMaterialNum(de::Uri const &uri) const
{
    if(uri.isEmpty()) return -1;  // Not found.

    if(uri.scheme().isEmpty())
    {
        // Caller doesn't care which scheme - use a priority search order.
        de::Uri temp(uri);

        temp.setScheme("Sprites");
        int idx = getMaterialNum(temp);
        if(idx >= 0) return idx;

        temp.setScheme("Textures");
        idx = getMaterialNum(temp);
        if(idx >= 0) return idx;

        temp.setScheme("Flats");
        idx = getMaterialNum(temp);
        /*if(idx >= 0)*/ return idx;
    }

    if(Record const *def = materials.tryFind("id", uri.compose()))
    {
        return def->geti("__order__");
    }
    return -1;  // Not found.
}
Exemple #2
0
int ded_s::getMapInfoNum(de::Uri const &uri) const
{
    if(Record const *def = mapInfos.tryFind("id", uri.compose()))
    {
        return def->geti("__order__");
    }
    return -1;  // Not found.
}
Exemple #3
0
static void NetSv_CycleToMapNum(de::Uri const &mapUri)
{
    de::String const warpCommand = de::String("warp ") + mapUri.compose(de::Uri::DecodePath);
    DD_Execute(false, warpCommand.toUtf8().constData());

    // In a couple of seconds, send everyone the rules of this map.
    for(int i = 0; i < MAXPLAYERS; ++i)
    {
        cycleRulesCounter[i] = 3 * TICSPERSEC;
    }

    cycleMode    = CYCLE_IDLE;
    cycleCounter = 0;
}