X-Git-Url: http://git.treefish.org/~alex/seamulator.git/blobdiff_plain/94e405360849659ff951816a13cf510f11a7eee7..0fcdcce0bba803bdb7d3165a3884e4e0f50553bc:/sea.cpp?ds=sidebyside 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)); } }