it is now possible to neglect palette initialization

This commit is contained in:
wgroeneveld 2018-11-29 13:09:09 +01:00
parent 11a04a3b32
commit 287b5ed932
4 changed files with 6 additions and 4 deletions

View File

@ -59,7 +59,7 @@ void FlyingStuffScene::load() {
bg.get()->useMapScreenBlock(16);
}
void FlyingStuffScene::tick(u16 i) {
void FlyingStuffScene::tick(u16 keys) {
scrollX += 1;
rotation += rotationDiff;

View File

@ -28,7 +28,7 @@ public:
std::vector<Background *> backgrounds() override;
void load() override;
void tick(u16 i) override;
void tick(u16 keys) override;
};

View File

@ -79,7 +79,6 @@ void ArkanoidGameScene::tick(u16 keys) {
void ArkanoidGameScene::load() {
foregroundPalette = std::unique_ptr<ForegroundPaletteManager>(new ForegroundPaletteManager(paletteSharedPal, sizeof(paletteSharedPal)));
backgroundPalette = std::unique_ptr<BackgroundPaletteManager>(new BackgroundPaletteManager());
SpriteBuilder<Sprite> builder;

View File

@ -32,7 +32,10 @@ public:
virtual void load() = 0;
virtual void tick(u16 i) = 0;
Scene(std::shared_ptr<GBAEngine> engine) : engine(engine) { }
Scene(std::shared_ptr<GBAEngine> engine) :
engine(engine),
foregroundPalette(std::unique_ptr<ForegroundPaletteManager>(new ForegroundPaletteManager())),
backgroundPalette(std::unique_ptr<BackgroundPaletteManager>(new BackgroundPaletteManager())) { }
virtual ~Scene() {
// scenes should manage their own resources - use std::unique_ptr
}