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);
|
bg.get()->useMapScreenBlock(16);
|
||||||
}
|
}
|
||||||
|
|
||||||
void FlyingStuffScene::tick(u16 i) {
|
void FlyingStuffScene::tick(u16 keys) {
|
||||||
scrollX += 1;
|
scrollX += 1;
|
||||||
|
|
||||||
rotation += rotationDiff;
|
rotation += rotationDiff;
|
||||||
|
|
|
@ -28,7 +28,7 @@ public:
|
||||||
std::vector<Background *> backgrounds() override;
|
std::vector<Background *> backgrounds() override;
|
||||||
|
|
||||||
void load() 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() {
|
void ArkanoidGameScene::load() {
|
||||||
foregroundPalette = std::unique_ptr<ForegroundPaletteManager>(new ForegroundPaletteManager(paletteSharedPal, sizeof(paletteSharedPal)));
|
foregroundPalette = std::unique_ptr<ForegroundPaletteManager>(new ForegroundPaletteManager(paletteSharedPal, sizeof(paletteSharedPal)));
|
||||||
backgroundPalette = std::unique_ptr<BackgroundPaletteManager>(new BackgroundPaletteManager());
|
|
||||||
|
|
||||||
SpriteBuilder<Sprite> builder;
|
SpriteBuilder<Sprite> builder;
|
||||||
|
|
||||||
|
|
|
@ -32,7 +32,10 @@ public:
|
||||||
virtual void load() = 0;
|
virtual void load() = 0;
|
||||||
virtual void tick(u16 i) = 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() {
|
virtual ~Scene() {
|
||||||
// scenes should manage their own resources - use std::unique_ptr
|
// scenes should manage their own resources - use std::unique_ptr
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue