it is now possible to neglect palette initialization
This commit is contained in:
parent
11a04a3b32
commit
287b5ed932
|
@ -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;
|
||||
|
|
|
@ -28,7 +28,7 @@ public:
|
|||
std::vector<Background *> backgrounds() override;
|
||||
|
||||
void load() override;
|
||||
void tick(u16 i) override;
|
||||
void tick(u16 keys) override;
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue