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
2021-04-01 23:49:11 +01:00

41 lines
553 B
C++

#include "World.h"
World::World() : textureChunkOffsets(100*100, 0)
{
topoStartCol = 0;
topoStartRow = 0;
numTopoCols = 0;
numTopoRows = 0;
}
World::~World()
{
for (auto& element : topoElements)
{
delete element;
}
for (auto& patch : topoPatches)
{
delete patch;
}
for (auto& element : elements)
{
delete element;
}
}
TopoPatch::TopoPatch(int width, int height)
{
minHeight = 0;
maxHeight = 0;
x0 = y0 = 0;
w = width;
h = height;
heights = new int[w * h];
}
TopoPatch::~TopoPatch()
{
delete[] heights; heights = nullptr;
}