QString vogleditor_stateTreeProgramEnumItem::getDiffedValue() const
{
    if (m_pDiffBaseState == NULL)
        return "";

    int value = (m_pDiffBaseState->*m_pFunc)();
    return getValueFromEnums(&value, 1);
}
QString vogleditor_stateTreeRenderbufferEnumItem::getDiffedValue() const
{
    if (m_pDiffBaseState == NULL)
        return "";

    int baseVal = 0;
    if (m_pDiffBaseState->get_desc().get_int(m_enum, &baseVal) == false)
    {
        return "non-existent";
    }

    return getValueFromEnums(&baseVal, 1);
}
Exemplo n.º 3
0
QString vogleditor_stateTreeStateVecEnumItem::getDiffedValue() const
{
    static int baseValues[4];
    VOGL_ASSERT(m_numComponents <= 4);

    QString result = "";
    if (m_pDiffBaseState->get<int>(m_name, m_index, baseValues, m_numComponents, m_isIndexed))
    {
        result = getValueFromEnums(baseValues, m_numComponents);
    }

    return result;
}
Exemplo n.º 4
0
QString vogleditor_stateTreeItem::getValueFromEnums(const int* values, uint count) const
{
    QString tmp;
    if (count == 0 || values == NULL)
    {
        return "";
    }
    else if (count == 1)
    {
        tmp = enum_to_string(*values);
    }
    else
    {
        tmp = tmp.sprintf("%s, %s", getValueFromEnums(values, 1).toStdString().c_str(), getValueFromEnums(&(values[1]), count-1).toStdString().c_str());
    }

    return tmp;
}
QString vogleditor_stateTreeTexEnvStateVecEnumItem::getDiffedValue() const
{
    if (m_pDiffBaseState == NULL || m_pDiffBaseInfo == NULL)
        return "";

    if (m_index >= m_pDiffBaseInfo->get_max_texture_coords())
    {
        // this index did not exist in the base state, so it must be new
        return "non-existent";
    }

    int baseVals[4] = { 0, 0, 0, 0 };
    if (m_pDiffBaseState->get_state(m_target).get<int>(m_name, m_index, baseVals, m_numComponents))
    {
        return getValueFromEnums(baseVals, m_numComponents);
    }
    else
    {
        // the values could not be obtained from both states, so something must have changed
        return "non-existent";
    }
}
vogleditor_stateTreeTexEnvStateVecEnumItem::vogleditor_stateTreeTexEnvStateVecEnumItem(GLenum target, QString glenumName, GLenum name, unsigned int index, int *values, unsigned int numComponents, vogleditor_stateTreeItem *parent, vogl_texenv_state &state)
    : vogleditor_stateTreeTexEnvStateVecDiffableItem(target, name, index, numComponents, glenumName, "", parent),
      m_pState(&state)
{
    setValue(getValueFromEnums(values, numComponents));
}
Exemplo n.º 7
0
vogleditor_stateTreeStateVecEnumItem::vogleditor_stateTreeStateVecEnumItem(QString glenumName, GLenum name, unsigned int index, const vogl_state_vector& stateVec, int* values, unsigned int numComponents, bool isIndexed, vogleditor_stateTreeItem* parent)
   : vogleditor_stateTreeDatatypeItem<int>(glenumName, name, index, stateVec, numComponents, isIndexed, parent)
{
    setValue(getValueFromEnums(values, numComponents));
}