This repository has been archived on 2023-10-28. You can view files and clone it, but cannot push or open issues or pull requests.
frostbite/snowlib/World.cpp

41 lines
553 B
C++
Raw Normal View History

2020-02-06 13:23:46 +13:00
#include "World.h"
2021-03-23 13:05:58 +13:00
World::World() : textureChunkOffsets(100*100, 0)
2020-02-06 13:23:46 +13:00
{
topoStartCol = 0;
topoStartRow = 0;
numTopoCols = 0;
numTopoRows = 0;
}
World::~World()
{
for (auto& element : topoElements)
{
delete element;
}
for (auto& patch : topoPatches)
{
delete patch;
}
2021-04-02 11:49:11 +13:00
for (auto& element : elements)
{
delete element;
}
2020-02-06 13:23:46 +13:00
}
TopoPatch::TopoPatch(int width, int height)
{
2021-04-02 11:49:11 +13:00
minHeight = 0;
maxHeight = 0;
x0 = y0 = 0;
2020-02-06 13:23:46 +13:00
w = width;
h = height;
heights = new int[w * h];
}
TopoPatch::~TopoPatch()
{
2021-04-02 11:49:11 +13:00
delete[] heights; heights = nullptr;
2020-02-06 13:23:46 +13:00
}