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:
parent
3c0e460a23
commit
896b368cbe
15 changed files with 393 additions and 99 deletions
|
@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue