void Image::SetObjectZ(Object* obj, int z){ bool wasSelected = contains(m_objectSelection, obj); Remove(obj); z = std::min(z, resigned(m_objects.size())); m_objects.insert(begin(m_objects) + z, obj); if (wasSelected){ size_t pos = get_sorted_insertion_pos(obj, m_objectSelection, m_objects); m_objectSelection.insert(begin(m_objectSelection) + resigned(pos), obj); } }
void Image::SelectObjects(const objects_t& objects){ for (Object* obj : objects){ if (lacks(m_objectSelection, obj)){ size_t pos = get_sorted_insertion_pos(obj, m_objectSelection, m_objects); m_objectSelection.insert(begin(m_objectSelection) + resigned(pos), obj); } } }
int Image::GetObjectZ(const Object* obj) const{ for (size_t i = 0; i != m_objects.size(); i++){ if (m_objects[i] == obj){ return resigned(i); } } assert(false); return 0; }
int Image::GetNumObjects() const{ return resigned(m_objects.size()); }
ATF_TC_BODY(resigned_bad, tc) { UNUSED(tc); resigned(callback); }
ATF_TC_BODY(resigned, tc) { UNUSED(tc); resigned(NULL); }