X-Git-Url: http://git.treefish.org/~alex/seamulator.git/blobdiff_plain/94e405360849659ff951816a13cf510f11a7eee7..31e7aa23c4e95b5e37f33938e9bb47ea82a3f4d9:/sea.cpp diff --git a/sea.cpp b/sea.cpp index 37a6cd6..42772d4 100644 --- a/sea.cpp +++ b/sea.cpp @@ -2,15 +2,17 @@ #include -Sea::Sea(WaterSurface& surface) : m_surface{surface} +#include "watersurface.h" + +Sea::Sea(WaterSurfacePtr surface) : m_surface{surface} { } void Sea::update() { - for (int y = 0; y < m_surface.size(); ++y) { - for (int x = 0; x < m_surface.size(); ++x) { - m_surface.at(x, y) + for (int y = 0; y < m_surface->size(); ++y) { + for (int x = 0; x < m_surface->size(); ++x) { + m_surface->at(x, y) .setHeight(((double)std::rand()/(double)RAND_MAX)); } }