Changeset 737
- Timestamp:
- May 1, 2015, 1:11:31 PM (8 years ago)
- Location:
- abuse/branches/lol/src
- Files:
-
- 29 edited
Legend:
- Unmodified
- Added
- Removed
-
abuse/branches/lol/src/ant.cpp
r732 r737 459 459 460 460 String const &name = g_current_level->GetOriginalName(); 461 ASSERT(name. Count() > (int)strlen(".spe") + 2,461 ASSERT(name.count() > (int)strlen(".spe") + 2, 462 462 "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); 464 464 465 465 String msg = symbol_str("lev_complete"); … … 474 474 msg += name; 475 475 476 int w = wm->font()->Size().x * msg. Count(),476 int w = wm->font()->Size().x * msg.count(), 477 477 h = wm->font()->Size().y; 478 478 int x=(x1+x2)/2-w/2,y=(y1+y2)/2-h/2; -
abuse/branches/lol/src/cache.cpp
r732 r737 52 52 int CrcManager::write_crc_file(char const *filename) // return 0 on failure 53 53 { 54 String msg = String:: Printf("%s", symbol_str("calc_crc"));54 String msg = String::format("%s", symbol_str("calc_crc")); 55 55 if (stat_man) 56 56 stat_man->push(msg.C(), NULL); 57 57 58 58 int total = 0; 59 for (int i = 0; i < m_files. Count(); ++i)59 for (int i = 0; i < m_files.count(); ++i) 60 60 { 61 61 int failed = 0; … … 75 75 76 76 if (stat_man) 77 stat_man->update(i * 100 / m_files. Count());77 stat_man->update(i * 100 / m_files.count()); 78 78 } 79 79 if (stat_man) … … 86 86 fp.write_uint16(total); 87 87 88 for (int i = 0; i < m_files. Count(); ++i)88 for (int i = 0; i < m_files.count(); ++i) 89 89 { 90 90 int failed = 0; … … 94 94 fp.write_uint32(crc); 95 95 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); 98 98 } 99 99 } … … 113 113 uint32_t crc = fp.read_uint32(); 114 114 uint8_t len = fp.read_uint8(); 115 name. Resize(len);115 name.resize(len); 116 116 fp.read(name.C(), len); 117 117 set_crc(GetFileNumber(name), crc); … … 123 123 void CrcManager::clean_up() 124 124 { 125 for (int i = 0; i < m_files. Count(); ++i)125 for (int i = 0; i < m_files.count(); ++i) 126 126 delete m_files[i]; 127 m_files. Empty();127 m_files.empty(); 128 128 } 129 129 … … 145 145 int CrcManager::GetFileNumber(String const &name) 146 146 { 147 for (int i = 0; i < m_files. Count(); ++i)147 for (int i = 0; i < m_files.count(); ++i) 148 148 if (name == m_files[i]->m_name) 149 149 return i; 150 150 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; 153 153 } 154 154 … … 218 218 size += 2; // total filenames 219 219 for (int i = 0; i < crc_manager.total_filenames(); i++) 220 size += crc_manager.GetFileName(i). Count() + 2; // filename + 0 + size of string220 size += crc_manager.GetFileName(i).count() + 2; // filename + 0 + size of string 221 221 222 222 size += 4; // number of entries saved … … 245 245 { 246 246 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); 249 249 } 250 250 … … 698 698 if (fp->open_failure()) 699 699 { 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()); 701 701 delete fp; 702 702 exit(0); -
abuse/branches/lol/src/cache.h
r729 r737 50 50 void set_crc(int filenumber, uint32_t crc); 51 51 void clean_up(); 52 int total_filenames() { return m_files. Count(); }52 int total_filenames() { return m_files.count(); } 53 53 int write_crc_file(char const *filename); 54 54 int load_crc_file(char const *filename); -
abuse/branches/lol/src/demo.cpp
r732 r737 74 74 the_game->load_level(name.C()); 75 75 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); 78 78 79 79 uint8_t difficulty = 3; -
abuse/branches/lol/src/dev.cpp
r735 r737 154 154 { 155 155 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); 157 157 wm->font()->PutString(screen, m_pos + ivec2(30, 1), st, wm->bright_color()); 158 158 if (player_list) … … 1346 1346 { 1347 1347 String tmp = figures[o->otype]->fields[i]->descript_name; 1348 while (tmp. Count() < maxl)1348 while (tmp.count() < maxl) 1349 1349 tmp += ' '; 1350 1350 widgets << new ATextField(ivec2(wl, wh), DEV_AI_FIGURES + i, tmp.C(), "######", … … 1994 1994 if (g_current_level->save(g_current_level->GetName().C(), 0)) 1995 1995 { 1996 String msg = String:: Printf(symbol_str("saved_level"),1996 String msg = String::format(symbol_str("saved_level"), 1997 1997 g_current_level->GetName().C()); 1998 1998 the_game->show_help(msg.C()); -
abuse/branches/lol/src/game.cpp
r733 r737 2325 2325 m_vdecl = new VertexDeclaration(VertexStream<vec2>(VertexUsage::Position)); 2326 2326 2327 m_vbo = new VertexBuffer(m_vertices. Bytes());2327 m_vbo = new VertexBuffer(m_vertices.bytes()); 2328 2328 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()); 2330 2330 m_vbo->Unlock(); 2331 2331 … … 2333 2333 } 2334 2334 2335 if (g_screen. Count())2335 if (g_screen.count()) 2336 2336 { 2337 2337 m_screen->Bind(); 2338 m_screen->SetData(g_screen. Data());2338 m_screen->SetData(g_screen.data()); 2339 2339 } 2340 2340 -
abuse/branches/lol/src/gui.cpp
r736 r737 29 29 { 30 30 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; 32 32 act = 0; 33 for (int i = 0; i < m_buttons. Count(); ++i)33 for (int i = 0; i < m_buttons.count(); ++i) 34 34 m_buttons[i]->m_pos = m_pos; 35 35 } … … 37 37 ibox2 AIconSwitchButton::GetArea() 38 38 { 39 if (!m_buttons. Count())39 if (!m_buttons.count()) 40 40 return ibox2(m_pos, m_pos); 41 41 42 42 ibox2 ret(10000, 10000, -10000, -10000); 43 43 44 for (int i = 0; i < m_buttons. Count(); ++i)44 for (int i = 0; i < m_buttons.count(); ++i) 45 45 { 46 46 ibox2 tmp = m_buttons[i]->GetArea(); … … 54 54 AWidget *AIconSwitchButton::unlink(int id) 55 55 { 56 for (int i = 0; i < m_buttons. Count(); ++i)56 for (int i = 0; i < m_buttons.count(); ++i) 57 57 { 58 58 if (m_buttons[i]->m_id == id) 59 59 { 60 60 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()) 63 63 m_current = 0; 64 64 return ret; … … 77 77 { 78 78 ++m_current; 79 if (m_current >= m_buttons. Count())79 if (m_current >= m_buttons.count()) 80 80 m_current = 0; 81 81 m_buttons[m_current]->Draw(act, screen); … … 153 153 AIconSwitchButton::~AIconSwitchButton() 154 154 { 155 for (int i = 0; i < m_buttons. Count(); ++i)155 for (int i = 0; i < m_buttons.count(); ++i) 156 156 delete m_buttons[i]; 157 m_buttons. Empty();157 m_buttons.empty(); 158 158 } 159 159 -
abuse/branches/lol/src/imlib/filter.cpp
r732 r737 22 22 ASSERT(colors >= 0 && colors <= 256, "bad color count"); 23 23 24 m_table. Resize(colors, 0);24 m_table.resize(colors, 0); 25 25 } 26 26 … … 29 29 { 30 30 int size = lol::max(from->Count(), to->Count()); 31 m_table. Resize(size);31 m_table.resize(size); 32 32 33 33 int dk = to->FindDarkest(1); … … 52 52 void Filter::Set(int color_num, int change_to) 53 53 { 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"); 55 55 56 56 m_table[color_num] = change_to; … … 106 106 int mul = 1 << (8 - color_bits); 107 107 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); 109 109 110 110 /* For each colour in the RGB cube, find the nearest palette element. */ … … 134 134 fp->seek(e->offset, 0); 135 135 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()); 138 138 } 139 139 … … 144 144 size_t ColorFilter::DiskUsage() 145 145 { 146 return sizeof(uint16_t) + m_table. Bytes();146 return sizeof(uint16_t) + m_table.bytes(); 147 147 } 148 148 … … 150 150 { 151 151 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(); 153 153 } 154 154 -
abuse/branches/lol/src/imlib/fonts.cpp
r732 r737 21 21 void JCFont::PutString(AImage *screen, ivec2 pos, String const &st, int color) 22 22 { 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) 24 24 PutChar(screen, pos, st[i], color); 25 25 } -
abuse/branches/lol/src/imlib/image.cpp
r732 r737 34 34 { 35 35 m_size = size; 36 m_data. Resize(m_size.x * m_size.y);36 m_data.resize(m_size.x * m_size.y); 37 37 } 38 38 39 39 AImage::~AImage() 40 40 { 41 for (int i = image_list. Count(); i--; )41 for (int i = image_list.count(); i--; ) 42 42 if (image_list[i] == this) 43 image_list. RemoveSwap(i);43 image_list.remove_swap(i); 44 44 45 45 delete m_special; … … 70 70 m_size = size; 71 71 m_special = NULL; 72 m_data. Resize(m_size.x * m_size.y);72 m_data.resize(m_size.x * m_size.y); 73 73 if (create_descriptor) 74 74 m_special = new image_descriptor(size, create_descriptor == 2); 75 image_list. Push(this);75 image_list.push(this); 76 76 } 77 77 … … 83 83 m_size.y = fp->read_uint16(); 84 84 m_special = NULL; 85 m_data. Resize(m_size.x * m_size.y);85 m_data.resize(m_size.x * m_size.y); 86 86 for (int i = 0; i < m_size.y; i++) 87 87 fp->read(scan_line(i), m_size.x); 88 image_list. Push(this);88 image_list.push(this); 89 89 } 90 90 91 91 void image_uninit() 92 92 { 93 while (image_list. Count())93 while (image_list.count()) 94 94 delete image_list[0]; 95 95 } … … 329 329 void image_descriptor::ReduceDirties() 330 330 { 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) 334 334 { 335 335 m_dirties[0].m_aa = lol::min(m_dirties[0].m_aa, m_dirties[i].m_aa); … … 337 337 } 338 338 339 m_dirties. Resize(1);339 m_dirties.resize(1); 340 340 } 341 341 } … … 354 354 return; 355 355 356 for (int i = m_dirties. Count(); i--; )356 for (int i = m_dirties.count(); i--; ) 357 357 { 358 358 ADirtyRect &rect = m_dirties[i]; … … 366 366 { 367 367 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); 369 369 else if (bb.y >= rect.m_bb.y + 1) 370 370 rect.m_bb.y = aa.y - 1; … … 430 430 m_dirties << ADirtyRect(ivec2(rect.m_aa.x, bb.y), rect.m_bb); 431 431 432 m_dirties. RemoveSwap(i);432 m_dirties.remove_swap(i); 433 433 } 434 434 } … … 449 449 array<ADirtyRect> to_add; 450 450 451 for (int i = m_dirties. Count(); i--; )451 for (int i = m_dirties.count(); i--; ) 452 452 { 453 453 ADirtyRect &rect = m_dirties[i]; … … 457 457 && bb.x >= rect.m_bb.x + 1 && bb.y >= rect.m_bb.y + 1) 458 458 { 459 m_dirties. RemoveSwap(i);459 m_dirties.remove_swap(i); 460 460 } 461 461 else if (bb.x - 1 >= rect.m_aa.x && bb.y - 1 >= rect.m_aa.y … … 476 476 } 477 477 478 for (int i = 0; i < to_add. Count(); ++i)478 for (int i = 0; i < to_add.count(); ++i) 479 479 AddDirty(to_add[i].m_aa, to_add[i].m_bb); 480 480 … … 482 482 m_dirties << ADirtyRect(aa, bb - ivec2(1)); 483 483 484 if (m_dirties. Count() >= MAX_DIRTY)484 if (m_dirties.count() >= MAX_DIRTY) 485 485 ReduceDirties(); // reduce to one dirty rectangle, we have too many 486 486 } … … 591 591 592 592 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); 594 594 595 595 uint8_t *sl1, *sl2; -
abuse/branches/lol/src/imlib/image.h
r729 r737 116 116 //return &m_data[y * m_size.x]; 117 117 118 return m_data. Data() + y * m_size.x;118 return m_data.data() + y * m_size.x; 119 119 } 120 120 AImage *copy(); // makes a copy of an image -
abuse/branches/lol/src/imlib/input.cpp
r736 r737 35 35 void AButtonBox::remap(Filter *f) 36 36 { 37 for (int i = 0; i < m_buttons. Count(); ++i)37 for (int i = 0; i < m_buttons.count(); ++i) 38 38 m_buttons[i]->remap(f); 39 39 } … … 44 44 return this; 45 45 46 for (int i = 0; i < m_buttons. Count(); ++i)46 for (int i = 0; i < m_buttons.count(); ++i) 47 47 if (id == m_buttons[i]->m_id) 48 48 return m_buttons[i]; … … 57 57 m_buttons = buttons; 58 58 maxdown = MaxDown; 59 if (m_buttons. Count() && maxdown)59 if (m_buttons.count() && maxdown) 60 60 m_buttons[0]->push(); // the first button is automatically selected! 61 61 } … … 63 63 AButtonBox::~AButtonBox() 64 64 { 65 for (int i = 0; i < m_buttons. Count(); ++i)65 for (int i = 0; i < m_buttons.count(); ++i) 66 66 delete m_buttons[i]; 67 67 } … … 70 70 { 71 71 ibox2 ret; 72 for (int i = 0; i < m_buttons. Count(); ++i)72 for (int i = 0; i < m_buttons.count(); ++i) 73 73 { 74 74 ibox2 area = m_buttons[i]->GetArea(); … … 86 86 void AButtonBox::draw_first(AImage *screen) 87 87 { 88 for (int i = 0; i < m_buttons. Count(); ++i)88 for (int i = 0; i < m_buttons.count(); ++i) 89 89 m_buttons[i]->draw_first(screen); 90 90 } … … 97 97 void AButtonBox::Move(ivec2 pos) 98 98 { 99 for (int i = 0; i < m_buttons. Count(); ++i)99 for (int i = 0; i < m_buttons.count(); ++i) 100 100 m_buttons[i]->Move(pos + m_buttons[i]->m_pos); 101 101 m_pos = pos; … … 104 104 char const *AButtonBox::read() 105 105 { 106 for (int i = 0; i < m_buttons. Count(); ++i)106 for (int i = 0; i < m_buttons.count(); ++i) 107 107 if (*((int const *)m_buttons[i]->read()) == 0) 108 108 return (char const *)m_buttons[i]; … … 117 117 case EV_MOUSE_BUTTON: 118 118 // 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) 120 120 { 121 121 ibox2 area = m_buttons[i]->GetArea(); … … 125 125 126 126 int total = 0; 127 for (int j = 0; j < m_buttons. Count(); ++j)127 for (int j = 0; j < m_buttons.count(); ++j) 128 128 if (*((int const *)m_buttons[j]->read()) == 0) 129 129 total++; … … 131 131 if (*((int const *)m_buttons[i]->read()) == 0) // did the user press or release the button 132 132 { 133 for (int j = 0; j < m_buttons. Count() && total > maxdown; ++j)133 for (int j = 0; j < m_buttons.count() && total > maxdown; ++j) 134 134 if ((i != j || maxdown == 0) && *((int const *)m_buttons[j]->read()) == 0) 135 135 { … … 156 156 void AButtonBox::add_button(AButton *b) 157 157 { 158 m_buttons. Push(b);158 m_buttons.push(b); 159 159 } 160 160 … … 162 162 { 163 163 ivec2 on = m_pos; 164 for (int i = 0; i < m_buttons. Count(); ++i)164 for (int i = 0; i < m_buttons.count(); ++i) 165 165 { 166 166 ibox2 area = m_buttons[i]->GetArea(); … … 173 173 { 174 174 ivec2 on = m_pos; 175 for (int i = 0; i < m_buttons. Count(); ++i)175 for (int i = 0; i < m_buttons.count(); ++i) 176 176 { 177 177 ibox2 area = m_buttons[i]->GetArea(); … … 192 192 return ibox2(m_pos, m_pos + pressed->Size() - ivec2(1)); 193 193 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)); 196 196 197 197 return ibox2(m_pos, m_pos + visual->Size() + ivec2(6)); … … 407 407 } 408 408 409 if ((up && m_text. Count()) || (!up && !visual))409 if ((up && m_text.count()) || (!up && !visual)) 410 410 { 411 411 wm->font()->PutString(screen, m_pos + ivec2(4, 5), m_text, wm->black()); -
abuse/branches/lol/src/imlib/palette.cpp
r732 r737 27 27 { 28 28 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); 31 31 set_all_unused(); 32 fp->read(m_colors. Data(), m_colors.Bytes());32 fp->read(m_colors.data(), m_colors.bytes()); 33 33 bg = 0; 34 34 } … … 38 38 fp->seek(e->offset,0); 39 39 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); 42 42 set_all_unused(); 43 fp->read(m_colors. Data(), m_colors.Bytes());43 fp->read(m_colors.data(), m_colors.bytes()); 44 44 bg = 0; 45 45 } … … 47 47 int Palette::write(bFILE *fp) 48 48 { 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(); 51 51 } 52 52 … … 54 54 { 55 55 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) 57 57 { 58 58 int nd = sqlength((ivec3)(color - m_colors[i])); … … 68 68 int Palette::FindColor(u8vec3 color) const 69 69 { 70 for (int i = 0; i < m_colors. Count(); ++i)70 for (int i = 0; i < m_colors.count(); ++i) 71 71 if (m_used[i] && m_colors[i] == color) 72 72 return i; … … 93 93 void Palette::make_black_white() 94 94 { 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); 98 98 m_colors[i] = u8vec3(c); 99 99 } … … 102 102 void Palette::set_rgbs() 103 103 { 104 ASSERT(m_colors. Count() == 256);104 ASSERT(m_colors.count() == 256); 105 105 106 106 for (int i = 0; i < 64; i++) … … 123 123 void Palette::set_all_used() 124 124 { 125 memset(m_used. Data(), 1, m_used.Bytes());125 memset(m_used.data(), 1, m_used.bytes()); 126 126 } 127 127 128 128 void Palette::set_all_unused() 129 129 { 130 memset(m_used. Data(), 0, m_used.Bytes());130 memset(m_used.data(), 0, m_used.bytes()); 131 131 } 132 132 133 133 Palette *Palette::Copy() const 134 134 { 135 Palette *p = new Palette(m_colors. Count());135 Palette *p = new Palette(m_colors.count()); 136 136 p->m_colors = m_colors; 137 137 p->m_used = m_used; … … 149 149 m_used[0] = 1; 150 150 151 for (int i = 1; i < m_colors. Count(); i++)151 for (int i = 1; i < m_colors.count(); i++) 152 152 m_used[i] = 0; 153 153 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++) 156 156 m_colors[i] = u8vec3(((i >> 5) & 7) * 255 / 7, 157 157 ((i >> 2) & 7) * 255 / 7, 158 158 (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++) 161 161 m_colors[i] = u8vec3(255 - (i & 3), 162 162 255 - ((i & 4) >> 2), 163 163 255 - ((i & 8) >> 3)); 164 164 else 165 for (int i = 0; i < m_colors. Count(); i++)165 for (int i = 0; i < m_colors.count(); i++) 166 166 m_colors[i] = u8vec3(255 - (i % 3), 167 167 255 - ((i + 1) % 3), … … 174 174 { 175 175 int m = -amount; 176 for (int i = 0; i < m_colors. Count(); i++)176 for (int i = 0; i < m_colors.count(); i++) 177 177 { 178 178 u8vec3 c = m_colors[i]; … … 183 183 { 184 184 int m = amount; 185 for (int i = 0; i < m_colors. Count(); i++)185 for (int i = 0; i < m_colors.count(); i++) 186 186 { 187 187 u8vec3 c = m_colors[i]; … … 211 211 ASSERT(number_colors > 0, "Palette::constructor - need at least one color!"); 212 212 213 m_colors. Resize(number_colors);214 m_used. Resize(number_colors);213 m_colors.resize(number_colors); 214 m_used.resize(number_colors); 215 215 defaults(); 216 216 } … … 220 220 int brv = 0, bri = 0; 221 221 222 for (int i = 0; i < m_colors. Count(); ++i)222 for (int i = 0; i < m_colors.count(); ++i) 223 223 { 224 224 if (all || m_used[i]) … … 240 240 int brv = 258, bri = 0; 241 241 242 for (int i = 0; i < m_colors. Count(); ++i)242 for (int i = 0; i < m_colors.count(); ++i) 243 243 { 244 244 if (all || m_used[i]) … … 260 260 // Force to only 256 colours. 261 261 // 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); 264 264 265 265 delete lastl; … … 274 274 void Palette::FadeTo(int total_fades, int fade_on, u8vec3 dest) 275 275 { 276 for (int i = 0; i < m_colors. Count(); i++)276 for (int i = 0; i < m_colors.count(); i++) 277 277 m_colors[i] += u8vec3(ivec3(dest - m_colors[i]) * fade_on / total_fades); 278 278 } -
abuse/branches/lol/src/imlib/palette.h
r729 r737 27 27 Palette *Copy() const; 28 28 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(); } 32 32 33 33 u8vec3 GetColor(int x) const; -
abuse/branches/lol/src/imlib/specs.cpp
r732 r737 573 573 void SpecDir::FullyLoad(bFILE *fp) 574 574 { 575 for (int i = 0; i < m_entries. Count(); ++i)575 for (int i = 0; i < m_entries.count(); ++i) 576 576 { 577 577 SpecEntry *se = m_entries[i]; … … 610 610 611 611 // 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) 613 613 o += 1 + 1 + strlen(m_entries[i]->name) + 1 + 1 + 8; 614 614 615 615 // 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) 617 617 { 618 618 m_entries[i]->offset = o; … … 623 623 SpecEntry *SpecDir::find(char const *name, int type) 624 624 { 625 for (int i = 0; i < m_entries. Count(); ++i)625 for (int i = 0; i < m_entries.count(); ++i) 626 626 if (!strcmp(m_entries[i]->name, name) && m_entries[i]->type == type) 627 627 return m_entries[i]; … … 643 643 int SpecDir::find_number(char const *name) 644 644 { 645 for (int i = 0; i < m_entries. Count(); ++i)645 for (int i = 0; i < m_entries.count(); ++i) 646 646 if (!strcmp(m_entries[i]->name, name)) 647 647 return i; … … 651 651 int SpecDir::find_number(int type) 652 652 { 653 for (int i = 0; i < m_entries. Count(); ++i)653 for (int i = 0; i < m_entries.count(); ++i) 654 654 if (m_entries[i]->type == type) 655 655 return i; … … 660 660 { 661 661 int ret = 0; 662 for (int i = 0; i < m_entries. Count(); ++i)662 for (int i = 0; i < m_entries.count(); ++i) 663 663 if (m_entries[i]->type == type) 664 664 ++ret; … … 669 669 { 670 670 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) 672 672 m_entries[i]->Print(); 673 673 } … … 684 684 { 685 685 int total = fp->read_uint16(); 686 m_entries. Resize(total);686 m_entries.resize(total); 687 687 long start = fp->tell(); 688 688 … … 698 698 } 699 699 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(); 702 702 703 703 fp->seek(start, SEEK_SET); … … 724 724 else 725 725 { 726 m_data. Empty();727 m_entries. Empty();726 m_data.empty(); 727 m_entries.empty(); 728 728 } 729 729 } … … 772 772 long SpecDir::data_start_offset() 773 773 { 774 if (m_entries. Count())774 if (m_entries.count()) 775 775 return m_entries[0]->offset; 776 776 … … 781 781 long SpecDir::data_end_offset() 782 782 { 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; 785 785 786 786 return SPEC_SIG_SIZE + 2; … … 795 795 return 0; 796 796 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) 800 800 { 801 801 if (fp->write(&m_entries[i]->type, 1) != 1) … … 867 867 void SpecDir::remove(SpecEntry *e) 868 868 { 869 for (int i = 0; i < m_entries. Count(); ++i)869 for (int i = 0; i < m_entries.count(); ++i) 870 870 { 871 871 if (m_entries[i] == e) 872 872 { 873 873 delete e; 874 m_entries. Remove(i);874 m_entries.remove(i); 875 875 return; 876 876 } … … 881 881 void SpecDir::add_by_hand(SpecEntry *e) 882 882 { 883 m_entries. Push(e);883 m_entries.push(e); 884 884 } 885 885 886 886 void SpecDir::delete_entries() // if the directory was created by hand instead of by file 887 887 { 888 for (int i = 0; i < m_entries. Count(); ++i)888 for (int i = 0; i < m_entries.count(); ++i) 889 889 delete m_entries[i]; 890 m_entries. Empty();890 m_entries.empty(); 891 891 } 892 892 -
abuse/branches/lol/src/imlib/video.cpp
r732 r737 31 31 else 32 32 { 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) 34 34 { 35 35 ADirtyRect &rect = im->m_special->m_dirties[i]; … … 40 40 } 41 41 42 im->m_special->m_dirties. Resize(0);42 im->m_special->m_dirties.resize(0); 43 43 } 44 44 -
abuse/branches/lol/src/imlib/window.cpp
r736 r737 388 388 389 389 _x1 = left_border(); 390 _y1 = name. Count() ? top_border() : jw_top + 5;390 _y1 = name.count() ? top_border() : jw_top + 5; 391 391 392 392 m_surf = nullptr; … … 411 411 m_surf = new AImage(m_size, 2); 412 412 // Keep this from getting destroyed when image list is cleared 413 image_list. Pop();413 image_list.pop(); 414 414 m_surf->clear(backg); 415 415 inm->m_surf = m_surf; … … 438 438 m_size = ivec2(2); 439 439 440 for (int i = 0; i < inm->m_fields. Count(); ++i)440 for (int i = 0; i < inm->m_fields.count(); ++i) 441 441 { 442 442 inm->m_fields[i]->set_owner(this); … … 531 531 AWidget *InputManager::unlink(int id) 532 532 { 533 for (int i = 0; i < m_fields. Count(); ++i)533 for (int i = 0; i < m_fields.count(); ++i) 534 534 { 535 535 /* Does this item match the ID? */ … … 537 537 { 538 538 AWidget *ret = m_fields[i]; 539 m_fields. Remove(i);539 m_fields.remove(i); 540 540 541 541 if (m_active == i) 542 m_active = m_fields. Count() ? 0 : -1;542 m_active = m_fields.count() ? 0 : -1; 543 543 544 544 return ret; … … 556 556 InputManager::~InputManager() 557 557 { 558 for (int i = 0; i < m_fields. Count(); ++i)558 for (int i = 0; i < m_fields.count(); ++i) 559 559 delete m_fields[i]; 560 m_fields. Empty();560 m_fields.empty(); 561 561 } 562 562 … … 587 587 if ((ev.type==EV_MOUSE_BUTTON && ev.mouse_button==1) || ev.type==EV_MOUSE_MOVE) 588 588 { 589 for (int i = 0; i < m_fields. Count(); ++i)589 for (int i = 0; i < m_fields.count(); ++i) 590 590 { 591 591 ibox2 area = m_fields[i]->GetArea(); … … 610 610 { 611 611 ++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()) 615 615 m_active = -1; 616 616 if (m_active >= 0) … … 646 646 if (m_owner) 647 647 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) 649 649 m_fields[i]->draw_first(m_surf); 650 650 if (m_active >= 0) … … 661 661 m_fields = fields; 662 662 m_active = -1; 663 for (int i = 0; i < m_fields. Count(); ++i)663 for (int i = 0; i < m_fields.count(); ++i) 664 664 if (m_fields[i]->selectable()) 665 665 { … … 681 681 m_fields = fields; 682 682 m_active = -1; 683 for (int i = 0; i < m_fields. Count(); ++i)683 for (int i = 0; i < m_fields.count(); ++i) 684 684 if (m_fields[i]->selectable()) 685 685 { … … 691 691 void InputManager::grab_focus(AWidget *f) 692 692 { 693 for (int i = 0; i < m_fields. Count(); ++i)693 for (int i = 0; i < m_fields.count(); ++i) 694 694 if (f == m_fields[i]) 695 695 m_grab = i; … … 707 707 void InputManager::remap(Filter *f) 708 708 { 709 for (int i = 0; i < m_fields. Count(); ++i)709 for (int i = 0; i < m_fields.count(); ++i) 710 710 m_fields[i]->remap(f); 711 711 redraw(); … … 720 720 AWidget *InputManager::get(int id) 721 721 { 722 for (int i = 0; i < m_fields. Count(); ++i)722 for (int i = 0; i < m_fields.count(); ++i) 723 723 { 724 724 AWidget *ret = m_fields[i]->find(id); -
abuse/branches/lol/src/level.cpp
r732 r737 844 844 bg_width=nbw; 845 845 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(), 847 847 foreground_width(), foreground_height()); 848 848 the_game->show_help(msg.C()); … … 1266 1266 fp->seek(e->offset, 0); 1267 1267 int len = fp->read_uint8(); // read the length of the string 1268 m_first_name. Resize(len);1268 m_first_name.resize(len); 1269 1269 fp->read(m_first_name.C(), len); // read the string 1270 1270 } … … 1424 1424 String get_prof_assoc_filename(String const &filename) 1425 1425 { 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"; 1428 1428 } 1429 1429 1430 1430 void Level::level_loaded_notify() 1431 1431 { 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") 1434 1434 { 1435 1435 char nm[100]; … … 1470 1470 SpecDir sd; 1471 1471 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()) 1473 1473 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)); 1475 1475 1476 1476 … … 1587 1587 i->clear(); 1588 1588 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()); 1591 1591 1592 1592 time_t t; … … 2093 2093 if (cache.prof_is_on()) 2094 2094 { 2095 String pf_name = get_prof_assoc_filename(m_first_name. Count()2095 String pf_name = get_prof_assoc_filename(m_first_name.count() 2096 2096 ? m_name : m_first_name); 2097 2097 … … 2117 2117 { 2118 2118 // 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() 2120 2120 ? m_name : m_first_name); 2121 2121 … … 2181 2181 if( !fp->open_failure() ) 2182 2182 { 2183 if( m_first_name. Count() )2183 if( m_first_name.count() ) 2184 2184 { 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); 2187 2187 } 2188 2188 else -
abuse/branches/lol/src/level.h
r724 r737 79 79 String const & GetOriginalName() const 80 80 { 81 if (m_first_name. Count())81 if (m_first_name.count()) 82 82 return m_first_name; 83 83 return m_name; -
abuse/branches/lol/src/light.cpp
r732 r737 408 408 && p2.x <= p->m_p2.x && p2.y <= p->m_p2.y) 409 409 { 410 if (p->m_lights. Count() == MAX_LP)410 if (p->m_lights.count() == MAX_LP) 411 411 return; 412 412 … … 454 454 InsertLight(first, p); 455 455 456 p->m_lights. Push(who);456 p->m_lights.push(who); 457 457 return; 458 458 } … … 470 470 AddLight(first, ivec2(p->m_p1.x, p->m_p2.y + 1), ivec2(p->m_p2.x, p2.y), who); 471 471 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); 474 474 475 475 return; … … 536 536 int lv = min_light_level; 537 537 538 for (int i = 0; i < lp->m_lights. Count(); ++i)538 for (int i = 0; i < lp->m_lights.count(); ++i) 539 539 { 540 540 LightSource *l = lp->m_lights[i]; -
abuse/branches/lol/src/loader2.cpp
r732 r737 120 120 delete fp; 121 121 122 for (int i = 0; i < sd.m_entries. Count(); i++)122 for (int i = 0; i < sd.m_entries.count(); i++) 123 123 { 124 124 SpecEntry *se = sd.m_entries[i]; … … 144 144 backtiles=(int *)realloc(backtiles,sizeof(int)*(nbacktiles+bt)); 145 145 146 for (int i = 0; i < sd.m_entries. Count(); i++)146 for (int i = 0; i < sd.m_entries.count(); i++) 147 147 { 148 148 if (sd.m_entries[i]->type==SPEC_FORETILE) … … 185 185 SpecDir sd(fp); 186 186 delete fp; 187 for (int i = 0; i < sd.m_entries. Count(); i++)187 for (int i = 0; i < sd.m_entries.count(); i++) 188 188 { 189 189 SpecEntry *spe = sd.m_entries[i]; … … 231 231 delete fp; 232 232 233 for (int i = 0; i < sd.m_entries. Count(); i++)233 for (int i = 0; i < sd.m_entries.count(); i++) 234 234 { 235 235 SpecEntry *spe = sd.m_entries[i]; -
abuse/branches/lol/src/netcfg.cpp
r736 r737 341 341 { 342 342 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()); 345 345 346 346 AButtonBox *b = new AButtonBox(ivec2(0, 0), NET_MIN, 1); … … 356 356 b->add_button(new AButton(ivec2(0, 0), MIN_1,"1")); 357 357 b->arrange_left_right(); 358 center_ifield(b, x, x + ns_w, list. Last());358 center_ifield(b, x, x + ns_w, list.last()); 359 359 b->arrange_left_right(); 360 360 list << b; 361 361 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()); 363 363 364 364 b = new AButtonBox(ivec2(0, 0), NET_MAX, 1); … … 373 373 b->add_button(new AButton(ivec2(0, 0), MAX_2, "2")); 374 374 b->arrange_left_right(); 375 center_ifield(b, x, x + ns_w, list. Last());375 center_ifield(b, x, x + ns_w, list.last()); 376 376 b->arrange_left_right(); 377 377 list << b; 378 378 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()); 380 380 381 381 b = new AButtonBox(ivec2(0, 0), LEVEL_BOX, 1); … … 386 386 b->add_button(q); 387 387 b->arrange_left_right(); 388 center_ifield(b, x, x + ns_w, list. Last());388 center_ifield(b, x, x + ns_w, list.last()); 389 389 b->arrange_left_right(); 390 390 list << b; 391 391 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()); 393 393 } 394 394 else -
abuse/branches/lol/src/particle.cpp
r732 r737 107 107 frames=(int *)malloc(sizeof(int)*tframes); 108 108 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++) 110 110 if (sd.m_entries[i]->type == SPEC_PARTICLE) 111 111 frames[j++] = cache.reg(fn, sd.m_entries[i]->name, SPEC_PARTICLE, 1); -
abuse/branches/lol/src/property.cpp
r732 r737 44 44 void Set(int x) 45 45 { 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); 48 49 m_num = x; 49 50 } … … 62 63 APropertyManager::~APropertyManager() 63 64 { 64 for (int i = 0; i < m_props. Count(); ++i)65 for (int i = 0; i < m_props.count(); ++i) 65 66 delete m_props[i]; 66 67 } … … 68 69 AProperty *APropertyManager::find(char const *name) 69 70 { 70 for (int i = 0; i < m_props. Count(); ++i)71 for (int i = 0; i < m_props.count(); ++i) 71 72 if (m_props[i]->m_name == name) 72 73 return m_props[i]; … … 77 78 { 78 79 AProperty *f = find(name); 79 if (!f || f->m_string. Count())80 if (!f || f->m_string.count()) 80 81 return def; 81 82 return f->m_num; … … 85 86 { 86 87 AProperty *f = find(name); 87 if (!f || !f->m_string. Count())88 if (!f || !f->m_string.count()) 88 89 return def; 89 90 return f->m_string.C(); … … 96 97 f->Set((int)def); 97 98 else 98 m_props. Push(new AProperty(name, (int)def));99 m_props.push(new AProperty(name, (int)def)); 99 100 } 100 101 … … 105 106 f->Set(def); 106 107 else 107 m_props. Push(new AProperty(name, def));108 m_props.push(new AProperty(name, def)); 108 109 } 109 110 … … 117 118 } 118 119 119 for (int i = 0; i < m_props. Count(); ++i)120 for (int i = 0; i < m_props.count(); ++i) 120 121 { 121 122 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()) 123 124 fprintf(fp, "\"%s\"\n", m_props[i]->m_string.C()); 124 125 else -
abuse/branches/lol/src/sdlport/sound.cpp
r734 r737 188 188 music = NULL; 189 189 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()); 191 191 192 192 uint32_t data_size; -
abuse/branches/lol/src/sdlport/video.cpp
r732 r737 50 50 51 51 /* Temporary screen buffer */ 52 g_screen. Resize(xres * yres);52 g_screen.resize(xres * yres); 53 53 54 54 // Create the screen image … … 124 124 int h = ye - srcy; 125 125 126 dpixel = g_screen. Data() + x + y * xres;126 dpixel = g_screen.data() + x + y * xres; 127 127 128 128 // Update surface part -
abuse/branches/lol/src/specache.cpp
r732 r737 39 39 for (FileNode *f = m_list; f; f = f->m_next) 40 40 { 41 uint8_t len = f->m_name. Count() + 1;41 uint8_t len = f->m_name.count() + 1; 42 42 fp->write(&len, 1); 43 43 fp->write(f->m_name.C(), len); … … 74 74 m_list = f; 75 75 76 m_size += f->m_sd->m_data. Count();76 m_size += f->m_sd->m_data.count(); 77 77 if (parent) 78 78 *parent = f; -
abuse/branches/lol/src/tool/abuse-tool.cpp
r732 r737 131 131 dir.FullyLoad(&fp); 132 132 133 for (int i = 0; i < dir.m_entries. Count(); i++)133 for (int i = 0; i < dir.m_entries.count(); i++) 134 134 { 135 135 SpecEntry *se = dir.m_entries[i]; … … 210 210 int id = atoi(argv[3]); 211 211 212 if (id < 0 || id >= dir.m_entries. Count())212 if (id < 0 || id >= dir.m_entries.count()) 213 213 { 214 214 fprintf(stderr, "abuse-tool: id %i not found in %s\n", id, file); … … 235 235 int palid = argc > 4 ? atoi(argv[4]) : -1; 236 236 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++) 238 238 if (dir.m_entries[i]->type == SPEC_PALETTE) 239 239 palid = i; … … 255 255 int dst = atoi(argv[4]); 256 256 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()) 259 259 { 260 260 fprintf(stderr, "abuse-tool: ids %i/%i out of range\n", src, dst); … … 273 273 int id = atoi(argv[3]); 274 274 275 if (id < 0 || id >= dir.m_entries. Count())275 if (id < 0 || id >= dir.m_entries.count()) 276 276 { 277 277 fprintf(stderr, "abuse-tool: id %i out of range\n", id); … … 289 289 int id = atoi(argv[3]); 290 290 291 if (id < 0 || id >= dir.m_entries. Count())291 if (id < 0 || id >= dir.m_entries.count()) 292 292 { 293 293 fprintf(stderr, "abuse-tool: id %i out of range\n", id); … … 295 295 } 296 296 297 dir.m_entries. Remove(id);297 dir.m_entries.remove(id); 298 298 dir.FullyLoad(&fp); 299 299 } … … 304 304 305 305 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()) 309 309 { 310 310 fprintf(stderr, "abuse-tool: id %i out of range\n", id); … … 314 314 dir.FullyLoad(&fp); 315 315 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; ) 318 319 dir.m_entries[i + 1] = dir.m_entries[i]; 319 320 … … 368 369 fp.seek(0, SEEK_SET); // FIXME: create a new file 369 370 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++) 371 372 fp.write(dir.m_entries[i]->data, dir.m_entries[i]->size); 372 373 -
abuse/branches/lol/src/unixnfc.cpp
r732 r737 583 583 else if (ev.type!=EV_MOUSE_MOVE) // no need to save mouse move events (likely to be a lot) 584 584 { 585 input. Push(ev);585 input.push(ev); 586 586 } 587 587 } while (wm->event_waiting()); … … 595 595 { 596 596 wm->close_window(abort); 597 while (input. Count()) // push all the key events598 wm->push_event(input. Pop());597 while (input.count()) // push all the key events 598 wm->push_event(input.pop()); 599 599 } 600 600 }
Note: See TracChangeset
for help on using the changeset viewer.