Remove some format rule (#10919)

* remove some rules
* format all codes with new format rule
This commit is contained in:
minggo
2022-05-04 13:09:24 +08:00
committed by GitHub
parent e9a4bdd4dc
commit 271cc5cf23
1148 changed files with 32411 additions and 34416 deletions
@@ -2,10 +2,8 @@
DRAGONBONES_NAMESPACE_BEGIN
void TextureAtlasData::_onClear()
{
for (const auto& pair : textures)
{
void TextureAtlasData::_onClear() {
for (const auto& pair : textures) {
pair.second->returnToPool();
}
@@ -19,8 +17,7 @@ void TextureAtlasData::_onClear()
textures.clear();
}
void TextureAtlasData::copyFrom(const TextureAtlasData& value)
{
void TextureAtlasData::copyFrom(const TextureAtlasData& value) {
autoSearch = value.autoSearch;
format = value.format;
width = value.width;
@@ -29,25 +26,21 @@ void TextureAtlasData::copyFrom(const TextureAtlasData& value)
name = value.name;
imagePath = value.imagePath;
for (const auto& pair : textures)
{
for (const auto& pair : textures) {
pair.second->returnToPool();
}
textures.clear();
for (const auto& pair : value.textures)
{
for (const auto& pair : value.textures) {
const auto texture = createTexture();
texture->copyFrom(*(pair.second));
textures[pair.first] = texture;
}
}
void TextureAtlasData::addTexture(TextureData* value)
{
if (textures.find(value->name) != textures.cend())
{
void TextureAtlasData::addTexture(TextureData* value) {
if (textures.find(value->name) != textures.cend()) {
DRAGONBONES_ASSERT(false, "Same texture: " + value->name);
return;
}
@@ -56,19 +49,15 @@ void TextureAtlasData::addTexture(TextureData* value)
value->parent = this;
}
Rectangle* TextureData::createRectangle()
{
Rectangle* TextureData::createRectangle() {
return new Rectangle();
}
TextureData::~TextureData()
{
TextureData::~TextureData() {
}
void TextureData::_onClear()
{
if (frame != nullptr)
{
void TextureData::_onClear() {
if (frame != nullptr) {
delete frame;
}
@@ -79,25 +68,20 @@ void TextureData::_onClear()
frame = nullptr;
}
void TextureData::copyFrom(const TextureData &value)
{
void TextureData::copyFrom(const TextureData& value) {
rotated = value.rotated;
name = value.name;
region = value.region; // Copy.
parent = value.parent;
if (frame == nullptr && value.frame != nullptr)
{
if (frame == nullptr && value.frame != nullptr) {
frame = TextureData::createRectangle();
}
else if (frame != nullptr && value.frame == nullptr)
{
} else if (frame != nullptr && value.frame == nullptr) {
delete frame;
frame = nullptr;
}
if (frame != nullptr && value.frame != nullptr)
{
if (frame != nullptr && value.frame != nullptr) {
*frame = *(value.frame); // Copy.
}
}