Refactoring to split the PlatformSystem into a PlatformSet subpart.

Also introduces the same concept for Drawables, with DrawableSet.
Single drawables can't be registered anymore.
This commit is contained in:
King_DuckZ 2014-08-13 22:45:37 +02:00
parent 3c0e460a23
commit 896b368cbe
15 changed files with 393 additions and 99 deletions

View file

@ -20,6 +20,7 @@
#include "gameplayscene.hpp"
#include "mover.hpp"
#include "drawable.hpp"
#include "drawableset.hpp"
#include "placeable.hpp"
#include <unordered_set>
@ -53,8 +54,13 @@ namespace cloonel {
///--------------------------------------------------------------------------
///--------------------------------------------------------------------------
void GameplayScene::OnRender() {
for (auto itDrawable : m_drawables) {
itDrawable->Draw();
std::vector<const Drawable*> drawables;
for (auto drawableSet : m_drawableSets) {
drawables.clear();
drawableSet->CopyDrawables(drawables);
for (auto drawable : drawables) {
drawable->Draw();
}
}
}