Changeset 737


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

build: sync with newer Lol Engine changes.

Location:
abuse/branches/lol/src
Files:
29 edited

Legend:

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

    r732 r737  
    459459
    460460    String const &name = g_current_level->GetOriginalName();
    461     ASSERT(name.Count() > (int)strlen(".spe") + 2,
     461    ASSERT(name.count() > (int)strlen(".spe") + 2,
    462462           "invalid level name %s", name.C());
    463     String digits = name.Sub(name.Count() - strlen(".spe") - 2, 2);
     463    String digits = name.sub(name.count() - strlen(".spe") - 2, 2);
    464464
    465465    String msg = symbol_str("lev_complete");
     
    474474        msg += name;
    475475
    476     int w = wm->font()->Size().x * msg.Count(),
     476    int w = wm->font()->Size().x * msg.count(),
    477477        h = wm->font()->Size().y;
    478478    int x=(x1+x2)/2-w/2,y=(y1+y2)/2-h/2;
  • abuse/branches/lol/src/cache.cpp

    r732 r737  
    5252int CrcManager::write_crc_file(char const *filename)  // return 0 on failure
    5353{
    54     String msg = String::Printf("%s", symbol_str("calc_crc"));
     54    String msg = String::format("%s", symbol_str("calc_crc"));
    5555    if (stat_man)
    5656        stat_man->push(msg.C(), NULL);
    5757
    5858    int total = 0;
    59     for (int i = 0; i < m_files.Count(); ++i)
     59    for (int i = 0; i < m_files.count(); ++i)
    6060    {
    6161        int failed = 0;
     
    7575
    7676        if (stat_man)
    77             stat_man->update(i * 100 / m_files.Count());
     77            stat_man->update(i * 100 / m_files.count());
    7878    }
    7979    if (stat_man)
     
    8686    fp.write_uint16(total);
    8787
    88     for (int i = 0; i < m_files.Count(); ++i)
     88    for (int i = 0; i < m_files.count(); ++i)
    8989    {
    9090        int failed = 0;
     
    9494            fp.write_uint32(crc);
    9595            String const &name = GetFileName(i);
    96             fp.write_uint8(name.Count() + 1);
    97             fp.write(name.C(), name.Count() + 1);
     96            fp.write_uint8(name.count() + 1);
     97            fp.write(name.C(), name.count() + 1);
    9898        }
    9999    }
     
    113113        uint32_t crc = fp.read_uint32();
    114114        uint8_t len = fp.read_uint8();
    115         name.Resize(len);
     115        name.resize(len);
    116116        fp.read(name.C(), len);
    117117        set_crc(GetFileNumber(name), crc);
     
    123123void CrcManager::clean_up()
    124124{
    125     for (int i = 0; i < m_files.Count(); ++i)
     125    for (int i = 0; i < m_files.count(); ++i)
    126126        delete m_files[i];
    127     m_files.Empty();
     127    m_files.empty();
    128128}
    129129
     
    145145int CrcManager::GetFileNumber(String const &name)
    146146{
    147     for (int i = 0; i < m_files.Count(); ++i)
     147    for (int i = 0; i < m_files.count(); ++i)
    148148        if (name == m_files[i]->m_name)
    149149            return i;
    150150
    151     m_files.Push(new CrcedFile(name.C()));
    152     return m_files.Count() - 1;
     151    m_files.push(new CrcedFile(name.C()));
     152    return m_files.count() - 1;
    153153}
    154154
     
    218218    size += 2;        // total filenames
    219219    for (int i = 0; i < crc_manager.total_filenames(); i++)
    220         size += crc_manager.GetFileName(i).Count() + 2;    // filename + 0 + size of string
     220        size += crc_manager.GetFileName(i).count() + 2;    // filename + 0 + size of string
    221221
    222222    size += 4;       // number of entries saved
     
    245245      {
    246246        String const &name = crc_manager.GetFileName(i);
    247         fp->write_uint8(name.Count() + 1);
    248         fp->write(name.C(), name.Count() + 1);
     247        fp->write_uint8(name.count() + 1);
     248        fp->write(name.C(), name.count() + 1);
    249249      }
    250250
     
    698698        if (fp->open_failure())
    699699        {
    700             Log::Error("Could not open file %s\n", crc_manager.GetFileName(i->file_number).C());
     700            msg::error("Could not open file %s\n", crc_manager.GetFileName(i->file_number).C());
    701701            delete fp;
    702702            exit(0);
  • abuse/branches/lol/src/cache.h

    r729 r737  
    5050    void set_crc(int filenumber, uint32_t crc);
    5151    void clean_up();
    52     int total_filenames() { return m_files.Count(); }
     52    int total_filenames() { return m_files.count(); }
    5353    int write_crc_file(char const *filename);
    5454    int load_crc_file(char const *filename);
  • abuse/branches/lol/src/demo.cpp

    r732 r737  
    7474  the_game->load_level(name.C());
    7575  record_file->write((void const *)"DEMO,VERSION:2", 14);
    76   record_file->write_uint8(name.Count() + 1);
    77   record_file->write(name.C(), name.Count() + 1);
     76  record_file->write_uint8(name.count() + 1);
     77  record_file->write(name.C(), name.count() + 1);
    7878
    7979  uint8_t difficulty = 3;
  • abuse/branches/lol/src/dev.cpp

    r735 r737  
    154154    {
    155155        screen->Bar(m_pos, m_pos + m_size - ivec2(1), wm->dark_color());
    156         String st = String::Printf("%d", newx);
     156        String st = String::format("%d", newx);
    157157        wm->font()->PutString(screen, m_pos + ivec2(30, 1), st, wm->bright_color());
    158158        if (player_list)
     
    13461346        {
    13471347            String tmp = figures[o->otype]->fields[i]->descript_name;
    1348             while (tmp.Count() < maxl)
     1348            while (tmp.count() < maxl)
    13491349                tmp += ' ';
    13501350            widgets << new ATextField(ivec2(wl, wh), DEV_AI_FIGURES + i, tmp.C(), "######",
     
    19941994        if (g_current_level->save(g_current_level->GetName().C(), 0))
    19951995        {
    1996           String msg = String::Printf(symbol_str("saved_level"),
     1996          String msg = String::format(symbol_str("saved_level"),
    19971997                                      g_current_level->GetName().C());
    19981998          the_game->show_help(msg.C());
  • abuse/branches/lol/src/game.cpp

    r733 r737  
    23252325            m_vdecl = new VertexDeclaration(VertexStream<vec2>(VertexUsage::Position));
    23262326
    2327             m_vbo = new VertexBuffer(m_vertices.Bytes());
     2327            m_vbo = new VertexBuffer(m_vertices.bytes());
    23282328            void *vertices = m_vbo->Lock(0, 0);
    2329             memcpy(vertices, &m_vertices[0], m_vertices.Bytes());
     2329            memcpy(vertices, &m_vertices[0], m_vertices.bytes());
    23302330            m_vbo->Unlock();
    23312331
     
    23332333        }
    23342334
    2335         if (g_screen.Count())
     2335        if (g_screen.count())
    23362336        {
    23372337            m_screen->Bind();
    2338             m_screen->SetData(g_screen.Data());
     2338            m_screen->SetData(g_screen.data());
    23392339        }
    23402340
  • abuse/branches/lol/src/gui.cpp

    r736 r737  
    2929{
    3030  m_buttons = buttons;
    31   m_current = start_on < m_buttons.Count() ? start_on : -1;
     31  m_current = start_on < m_buttons.count() ? start_on : -1;
    3232  act = 0;
    33   for (int i = 0; i < m_buttons.Count(); ++i)
     33  for (int i = 0; i < m_buttons.count(); ++i)
    3434      m_buttons[i]->m_pos = m_pos;
    3535}
     
    3737ibox2 AIconSwitchButton::GetArea()
    3838{
    39     if (!m_buttons.Count())
     39    if (!m_buttons.count())
    4040        return ibox2(m_pos, m_pos);
    4141
    4242    ibox2 ret(10000, 10000, -10000, -10000);
    4343
    44     for (int i = 0; i < m_buttons.Count(); ++i)
     44    for (int i = 0; i < m_buttons.count(); ++i)
    4545    {
    4646        ibox2 tmp = m_buttons[i]->GetArea();
     
    5454AWidget *AIconSwitchButton::unlink(int id)
    5555{
    56   for (int i = 0; i < m_buttons.Count(); ++i)
     56  for (int i = 0; i < m_buttons.count(); ++i)
    5757  {
    5858    if (m_buttons[i]->m_id == id)
    5959    {
    6060      AWidget *ret = m_buttons[i];
    61       m_buttons.Remove(i);
    62       if (m_current >= m_buttons.Count())
     61      m_buttons.remove(i);
     62      if (m_current >= m_buttons.count())
    6363        m_current = 0;
    6464      return ret;
     
    7777  {
    7878    ++m_current;
    79     if (m_current >= m_buttons.Count())
     79    if (m_current >= m_buttons.count())
    8080      m_current = 0;
    8181    m_buttons[m_current]->Draw(act, screen);
     
    153153AIconSwitchButton::~AIconSwitchButton()
    154154{
    155   for (int i = 0; i < m_buttons.Count(); ++i)
     155  for (int i = 0; i < m_buttons.count(); ++i)
    156156    delete m_buttons[i];
    157   m_buttons.Empty();
     157  m_buttons.empty();
    158158}
    159159
  • abuse/branches/lol/src/imlib/filter.cpp

    r732 r737  
    2222    ASSERT(colors >= 0 && colors <= 256, "bad color count");
    2323
    24     m_table.Resize(colors, 0);
     24    m_table.resize(colors, 0);
    2525}
    2626
     
    2929{
    3030    int size = lol::max(from->Count(), to->Count());
    31     m_table.Resize(size);
     31    m_table.resize(size);
    3232
    3333    int dk = to->FindDarkest(1);
     
    5252void Filter::Set(int color_num, int change_to)
    5353{
    54     ASSERT(color_num >= 0 && color_num < m_table.Count(), "Bad colors_num");
     54    ASSERT(color_num >= 0 && color_num < m_table.count(), "Bad colors_num");
    5555
    5656    m_table[color_num] = change_to;
     
    106106    int mul = 1 << (8 - color_bits);
    107107    m_size = 1 << color_bits;
    108     m_table.Resize(m_size * m_size * m_size);
     108    m_table.resize(m_size * m_size * m_size);
    109109
    110110    /* For each colour in the RGB cube, find the nearest palette element. */
     
    134134    fp->seek(e->offset, 0);
    135135    m_size = fp->read_uint16();
    136     m_table.Resize(m_size * m_size * m_size);
    137     fp->read(m_table.Data(), m_table.Bytes());
     136    m_table.resize(m_size * m_size * m_size);
     137    fp->read(m_table.data(), m_table.bytes());
    138138}
    139139
     
    144144size_t ColorFilter::DiskUsage()
    145145{
    146     return sizeof(uint16_t) + m_table.Bytes();
     146    return sizeof(uint16_t) + m_table.bytes();
    147147}
    148148
     
    150150{
    151151    fp->write_uint16(m_size);
    152     return fp->write(m_table.Data(), m_table.Bytes()) == m_table.Bytes();
     152    return fp->write(m_table.data(), m_table.bytes()) == m_table.bytes();
    153153}
    154154
  • abuse/branches/lol/src/imlib/fonts.cpp

    r732 r737  
    2121void JCFont::PutString(AImage *screen, ivec2 pos, String const &st, int color)
    2222{
    23     for (int i = 0; i < st.Count(); ++i, pos.x += m_size.x)
     23    for (int i = 0; i < st.count(); ++i, pos.x += m_size.x)
    2424        PutChar(screen, pos, st[i], color);
    2525}
  • abuse/branches/lol/src/imlib/image.cpp

    r732 r737  
    3434{
    3535    m_size = size;
    36     m_data.Resize(m_size.x * m_size.y);
     36    m_data.resize(m_size.x * m_size.y);
    3737}
    3838
    3939AImage::~AImage()
    4040{
    41     for (int i = image_list.Count(); i--; )
     41    for (int i = image_list.count(); i--; )
    4242        if (image_list[i] == this)
    43             image_list.RemoveSwap(i);
     43            image_list.remove_swap(i);
    4444
    4545    delete m_special;
     
    7070    m_size = size;
    7171    m_special = NULL;
    72     m_data.Resize(m_size.x * m_size.y);
     72    m_data.resize(m_size.x * m_size.y);
    7373    if (create_descriptor)
    7474        m_special = new image_descriptor(size, create_descriptor == 2);
    75     image_list.Push(this);
     75    image_list.push(this);
    7676}
    7777
     
    8383    m_size.y = fp->read_uint16();
    8484    m_special = NULL;
    85     m_data.Resize(m_size.x * m_size.y);
     85    m_data.resize(m_size.x * m_size.y);
    8686    for (int i = 0; i < m_size.y; i++)
    8787        fp->read(scan_line(i), m_size.x);
    88     image_list.Push(this);
     88    image_list.push(this);
    8989}
    9090
    9191void image_uninit()
    9292{
    93     while (image_list.Count())
     93    while (image_list.count())
    9494        delete image_list[0];
    9595}
     
    329329void image_descriptor::ReduceDirties()
    330330{
    331     if (m_dirties.Count())
    332     {
    333         for (int i = 1; i < m_dirties.Count(); ++i)
     331    if (m_dirties.count())
     332    {
     333        for (int i = 1; i < m_dirties.count(); ++i)
    334334        {
    335335            m_dirties[0].m_aa = lol::min(m_dirties[0].m_aa, m_dirties[i].m_aa);
     
    337337        }
    338338
    339         m_dirties.Resize(1);
     339        m_dirties.resize(1);
    340340    }
    341341}
     
    354354        return;
    355355
    356     for (int i = m_dirties.Count(); i--; )
     356    for (int i = m_dirties.count(); i--; )
    357357    {
    358358        ADirtyRect &rect = m_dirties[i];
     
    366366        {
    367367            if (bb.y >= rect.m_bb.y + 1 && aa.y <= rect.m_aa.y)
    368                 m_dirties.RemoveSwap(i);
     368                m_dirties.remove_swap(i);
    369369            else if (bb.y >= rect.m_bb.y + 1)
    370370                rect.m_bb.y = aa.y - 1;
     
    430430                m_dirties << ADirtyRect(ivec2(rect.m_aa.x, bb.y), rect.m_bb);
    431431
    432             m_dirties.RemoveSwap(i);
     432            m_dirties.remove_swap(i);
    433433        }
    434434    }
     
    449449    array<ADirtyRect> to_add;
    450450
    451     for (int i = m_dirties.Count(); i--; )
     451    for (int i = m_dirties.count(); i--; )
    452452    {
    453453        ADirtyRect &rect = m_dirties[i];
     
    457457             && bb.x >= rect.m_bb.x + 1 && bb.y >= rect.m_bb.y + 1)
    458458        {
    459             m_dirties.RemoveSwap(i);
     459            m_dirties.remove_swap(i);
    460460        }
    461461        else if (bb.x - 1 >= rect.m_aa.x && bb.y - 1 >= rect.m_aa.y
     
    476476    }
    477477
    478     for (int i = 0; i < to_add.Count(); ++i)
     478    for (int i = 0; i < to_add.count(); ++i)
    479479        AddDirty(to_add[i].m_aa, to_add[i].m_bb);
    480480
     
    482482    m_dirties << ADirtyRect(aa, bb - ivec2(1));
    483483
    484     if (m_dirties.Count() >= MAX_DIRTY)
     484    if (m_dirties.count() >= MAX_DIRTY)
    485485        ReduceDirties(); // reduce to one dirty rectangle, we have too many
    486486}
     
    591591
    592592    m_size = new_size; // set the new height and width
    593     m_data.Resize(m_size.x * m_size.y);
     593    m_data.resize(m_size.x * m_size.y);
    594594
    595595    uint8_t *sl1, *sl2;
  • abuse/branches/lol/src/imlib/image.h

    r729 r737  
    116116        //return &m_data[y * m_size.x];
    117117
    118         return m_data.Data() + y * m_size.x;
     118        return m_data.data() + y * m_size.x;
    119119    }
    120120    AImage *copy(); // makes a copy of an image
  • abuse/branches/lol/src/imlib/input.cpp

    r736 r737  
    3535void AButtonBox::remap(Filter *f)
    3636{
    37     for (int i = 0; i < m_buttons.Count(); ++i)
     37    for (int i = 0; i < m_buttons.count(); ++i)
    3838        m_buttons[i]->remap(f);
    3939}
     
    4444        return this;
    4545
    46     for (int i = 0; i < m_buttons.Count(); ++i)
     46    for (int i = 0; i < m_buttons.count(); ++i)
    4747        if (id == m_buttons[i]->m_id)
    4848            return m_buttons[i];
     
    5757    m_buttons = buttons;
    5858    maxdown = MaxDown;
    59     if (m_buttons.Count() && maxdown)
     59    if (m_buttons.count() && maxdown)
    6060        m_buttons[0]->push();  // the first button is automatically selected!
    6161}
     
    6363AButtonBox::~AButtonBox()
    6464{
    65     for (int i = 0; i < m_buttons.Count(); ++i)
     65    for (int i = 0; i < m_buttons.count(); ++i)
    6666        delete m_buttons[i];
    6767}
     
    7070{
    7171    ibox2 ret;
    72     for (int i = 0; i < m_buttons.Count(); ++i)
     72    for (int i = 0; i < m_buttons.count(); ++i)
    7373    {
    7474        ibox2 area = m_buttons[i]->GetArea();
     
    8686void AButtonBox::draw_first(AImage *screen)
    8787{
    88     for (int i = 0; i < m_buttons.Count(); ++i)
     88    for (int i = 0; i < m_buttons.count(); ++i)
    8989        m_buttons[i]->draw_first(screen);
    9090}
     
    9797void AButtonBox::Move(ivec2 pos)
    9898{
    99     for (int i = 0; i < m_buttons.Count(); ++i)
     99    for (int i = 0; i < m_buttons.count(); ++i)
    100100        m_buttons[i]->Move(pos + m_buttons[i]->m_pos);
    101101    m_pos = pos;
     
    104104char const *AButtonBox::read()
    105105{
    106     for (int i = 0; i < m_buttons.Count(); ++i)
     106    for (int i = 0; i < m_buttons.count(); ++i)
    107107        if (*((int const *)m_buttons[i]->read()) == 0)
    108108            return (char const *)m_buttons[i];
     
    117117    case EV_MOUSE_BUTTON:
    118118        // see if the user clicked on a button
    119         for (int i = 0, found = 0; i < m_buttons.Count() && !found; ++i)
     119        for (int i = 0, found = 0; i < m_buttons.count() && !found; ++i)
    120120        {
    121121            ibox2 area = m_buttons[i]->GetArea();
     
    125125
    126126                int total = 0;
    127                 for (int j = 0; j < m_buttons.Count(); ++j)
     127                for (int j = 0; j < m_buttons.count(); ++j)
    128128                    if (*((int const *)m_buttons[j]->read()) == 0)
    129129                        total++;
     
    131131                if (*((int const *)m_buttons[i]->read()) == 0)  // did the user press or release the button
    132132                {
    133                     for (int j = 0; j < m_buttons.Count() && total > maxdown; ++j)
     133                    for (int j = 0; j < m_buttons.count() && total > maxdown; ++j)
    134134                        if ((i != j || maxdown == 0) && *((int const *)m_buttons[j]->read()) == 0)
    135135                        {
     
    156156void AButtonBox::add_button(AButton *b)
    157157{
    158     m_buttons.Push(b);
     158    m_buttons.push(b);
    159159}
    160160
     
    162162{
    163163    ivec2 on = m_pos;
    164     for (int i = 0; i < m_buttons.Count(); ++i)
     164    for (int i = 0; i < m_buttons.count(); ++i)
    165165    {
    166166        ibox2 area = m_buttons[i]->GetArea();
     
    173173{
    174174    ivec2 on = m_pos;
    175     for (int i = 0; i < m_buttons.Count(); ++i)
     175    for (int i = 0; i < m_buttons.count(); ++i)
    176176    {
    177177        ibox2 area = m_buttons[i]->GetArea();
     
    192192        return ibox2(m_pos, m_pos + pressed->Size() - ivec2(1));
    193193
    194     if (m_text.Count())
    195         return ibox2(m_pos, m_pos + wm->font()->Size() * ivec2(m_text.Count(), 1) + ivec2(6));
     194    if (m_text.count())
     195        return ibox2(m_pos, m_pos + wm->font()->Size() * ivec2(m_text.count(), 1) + ivec2(6));
    196196
    197197    return ibox2(m_pos, m_pos + visual->Size() + ivec2(6));
     
    407407    }
    408408
    409     if ((up && m_text.Count()) || (!up && !visual))
     409    if ((up && m_text.count()) || (!up && !visual))
    410410    {
    411411        wm->font()->PutString(screen, m_pos + ivec2(4, 5), m_text, wm->black());
  • abuse/branches/lol/src/imlib/palette.cpp

    r732 r737  
    2727{
    2828    int count = fp->read_uint16();
    29     m_colors.Resize(count);
    30     m_used.Resize(count, 0);
     29    m_colors.resize(count);
     30    m_used.resize(count, 0);
    3131    set_all_unused();
    32     fp->read(m_colors.Data(), m_colors.Bytes());
     32    fp->read(m_colors.data(), m_colors.bytes());
    3333    bg = 0;
    3434}
     
    3838    fp->seek(e->offset,0);
    3939    int count = fp->read_uint16();
    40     m_colors.Resize(count);
    41     m_used.Resize(count, 0);
     40    m_colors.resize(count);
     41    m_used.resize(count, 0);
    4242    set_all_unused();
    43     fp->read(m_colors.Data(), m_colors.Bytes());
     43    fp->read(m_colors.data(), m_colors.bytes());
    4444    bg = 0;
    4545}
     
    4747int Palette::write(bFILE *fp)
    4848{
    49     fp->write_uint16(m_colors.Count());
    50     return fp->write(m_colors.Data(), m_colors.Bytes()) == m_colors.Bytes();
     49    fp->write_uint16(m_colors.count());
     50    return fp->write(m_colors.data(), m_colors.bytes()) == m_colors.bytes();
    5151}
    5252
     
    5454{
    5555     int c = 0, d = 0x100000;
    56      for (int i = 0; i < m_colors.Count(); ++i)
     56     for (int i = 0; i < m_colors.count(); ++i)
    5757     {
    5858         int nd = sqlength((ivec3)(color - m_colors[i]));
     
    6868int Palette::FindColor(u8vec3 color) const
    6969{
    70     for (int i = 0; i < m_colors.Count(); ++i)
     70    for (int i = 0; i < m_colors.count(); ++i)
    7171        if (m_used[i] && m_colors[i] == color)
    7272            return i;
     
    9393void Palette::make_black_white()
    9494{
    95     for (int i = 0; i < m_colors.Count(); i++)
    96     {
    97         uint8_t c = (uint8_t)((double)i / m_colors.Count() * 255);
     95    for (int i = 0; i < m_colors.count(); i++)
     96    {
     97        uint8_t c = (uint8_t)((double)i / m_colors.count() * 255);
    9898        m_colors[i] = u8vec3(c);
    9999    }
     
    102102void Palette::set_rgbs()
    103103{
    104     ASSERT(m_colors.Count() == 256);
     104    ASSERT(m_colors.count() == 256);
    105105
    106106    for (int i = 0; i < 64; i++)
     
    123123void Palette::set_all_used()
    124124{
    125     memset(m_used.Data(), 1, m_used.Bytes());
     125    memset(m_used.data(), 1, m_used.bytes());
    126126}
    127127
    128128void Palette::set_all_unused()
    129129{
    130     memset(m_used.Data(), 0, m_used.Bytes());
     130    memset(m_used.data(), 0, m_used.bytes());
    131131}
    132132
    133133Palette *Palette::Copy() const
    134134{
    135     Palette *p = new Palette(m_colors.Count());
     135    Palette *p = new Palette(m_colors.count());
    136136    p->m_colors = m_colors;
    137137    p->m_used = m_used;
     
    149149    m_used[0] = 1;
    150150
    151     for (int i = 1; i < m_colors.Count(); i++)
     151    for (int i = 1; i < m_colors.count(); i++)
    152152        m_used[i] = 0;
    153153
    154     if (m_colors.Count() == 256)
    155         for (int i = 0; i < m_colors.Count(); i++)
     154    if (m_colors.count() == 256)
     155        for (int i = 0; i < m_colors.count(); i++)
    156156            m_colors[i] = u8vec3(((i >> 5) & 7) * 255 / 7,
    157157                                 ((i >> 2) & 7) * 255 / 7,
    158158                                 (i & 3) * 255 / 7);
    159     else if (m_colors.Count() == 16)
    160         for (int i = 0; i < m_colors.Count(); i++)
     159    else if (m_colors.count() == 16)
     160        for (int i = 0; i < m_colors.count(); i++)
    161161            m_colors[i] = u8vec3(255 - (i & 3),
    162162                                 255 - ((i & 4) >> 2),
    163163                                 255 - ((i & 8) >> 3));
    164164    else
    165         for (int i = 0; i < m_colors.Count(); i++)
     165        for (int i = 0; i < m_colors.count(); i++)
    166166            m_colors[i] = u8vec3(255 - (i % 3),
    167167                                 255 - ((i + 1) % 3),
     
    174174    {
    175175        int m = -amount;
    176         for (int i = 0; i < m_colors.Count(); i++)
     176        for (int i = 0; i < m_colors.count(); i++)
    177177        {
    178178            u8vec3 c = m_colors[i];
     
    183183    {
    184184        int m = amount;
    185         for (int i = 0; i < m_colors.Count(); i++)
     185        for (int i = 0; i < m_colors.count(); i++)
    186186        {
    187187            u8vec3 c = m_colors[i];
     
    211211    ASSERT(number_colors > 0, "Palette::constructor - need at least one color!");
    212212
    213     m_colors.Resize(number_colors);
    214     m_used.Resize(number_colors);
     213    m_colors.resize(number_colors);
     214    m_used.resize(number_colors);
    215215    defaults();
    216216}
     
    220220    int brv = 0, bri = 0;
    221221
    222     for (int i = 0; i < m_colors.Count(); ++i)
     222    for (int i = 0; i < m_colors.count(); ++i)
    223223    {
    224224        if (all || m_used[i])
     
    240240    int brv = 258, bri = 0;
    241241
    242     for (int i = 0; i < m_colors.Count(); ++i)
     242    for (int i = 0; i < m_colors.count(); ++i)
    243243    {
    244244        if (all || m_used[i])
     
    260260    // Force to only 256 colours.
    261261    // Shouldn't be needed, but best to be safe.
    262     if (m_colors.Count() > 256)
    263         m_colors.Resize(256);
     262    if (m_colors.count() > 256)
     263        m_colors.resize(256);
    264264
    265265    delete lastl;
     
    274274void Palette::FadeTo(int total_fades, int fade_on, u8vec3 dest)
    275275{
    276     for (int i = 0; i < m_colors.Count(); i++)
     276    for (int i = 0; i < m_colors.count(); i++)
    277277        m_colors[i] += u8vec3(ivec3(dest - m_colors[i]) * fade_on / total_fades);
    278278}
  • abuse/branches/lol/src/imlib/palette.h

    r729 r737  
    2727    Palette *Copy() const;
    2828
    29     int Count() const { return m_colors.Count(); }
    30     u8vec3 *Data() { return m_colors.Data(); }
    31     u8vec3 const *Data() const { return m_colors.Data(); }
     29    int Count() const { return m_colors.count(); }
     30    u8vec3 *Data() { return m_colors.data(); }
     31    u8vec3 const *Data() const { return m_colors.data(); }
    3232
    3333    u8vec3 GetColor(int x) const;
  • abuse/branches/lol/src/imlib/specs.cpp

    r732 r737  
    573573void SpecDir::FullyLoad(bFILE *fp)
    574574{
    575     for (int i = 0; i < m_entries.Count(); ++i)
     575    for (int i = 0; i < m_entries.count(); ++i)
    576576    {
    577577        SpecEntry *se = m_entries[i];
     
    610610
    611611    // calculate the size of directory info
    612     for (int i = 0; i < m_entries.Count(); ++i)
     612    for (int i = 0; i < m_entries.count(); ++i)
    613613        o += 1 + 1 + strlen(m_entries[i]->name) + 1 + 1 + 8;
    614614
    615615    // calculate offset for each entry
    616     for (int i = 0; i < m_entries.Count(); ++i)
     616    for (int i = 0; i < m_entries.count(); ++i)
    617617    {
    618618        m_entries[i]->offset = o;
     
    623623SpecEntry *SpecDir::find(char const *name, int type)
    624624{
    625     for (int i = 0; i < m_entries.Count(); ++i)
     625    for (int i = 0; i < m_entries.count(); ++i)
    626626        if (!strcmp(m_entries[i]->name, name) && m_entries[i]->type == type)
    627627            return m_entries[i];
     
    643643int SpecDir::find_number(char const *name)
    644644{
    645     for (int i = 0; i < m_entries.Count(); ++i)
     645    for (int i = 0; i < m_entries.count(); ++i)
    646646        if (!strcmp(m_entries[i]->name, name))
    647647            return i;
     
    651651int SpecDir::find_number(int type)
    652652{
    653     for (int i = 0; i < m_entries.Count(); ++i)
     653    for (int i = 0; i < m_entries.count(); ++i)
    654654        if (m_entries[i]->type == type)
    655655            return i;
     
    660660{
    661661    int ret = 0;
    662     for (int i = 0; i < m_entries.Count(); ++i)
     662    for (int i = 0; i < m_entries.count(); ++i)
    663663        if (m_entries[i]->type == type)
    664664            ++ret;
     
    669669{
    670670    printf("[   Entry type   ][   Entry name   ][  Size  ][ Offset ]\n");
    671     for (int i = 0; i < m_entries.Count(); ++i)
     671    for (int i = 0; i < m_entries.count(); ++i)
    672672        m_entries[i]->Print();
    673673}
     
    684684    {
    685685        int total = fp->read_uint16();
    686         m_entries.Resize(total);
     686        m_entries.resize(total);
    687687        long start = fp->tell();
    688688
     
    698698        }
    699699
    700         m_data.Resize(data_size);
    701         uint8_t *dp = m_data.Data();
     700        m_data.resize(data_size);
     701        uint8_t *dp = m_data.data();
    702702
    703703        fp->seek(start, SEEK_SET);
     
    724724    else
    725725    {
    726         m_data.Empty();
    727         m_entries.Empty();
     726        m_data.empty();
     727        m_entries.empty();
    728728    }
    729729}
     
    772772long SpecDir::data_start_offset()
    773773{
    774     if (m_entries.Count())
     774    if (m_entries.count())
    775775        return m_entries[0]->offset;
    776776
     
    781781long SpecDir::data_end_offset()
    782782{
    783     if (m_entries.Count())
    784         return m_entries.Last()->offset + m_entries.Last()->size;
     783    if (m_entries.count())
     784        return m_entries.last()->offset + m_entries.last()->size;
    785785
    786786  return SPEC_SIG_SIZE + 2;
     
    795795        return 0;
    796796
    797     fp->write_uint16(m_entries.Count());
    798 
    799     for (int i = 0; i < m_entries.Count(); ++i)
     797    fp->write_uint16(m_entries.count());
     798
     799    for (int i = 0; i < m_entries.count(); ++i)
    800800    {
    801801        if (fp->write(&m_entries[i]->type, 1) != 1)
     
    867867void SpecDir::remove(SpecEntry *e)
    868868{
    869     for (int i = 0; i < m_entries.Count(); ++i)
     869    for (int i = 0; i < m_entries.count(); ++i)
    870870    {
    871871        if (m_entries[i] == e)
    872872        {
    873873            delete e;
    874             m_entries.Remove(i);
     874            m_entries.remove(i);
    875875            return;
    876876        }
     
    881881void SpecDir::add_by_hand(SpecEntry *e)
    882882{
    883     m_entries.Push(e);
     883    m_entries.push(e);
    884884}
    885885
    886886void SpecDir::delete_entries()   // if the directory was created by hand instead of by file
    887887{
    888     for (int i = 0; i < m_entries.Count(); ++i)
     888    for (int i = 0; i < m_entries.count(); ++i)
    889889        delete m_entries[i];
    890     m_entries.Empty();
     890    m_entries.empty();
    891891}
    892892
  • abuse/branches/lol/src/imlib/video.cpp

    r732 r737  
    3131    else
    3232    {
    33         for (int i = 0; i < im->m_special->m_dirties.Count(); ++i)
     33        for (int i = 0; i < im->m_special->m_dirties.count(); ++i)
    3434        {
    3535            ADirtyRect &rect = im->m_special->m_dirties[i];
     
    4040        }
    4141
    42         im->m_special->m_dirties.Resize(0);
     42        im->m_special->m_dirties.resize(0);
    4343    }
    4444
  • abuse/branches/lol/src/imlib/window.cpp

    r736 r737  
    388388
    389389    _x1 = left_border();
    390     _y1 = name.Count() ? top_border() : jw_top + 5;
     390    _y1 = name.count() ? top_border() : jw_top + 5;
    391391
    392392    m_surf = nullptr;
     
    411411    m_surf = new AImage(m_size, 2);
    412412    // Keep this from getting destroyed when image list is cleared
    413     image_list.Pop();
     413    image_list.pop();
    414414    m_surf->clear(backg);
    415415    inm->m_surf = m_surf;
     
    438438    m_size = ivec2(2);
    439439
    440     for (int i = 0; i < inm->m_fields.Count(); ++i)
     440    for (int i = 0; i < inm->m_fields.count(); ++i)
    441441    {
    442442        inm->m_fields[i]->set_owner(this);
     
    531531AWidget *InputManager::unlink(int id)
    532532{
    533     for (int i = 0; i < m_fields.Count(); ++i)
     533    for (int i = 0; i < m_fields.count(); ++i)
    534534    {
    535535        /* Does this item match the ID? */
     
    537537        {
    538538            AWidget *ret = m_fields[i];
    539             m_fields.Remove(i);
     539            m_fields.remove(i);
    540540
    541541            if (m_active == i)
    542                 m_active = m_fields.Count() ? 0 : -1;
     542                m_active = m_fields.count() ? 0 : -1;
    543543
    544544            return ret;
     
    556556InputManager::~InputManager()
    557557{
    558     for (int i = 0; i < m_fields.Count(); ++i)
     558    for (int i = 0; i < m_fields.count(); ++i)
    559559        delete m_fields[i];
    560     m_fields.Empty();
     560    m_fields.empty();
    561561}
    562562
     
    587587    if ((ev.type==EV_MOUSE_BUTTON && ev.mouse_button==1) || ev.type==EV_MOUSE_MOVE)
    588588    {
    589       for (int i = 0; i < m_fields.Count(); ++i)
     589      for (int i = 0; i < m_fields.count(); ++i)
    590590      {
    591591        ibox2 area = m_fields[i]->GetArea();
     
    610610      {
    611611        ++m_active;
    612       } while (m_active < m_fields.Count() && !m_fields[m_active]->selectable());
    613 
    614       if (m_active >= m_fields.Count())
     612      } while (m_active < m_fields.count() && !m_fields[m_active]->selectable());
     613
     614      if (m_active >= m_fields.count())
    615615        m_active = -1;
    616616      if (m_active >= 0)
     
    646646    if (m_owner)
    647647        m_surf = m_owner->m_surf;
    648     for (int i = 0; i < m_fields.Count(); ++i)
     648    for (int i = 0; i < m_fields.count(); ++i)
    649649        m_fields[i]->draw_first(m_surf);
    650650    if (m_active >= 0)
     
    661661    m_fields = fields;
    662662    m_active = -1;
    663     for (int i = 0; i < m_fields.Count(); ++i)
     663    for (int i = 0; i < m_fields.count(); ++i)
    664664        if (m_fields[i]->selectable())
    665665        {
     
    681681    m_fields = fields;
    682682    m_active = -1;
    683     for (int i = 0; i < m_fields.Count(); ++i)
     683    for (int i = 0; i < m_fields.count(); ++i)
    684684        if (m_fields[i]->selectable())
    685685        {
     
    691691void InputManager::grab_focus(AWidget *f)
    692692{
    693     for (int i = 0; i < m_fields.Count(); ++i)
     693    for (int i = 0; i < m_fields.count(); ++i)
    694694        if (f == m_fields[i])
    695695            m_grab = i;
     
    707707void InputManager::remap(Filter *f)
    708708{
    709     for (int i = 0; i < m_fields.Count(); ++i)
     709    for (int i = 0; i < m_fields.count(); ++i)
    710710        m_fields[i]->remap(f);
    711711    redraw();
     
    720720AWidget *InputManager::get(int id)
    721721{
    722     for (int i = 0; i < m_fields.Count(); ++i)
     722    for (int i = 0; i < m_fields.count(); ++i)
    723723    {
    724724        AWidget *ret = m_fields[i]->find(id);
  • abuse/branches/lol/src/level.cpp

    r732 r737  
    844844  bg_width=nbw;
    845845
    846   String msg = String::Printf("Level %s size now %d %d\n", GetName().C(),
     846  String msg = String::format("Level %s size now %d %d\n", GetName().C(),
    847847                              foreground_width(), foreground_height());
    848848  the_game->show_help(msg.C());
     
    12661266    fp->seek(e->offset, 0);
    12671267    int len = fp->read_uint8(); // read the length of the string
    1268     m_first_name.Resize(len);
     1268    m_first_name.resize(len);
    12691269    fp->read(m_first_name.C(), len); // read the string
    12701270  }
     
    14241424String get_prof_assoc_filename(String const &filename)
    14251425{
    1426     int dot = filename.LastIndexOf('.');
    1427     return (dot == -1 ? filename : filename.Sub(0, dot)) + ".cpf";
     1426    int dot = filename.last_index_of('.');
     1427    return (dot == -1 ? filename : filename.sub(0, dot)) + ".cpf";
    14281428}
    14291429
    14301430void Level::level_loaded_notify()
    14311431{
    1432   String n = m_first_name.Count() ? m_first_name : m_name;
    1433   if (n.Sub(0, 12) == "levels/level")
     1432  String n = m_first_name.count() ? m_first_name : m_name;
     1433  if (n.sub(0, 12) == "levels/level")
    14341434  {
    14351435    char nm[100];
     
    14701470  SpecDir sd;
    14711471  sd.add_by_hand(new SpecEntry(SPEC_DATA_ARRAY, "Copyright 1995 Crack dot Com, All Rights reserved", NULL, 0, 0));
    1472   if (m_first_name.Count())
     1472  if (m_first_name.count())
    14731473    sd.add_by_hand(new SpecEntry(SPEC_DATA_ARRAY, "first name",
    1474                                  NULL, m_first_name.Count() + 2, 0));
     1474                                 NULL, m_first_name.count() + 2, 0));
    14751475
    14761476
     
    15871587  i->clear();
    15881588  scale_put(im,i,0,0,160,100);
    1589   if (m_first_name.Count())
    1590     wm->font()->PutString(i, ivec2(80 - m_first_name.Count() * wm->font()->Size().x / 2, 100), m_first_name.C());
     1589  if (m_first_name.count())
     1590    wm->font()->PutString(i, ivec2(80 - m_first_name.count() * wm->font()->Size().x / 2, 100), m_first_name.C());
    15911591
    15921592  time_t t;
     
    20932093  if (cache.prof_is_on())
    20942094  {
    2095     String pf_name = get_prof_assoc_filename(m_first_name.Count()
     2095    String pf_name = get_prof_assoc_filename(m_first_name.count()
    20962096                                              ? m_name : m_first_name);
    20972097
     
    21172117  {
    21182118    // get cache info from orignal filename if this is a savegame
    2119     String pf_name = get_prof_assoc_filename(m_first_name.Count()
     2119    String pf_name = get_prof_assoc_filename(m_first_name.count()
    21202120                                              ? m_name : m_first_name);
    21212121
     
    21812181        if( !fp->open_failure() )
    21822182        {
    2183             if( m_first_name.Count() )
     2183            if( m_first_name.count() )
    21842184            {
    2185                 fp->write_uint8(m_first_name.Count() + 1);
    2186                 fp->write(m_first_name.C(), m_first_name.Count() + 1);
     2185                fp->write_uint8(m_first_name.count() + 1);
     2186                fp->write(m_first_name.C(), m_first_name.count() + 1);
    21872187            }
    21882188            else
  • abuse/branches/lol/src/level.h

    r724 r737  
    7979    String const & GetOriginalName() const
    8080    {
    81         if (m_first_name.Count())
     81        if (m_first_name.count())
    8282            return m_first_name;
    8383        return m_name;
  • abuse/branches/lol/src/light.cpp

    r732 r737  
    408408             && p2.x <= p->m_p2.x && p2.y <= p->m_p2.y)
    409409        {
    410             if (p->m_lights.Count() == MAX_LP)
     410            if (p->m_lights.count() == MAX_LP)
    411411                return;
    412412
     
    454454            InsertLight(first, p);
    455455
    456             p->m_lights.Push(who);
     456            p->m_lights.push(who);
    457457            return;
    458458        }
     
    470470                AddLight(first, ivec2(p->m_p1.x, p->m_p2.y + 1), ivec2(p->m_p2.x, p2.y), who);
    471471
    472             if (p->m_lights.Count() < MAX_LP)
    473                 p->m_lights.Push(who);
     472            if (p->m_lights.count() < MAX_LP)
     473                p->m_lights.push(who);
    474474
    475475            return;
     
    536536    int lv = min_light_level;
    537537
    538     for (int i = 0; i < lp->m_lights.Count(); ++i)
     538    for (int i = 0; i < lp->m_lights.count(); ++i)
    539539    {
    540540        LightSource *l = lp->m_lights[i];
  • abuse/branches/lol/src/loader2.cpp

    r732 r737  
    120120    delete fp;
    121121
    122     for (int i = 0; i < sd.m_entries.Count(); i++)
     122    for (int i = 0; i < sd.m_entries.count(); i++)
    123123    {
    124124      SpecEntry *se = sd.m_entries[i];
     
    144144        backtiles=(int *)realloc(backtiles,sizeof(int)*(nbacktiles+bt));
    145145
    146       for (int i = 0; i < sd.m_entries.Count(); i++)
     146      for (int i = 0; i < sd.m_entries.count(); i++)
    147147      {
    148148    if (sd.m_entries[i]->type==SPEC_FORETILE)
     
    185185      SpecDir sd(fp);
    186186      delete fp;
    187       for (int i = 0; i < sd.m_entries.Count(); i++)
     187      for (int i = 0; i < sd.m_entries.count(); i++)
    188188      {
    189189        SpecEntry *spe = sd.m_entries[i];
     
    231231      delete fp;
    232232
    233       for (int i = 0; i < sd.m_entries.Count(); i++)
     233      for (int i = 0; i < sd.m_entries.count(); i++)
    234234      {
    235235        SpecEntry *spe = sd.m_entries[i];
  • abuse/branches/lol/src/netcfg.cpp

    r736 r737  
    341341  {
    342342    list << center_ifield(new ATextField(ivec2(x, y + 30), NET_NAME, symbol_str("your_name"), "************************", name), x, x + ns_w, nullptr);
    343     list << center_ifield(new ATextField(ivec2(0, 0), NET_SERVER_NAME, symbol_str("server_name"), "************************", game_name), x, x + ns_w, list.Last());
    344     list << center_ifield(new AInfoField(ivec2(0, 0), 0, symbol_str("min_play")), x, x + ns_w, list.Last());
     343    list << center_ifield(new ATextField(ivec2(0, 0), NET_SERVER_NAME, symbol_str("server_name"), "************************", game_name), x, x + ns_w, list.last());
     344    list << center_ifield(new AInfoField(ivec2(0, 0), 0, symbol_str("min_play")), x, x + ns_w, list.last());
    345345
    346346    AButtonBox *b = new AButtonBox(ivec2(0, 0), NET_MIN, 1);
     
    356356    b->add_button(new AButton(ivec2(0, 0), MIN_1,"1"));
    357357    b->arrange_left_right();
    358     center_ifield(b, x, x + ns_w, list.Last());
     358    center_ifield(b, x, x + ns_w, list.last());
    359359    b->arrange_left_right();
    360360    list << b;
    361361
    362     list << center_ifield(new AInfoField(ivec2(0, 0), 0, symbol_str("max_play")), x, x + ns_w, list.Last());
     362    list << center_ifield(new AInfoField(ivec2(0, 0), 0, symbol_str("max_play")), x, x + ns_w, list.last());
    363363
    364364    b = new AButtonBox(ivec2(0, 0), NET_MAX, 1);
     
    373373    b->add_button(new AButton(ivec2(0, 0), MAX_2, "2"));
    374374    b->arrange_left_right();
    375     center_ifield(b, x, x + ns_w, list.Last());
     375    center_ifield(b, x, x + ns_w, list.last());
    376376    b->arrange_left_right();
    377377    list << b;
    378378
    379     list << center_ifield(new AInfoField(ivec2(0, 0), 0, symbol_str("level_size")), x, x + ns_w, list.Last());
     379    list << center_ifield(new AInfoField(ivec2(0, 0), 0, symbol_str("level_size")), x, x + ns_w, list.last());
    380380
    381381    b = new AButtonBox(ivec2(0, 0), LEVEL_BOX, 1);
     
    386386    b->add_button(q);
    387387    b->arrange_left_right();
    388     center_ifield(b, x, x + ns_w, list.Last());
     388    center_ifield(b, x, x + ns_w, list.last());
    389389    b->arrange_left_right();
    390390    list << b;
    391391
    392     list << center_ifield(new ATextField(ivec2(0, 0), NET_KILLS, symbol_str("kills_to_win"), "***", "25"), x, x + ns_w, list.Last());
     392    list << center_ifield(new ATextField(ivec2(0, 0), NET_KILLS, symbol_str("kills_to_win"), "***", "25"), x, x + ns_w, list.last());
    393393  }
    394394  else
  • abuse/branches/lol/src/particle.cpp

    r732 r737  
    107107  frames=(int *)malloc(sizeof(int)*tframes);
    108108
    109   for (int i = 0, j = 0; i < sd.m_entries.Count(); i++)
     109  for (int i = 0, j = 0; i < sd.m_entries.count(); i++)
    110110    if (sd.m_entries[i]->type == SPEC_PARTICLE)
    111111      frames[j++] = cache.reg(fn, sd.m_entries[i]->name, SPEC_PARTICLE, 1);
  • 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
  • abuse/branches/lol/src/sdlport/sound.cpp

    r734 r737  
    188188    music = NULL;
    189189
    190     String realname = String::Printf("%s%s", get_filename_prefix(), m_name.C());
     190    String realname = String::format("%s%s", get_filename_prefix(), m_name.C());
    191191
    192192    uint32_t data_size;
  • abuse/branches/lol/src/sdlport/video.cpp

    r732 r737  
    5050
    5151    /* Temporary screen buffer */
    52     g_screen.Resize(xres * yres);
     52    g_screen.resize(xres * yres);
    5353
    5454    // Create the screen image
     
    124124    int h = ye - srcy;
    125125
    126     dpixel = g_screen.Data() + x + y * xres;
     126    dpixel = g_screen.data() + x + y * xres;
    127127
    128128    // Update surface part
  • abuse/branches/lol/src/specache.cpp

    r732 r737  
    3939    for (FileNode *f = m_list; f; f = f->m_next)
    4040    {
    41         uint8_t len = f->m_name.Count() + 1;
     41        uint8_t len = f->m_name.count() + 1;
    4242        fp->write(&len, 1);
    4343        fp->write(f->m_name.C(), len);
     
    7474    m_list = f;
    7575
    76     m_size += f->m_sd->m_data.Count();
     76    m_size += f->m_sd->m_data.count();
    7777    if (parent)
    7878        *parent = f;
  • abuse/branches/lol/src/tool/abuse-tool.cpp

    r732 r737  
    131131        dir.FullyLoad(&fp);
    132132
    133         for (int i = 0; i < dir.m_entries.Count(); i++)
     133        for (int i = 0; i < dir.m_entries.count(); i++)
    134134        {
    135135            SpecEntry *se = dir.m_entries[i];
     
    210210        int id = atoi(argv[3]);
    211211
    212         if (id < 0 || id >= dir.m_entries.Count())
     212        if (id < 0 || id >= dir.m_entries.count())
    213213        {
    214214            fprintf(stderr, "abuse-tool: id %i not found in %s\n", id, file);
     
    235235        int palid = argc > 4 ? atoi(argv[4]) : -1;
    236236
    237         for (int i = 0; palid == -1 && i < dir.m_entries.Count(); i++)
     237        for (int i = 0; palid == -1 && i < dir.m_entries.count(); i++)
    238238            if (dir.m_entries[i]->type == SPEC_PALETTE)
    239239                palid = i;
     
    255255        int dst = atoi(argv[4]);
    256256
    257         if (src < 0 || src >= dir.m_entries.Count()
    258              || dst < 0 || dst >= dir.m_entries.Count())
     257        if (src < 0 || src >= dir.m_entries.count()
     258             || dst < 0 || dst >= dir.m_entries.count())
    259259        {
    260260            fprintf(stderr, "abuse-tool: ids %i/%i out of range\n", src, dst);
     
    273273        int id = atoi(argv[3]);
    274274
    275         if (id < 0 || id >= dir.m_entries.Count())
     275        if (id < 0 || id >= dir.m_entries.count())
    276276        {
    277277            fprintf(stderr, "abuse-tool: id %i out of range\n", id);
     
    289289        int id = atoi(argv[3]);
    290290
    291         if (id < 0 || id >= dir.m_entries.Count())
     291        if (id < 0 || id >= dir.m_entries.count())
    292292        {
    293293            fprintf(stderr, "abuse-tool: id %i out of range\n", id);
     
    295295        }
    296296
    297         dir.m_entries.Remove(id);
     297        dir.m_entries.remove(id);
    298298        dir.FullyLoad(&fp);
    299299    }
     
    304304
    305305        if (id == -1)
    306             id = dir.m_entries.Count();
    307 
    308         if (id < 0 || id > dir.m_entries.Count())
     306            id = dir.m_entries.count();
     307
     308        if (id < 0 || id > dir.m_entries.count())
    309309        {
    310310            fprintf(stderr, "abuse-tool: id %i out of range\n", id);
     
    314314        dir.FullyLoad(&fp);
    315315
    316         dir.m_entries.Resize(dir.m_entries.Count() + 1);
    317         for (int i = dir.m_entries.Count() - 1; i-- > id; )
     316        // FIXME: use insert() here!
     317        dir.m_entries.resize(dir.m_entries.count() + 1);
     318        for (int i = dir.m_entries.count() - 1; i-- > id; )
    318319            dir.m_entries[i + 1] = dir.m_entries[i];
    319320
     
    368369    fp.seek(0, SEEK_SET); // FIXME: create a new file
    369370    dir.write(&fp);
    370     for (int i = 0; i < dir.m_entries.Count(); i++)
     371    for (int i = 0; i < dir.m_entries.count(); i++)
    371372        fp.write(dir.m_entries[i]->data, dir.m_entries[i]->size);
    372373
  • abuse/branches/lol/src/unixnfc.cpp

    r732 r737  
    583583        else if (ev.type!=EV_MOUSE_MOVE)  // no need to save mouse move events (likely to be a lot)
    584584        {
    585           input.Push(ev);
     585          input.push(ev);
    586586        }
    587587      } while (wm->event_waiting());
     
    595595    {
    596596      wm->close_window(abort);
    597       while (input.Count())               // push all the key events
    598         wm->push_event(input.Pop());
     597      while (input.count())               // push all the key events
     598        wm->push_event(input.pop());
    599599    }
    600600  }
Note: See TracChangeset for help on using the changeset viewer.