void fsPrim::init2(PrimMode prim_mode, bool is_share_data, PrimData* prim_data, u16 max_data_num, fsID scr_id, fsDraw* parent) { if (m_rend) { m_rend->uninit(); } m_private_flag.setOn(FLAG_INITIALIZED); setPrimMode(prim_mode); if (is_share_data) { if (!prim_data || max_data_num == 0) { fsThrow(ExceptionInvalidArgument); } if (m_prim_data && !m_is_share_data.getType()) { fsDeleteArray(m_prim_data, PrimData); } m_is_share_data = true; m_prim_data = const_cast<PrimData*>(prim_data); m_max_data_num = max_data_num; } else { if (m_prim_data && m_is_share_data.getType()) { m_prim_data = NULL; m_max_data_num = 0; } m_is_share_data = false; reallocData(max_data_num); } setCurDataNum(max_data_num); setTextureID(fsID::ZERO); if (parent) { setParent(parent); } else { setScreenID(scr_id); } }
void aappend(Array *array, int index, void *element) { if (index < 0 || index > array->size) return; if (index + 1 >= array->capacity) { reallocData(array); } int i; for (i = array->size - 1; i >= index; i--) { array->data[i + 1] = array->data[i]; } array->data[index] = element; array->size++; }
operator+=(QChar) { if (d->ref.isShared() || d->alloc) reallocData(); d->data()[d->size++] = 0; d->data()[0] = '\0'; }