Ignore:
Timestamp:
May 1, 2015, 1:11:31 PM (8 years ago)
Author:
Sam Hocevar
Message:

build: sync with newer Lol Engine changes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • abuse/branches/lol/src/property.cpp

    r732 r737  
    4444    void Set(int x)
    4545    {
    46         if (m_string.Count())
    47             m_string.Resize(0);
     46        // FIXME: would empty() work here?
     47        if (m_string.count())
     48            m_string.resize(0);
    4849        m_num = x;
    4950    }
     
    6263APropertyManager::~APropertyManager()
    6364{
    64     for (int i = 0; i < m_props.Count(); ++i)
     65    for (int i = 0; i < m_props.count(); ++i)
    6566        delete m_props[i];
    6667}
     
    6869AProperty *APropertyManager::find(char const *name)
    6970{
    70     for (int i = 0; i < m_props.Count(); ++i)
     71    for (int i = 0; i < m_props.count(); ++i)
    7172        if (m_props[i]->m_name == name)
    7273            return m_props[i];
     
    7778{
    7879    AProperty *f = find(name);
    79     if (!f || f->m_string.Count())
     80    if (!f || f->m_string.count())
    8081        return def;
    8182    return f->m_num;
     
    8586{
    8687    AProperty *f = find(name);
    87     if (!f || !f->m_string.Count())
     88    if (!f || !f->m_string.count())
    8889        return def;
    8990    return f->m_string.C();
     
    9697        f->Set((int)def);
    9798    else
    98         m_props.Push(new AProperty(name, (int)def));
     99        m_props.push(new AProperty(name, (int)def));
    99100}
    100101
     
    105106        f->Set(def);
    106107    else
    107         m_props.Push(new AProperty(name, def));
     108        m_props.push(new AProperty(name, def));
    108109}
    109110
     
    117118    }
    118119
    119     for (int i = 0; i < m_props.Count(); ++i)
     120    for (int i = 0; i < m_props.count(); ++i)
    120121    {
    121122        fprintf(fp, "%s = ", m_props[i]->m_name.C());
    122         if (m_props[i]->m_string.Count())
     123        if (m_props[i]->m_string.count())
    123124            fprintf(fp, "\"%s\"\n", m_props[i]->m_string.C());
    124125        else
Note: See TracChangeset for help on using the changeset viewer.