1
0
mirror of https://github.com/luanti-org/luanti.git synced 2025-10-13 08:35:20 +02:00

Remove std::shared_ptr use in TileLayer (#10090)

This commit is contained in:
sfan5
2020-07-10 12:11:44 +02:00
committed by GitHub
parent b1ff04e06d
commit c6422e0872
3 changed files with 15 additions and 4 deletions

View File

@@ -317,6 +317,18 @@ ContentFeatures::ContentFeatures()
reset();
}
ContentFeatures::~ContentFeatures()
{
#ifndef SERVER
for (u16 j = 0; j < 6; j++) {
delete tiles[j].layers[0].frames;
delete tiles[j].layers[1].frames;
}
for (u16 j = 0; j < CF_SPECIAL_COUNT; j++)
delete special_tiles[j].layers[0].frames;
#endif
}
void ContentFeatures::reset()
{
/*
@@ -662,7 +674,7 @@ static void fillTileAttribs(ITextureSource *tsrc, TileLayer *layer,
} else {
std::ostringstream os(std::ios::binary);
if (!layer->frames) {
layer->frames = std::make_shared<std::vector<FrameSpec>>();
layer->frames = new std::vector<FrameSpec>();
}
layer->frames->resize(frame_count);