First attempt to play audio

This commit is contained in:
2023-01-17 00:11:22 -08:00
parent f2a0d3b3bb
commit 2950bc9184
44 changed files with 698 additions and 82 deletions

View File

@ -9,7 +9,7 @@ using namespace Dawn;
PixelVNScene::PixelVNScene(DawnGame *game) :
SimpleVNScene(game),
renderTarget(320, 180)
renderTarget(1280, 720)
{
}

View File

@ -6,25 +6,32 @@
#pragma once
#include "scenes/PixelVNScene.hpp"
#include "scenes/Scene_2.hpp"
#include "prefabs/characters/DeathPrefab.hpp"
namespace Dawn {
class Scene_1 : public PixelVNScene {
protected:
DeathPrefab *death;
void vnStage() override {
PixelVNScene::vnStage();
this->death = DeathPrefab::create(this);
// this->death->vnCharacter.setOpacity(0);
}
void onSceneEnded() {
auto scene = new SubSceneRendererScene<Scene_2>(this->game);
auto assets = game->scene->getRequiredAssets();
game->assetManager.queueSwap(assets, this->getRequiredAssets());
game->assetManager.queueSwap(
scene->getRequiredAssets(), this->getRequiredAssets()
);
game->assetManager.syncLoad();
scene->stage();
this->game->sceneCutover(scene);
}
IVisualNovelEvent * getVNEvent() override {
auto start = new VisualNovelPauseEvent(vnManager, 0.1f);
auto start = new VisualNovelPauseEvent(vnManager, 1.0f);
start
->then(new VisualNovelTextboxEvent(vnManager, nullptr, "scene.1.1"))
@ -40,7 +47,9 @@ namespace Dawn {
}
std::vector<Asset*> getRequiredAssets() override {
auto man = &this->game->assetManager;
std::vector<Asset*> assets = PixelVNScene::getRequiredAssets();
vectorAppend(&assets, DeathPrefab::getRequiredAssets(man));
return assets;
}
};

View File

@ -16,8 +16,9 @@ namespace Dawn {
void onSceneEnded() {
auto scene = new SubSceneRendererScene<Scene_11>(this->game);
auto assets = game->scene->getRequiredAssets();
game->assetManager.queueSwap(assets, this->getRequiredAssets());
game->assetManager.queueSwap(
scene->getRequiredAssets(), this->getRequiredAssets()
);
game->assetManager.syncLoad();
scene->stage();
this->game->sceneCutover(scene);

View File

@ -16,8 +16,9 @@ namespace Dawn {
void onSceneEnded() {
auto scene = new SubSceneRendererScene<Scene_12>(this->game);
auto assets = game->scene->getRequiredAssets();
game->assetManager.queueSwap(assets, this->getRequiredAssets());
game->assetManager.queueSwap(
scene->getRequiredAssets(), this->getRequiredAssets()
);
game->assetManager.syncLoad();
scene->stage();
this->game->sceneCutover(scene);

View File

@ -6,6 +6,7 @@
#pragma once
#include "PokerVNScene.hpp"
#include "prefabs/characters/PennyPrefab.hpp"
#include "scenes/Scene_13.hpp"
namespace Dawn {
class Scene_12 : public PokerVNScene {
@ -25,12 +26,13 @@ namespace Dawn {
}
void onSceneEnded() {
// auto scene = new SubSceneRendererScene<Scene_13>(this->game);
// auto assets = game->scene->getRequiredAssets();
// game->assetManager.queueSwap(assets, this->getRequiredAssets());
// game->assetManager.syncLoad();
// scene->stage();
// this->game->sceneCutover(scene);
auto scene = new SubSceneRendererScene<Scene_13>(this->game);
game->assetManager.queueSwap(
scene->getRequiredAssets(), this->getRequiredAssets()
);
game->assetManager.syncLoad();
scene->stage();
this->game->sceneCutover(scene);
}
std::vector<PokerPlayer *> getPokerPlayers() override {

View File

@ -0,0 +1,47 @@
// Copyright (c) 2022 Dominic Masters
//
// This software is released under the MIT License.
// https://opensource.org/licenses/MIT
#pragma once
#include "scenes/PixelVNScene.hpp"
#include "scenes/Scene_14.hpp"
namespace Dawn {
class Scene_13 : public PixelVNScene {
protected:
void vnStage() override {
PixelVNScene::vnStage();
}
void onSceneEnded() {
auto scene = new SubSceneRendererScene<Scene_14>(this->game);
game->assetManager.queueSwap(
scene->getRequiredAssets(), this->getRequiredAssets()
);
game->assetManager.syncLoad();
scene->stage();
this->game->sceneCutover(scene);
}
IVisualNovelEvent * getVNEvent() override {
auto start = new VisualNovelPauseEvent(vnManager, 0.1f);
start
->then(new VisualNovelTextboxEvent(vnManager, nullptr, "scene.13.1"))
->then(new VisualNovelCallbackEvent<Scene_13>(vnManager, this, &Scene_13::onSceneEnded))
;
return start;
}
public:
Scene_13(DawnGame *game) : PixelVNScene(game) {
}
std::vector<Asset*> getRequiredAssets() override {
std::vector<Asset*> assets = PixelVNScene::getRequiredAssets();
return assets;
}
};
}

View File

@ -0,0 +1,47 @@
// Copyright (c) 2022 Dominic Masters
//
// This software is released under the MIT License.
// https://opensource.org/licenses/MIT
#pragma once
#include "scenes/PixelVNScene.hpp"
#include "scenes/Scene_15.hpp"
namespace Dawn {
class Scene_14 : public PixelVNScene {
protected:
void vnStage() override {
PixelVNScene::vnStage();
}
void onSceneEnded() {
auto scene = new SubSceneRendererScene<Scene_15>(this->game);
game->assetManager.queueSwap(
scene->getRequiredAssets(), this->getRequiredAssets()
);
game->assetManager.syncLoad();
scene->stage();
this->game->sceneCutover(scene);
}
IVisualNovelEvent * getVNEvent() override {
auto start = new VisualNovelPauseEvent(vnManager, 0.1f);
start
->then(new VisualNovelTextboxEvent(vnManager, nullptr, "scene.14.1"))
->then(new VisualNovelCallbackEvent<Scene_14>(vnManager, this, &Scene_14::onSceneEnded))
;
return start;
}
public:
Scene_14(DawnGame *game) : PixelVNScene(game) {
}
std::vector<Asset*> getRequiredAssets() override {
std::vector<Asset*> assets = PixelVNScene::getRequiredAssets();
return assets;
}
};
}

View File

@ -0,0 +1,47 @@
// Copyright (c) 2022 Dominic Masters
//
// This software is released under the MIT License.
// https://opensource.org/licenses/MIT
#pragma once
#include "scenes/PixelVNScene.hpp"
#include "scenes/Scene_16.hpp"
namespace Dawn {
class Scene_15 : public PixelVNScene {
protected:
void vnStage() override {
PixelVNScene::vnStage();
}
void onSceneEnded() {
auto scene = new SubSceneRendererScene<Scene_16>(this->game);
game->assetManager.queueSwap(
scene->getRequiredAssets(), this->getRequiredAssets()
);
game->assetManager.syncLoad();
scene->stage();
this->game->sceneCutover(scene);
}
IVisualNovelEvent * getVNEvent() override {
auto start = new VisualNovelPauseEvent(vnManager, 0.1f);
start
->then(new VisualNovelTextboxEvent(vnManager, nullptr, "scene.15.1"))
->then(new VisualNovelCallbackEvent<Scene_15>(vnManager, this, &Scene_15::onSceneEnded))
;
return start;
}
public:
Scene_15(DawnGame *game) : PixelVNScene(game) {
}
std::vector<Asset*> getRequiredAssets() override {
std::vector<Asset*> assets = PixelVNScene::getRequiredAssets();
return assets;
}
};
}

View File

@ -0,0 +1,47 @@
// Copyright (c) 2022 Dominic Masters
//
// This software is released under the MIT License.
// https://opensource.org/licenses/MIT
#pragma once
#include "scenes/PixelVNScene.hpp"
#include "scenes/Scene_17.hpp"
namespace Dawn {
class Scene_16 : public PixelVNScene {
protected:
void vnStage() override {
PixelVNScene::vnStage();
}
void onSceneEnded() {
auto scene = new SubSceneRendererScene<Scene_17>(this->game);
game->assetManager.queueSwap(
scene->getRequiredAssets(), this->getRequiredAssets()
);
game->assetManager.syncLoad();
scene->stage();
this->game->sceneCutover(scene);
}
IVisualNovelEvent * getVNEvent() override {
auto start = new VisualNovelPauseEvent(vnManager, 0.1f);
start
->then(new VisualNovelTextboxEvent(vnManager, nullptr, "scene.16.1"))
->then(new VisualNovelCallbackEvent<Scene_16>(vnManager, this, &Scene_16::onSceneEnded))
;
return start;
}
public:
Scene_16(DawnGame *game) : PixelVNScene(game) {
}
std::vector<Asset*> getRequiredAssets() override {
std::vector<Asset*> assets = PixelVNScene::getRequiredAssets();
return assets;
}
};
}

View File

@ -0,0 +1,68 @@
// Copyright (c) 2023 Dominic Masters
//
// This software is released under the MIT License.
// https://opensource.org/licenses/MIT
#pragma once
#include "PokerVNScene.hpp"
#include "prefabs/characters/PennyPrefab.hpp"
#include "scenes/Scene_18.hpp"
namespace Dawn {
class Scene_17 : public PokerVNScene {
protected:
PennyPrefab *penny;
PennyPrefab *julie;
PennyPrefab *sammy;
PennyPrefab *lucy;
void vnStage() override {
penny = PennyPrefab::create(this);
julie = PennyPrefab::create(this);
sammy = PennyPrefab::create(this);
lucy = PennyPrefab::create(this);
PokerVNScene::vnStage();
}
void onSceneEnded() {
auto scene = new SubSceneRendererScene<Scene_18>(this->game);
game->assetManager.queueSwap(
scene->getRequiredAssets(), this->getRequiredAssets()
);
game->assetManager.syncLoad();
scene->stage();
this->game->sceneCutover(scene);
}
std::vector<PokerPlayer *> getPokerPlayers() override {
return std::vector<PokerPlayer*>{
this->penny->getComponent<PokerPlayer>(),
this->julie->getComponent<PokerPlayer>(),
this->sammy->getComponent<PokerPlayer>(),
this->lucy->getComponent<PokerPlayer>()
};
}
IVisualNovelEvent * getVNEvent() override {
auto start = new VisualNovelTextboxEvent(vnManager, penny->vnCharacter, "scene.17.1");
start
->then(new VisualNovelCallbackEvent<Scene_17>(vnManager, this, &Scene_17::onSceneEnded))
;
return start;
}
public:
Scene_17(DawnGame *game) : PokerVNScene(game) {}
std::vector<Asset*> getRequiredAssets() override {
auto assMan = &this->game->assetManager;
std::vector<Asset*> assets;
vectorAppend(&assets, PokerVNScene::getRequiredAssets());
vectorAppend(&assets, PennyPrefab::getRequiredAssets(assMan));
return assets;
}
};
}

View File

@ -0,0 +1,39 @@
// Copyright (c) 2022 Dominic Masters
//
// This software is released under the MIT License.
// https://opensource.org/licenses/MIT
#pragma once
#include "scenes/PixelVNScene.hpp"
namespace Dawn {
class Scene_18 : public PixelVNScene {
protected:
void vnStage() override {
PixelVNScene::vnStage();
}
void onSceneEnded() {
}
IVisualNovelEvent * getVNEvent() override {
auto start = new VisualNovelPauseEvent(vnManager, 0.1f);
start
->then(new VisualNovelTextboxEvent(vnManager, nullptr, "scene.18.1"))
->then(new VisualNovelCallbackEvent<Scene_18>(vnManager, this, &Scene_18::onSceneEnded))
;
return start;
}
public:
Scene_18(DawnGame *game) : PixelVNScene(game) {
}
std::vector<Asset*> getRequiredAssets() override {
std::vector<Asset*> assets = PixelVNScene::getRequiredAssets();
return assets;
}
};
}

View File

@ -16,8 +16,9 @@ namespace Dawn {
void onSceneEnded() {
auto scene = new SubSceneRendererScene<Scene_3>(this->game);
auto assets = game->scene->getRequiredAssets();
game->assetManager.queueSwap(assets, this->getRequiredAssets());
game->assetManager.queueSwap(
scene->getRequiredAssets(), this->getRequiredAssets()
);
game->assetManager.syncLoad();
scene->stage();
this->game->sceneCutover(scene);

View File

@ -16,8 +16,9 @@ namespace Dawn {
void onSceneEnded() {
auto scene = new SubSceneRendererScene<Scene_4>(this->game);
auto assets = game->scene->getRequiredAssets();
game->assetManager.queueSwap(assets, this->getRequiredAssets());
game->assetManager.queueSwap(
scene->getRequiredAssets(), this->getRequiredAssets()
);
game->assetManager.syncLoad();
scene->stage();
this->game->sceneCutover(scene);

View File

@ -27,8 +27,9 @@ namespace Dawn {
void onSceneEnded() {
auto scene = new SubSceneRendererScene<Scene_5>(this->game);
auto assets = game->scene->getRequiredAssets();
game->assetManager.queueSwap(assets, this->getRequiredAssets());
game->assetManager.queueSwap(
scene->getRequiredAssets(), this->getRequiredAssets()
);
game->assetManager.syncLoad();
scene->stage();
this->game->sceneCutover(scene);

View File

@ -16,8 +16,9 @@ namespace Dawn {
void onSceneEnded() {
auto scene = new SubSceneRendererScene<Scene_6>(this->game);
auto assets = game->scene->getRequiredAssets();
game->assetManager.queueSwap(assets, this->getRequiredAssets());
game->assetManager.queueSwap(
scene->getRequiredAssets(), this->getRequiredAssets()
);
game->assetManager.syncLoad();
scene->stage();
this->game->sceneCutover(scene);

View File

@ -16,8 +16,9 @@ namespace Dawn {
void onSceneEnded() {
auto scene = new SubSceneRendererScene<Scene_7>(this->game);
auto assets = game->scene->getRequiredAssets();
game->assetManager.queueSwap(assets, this->getRequiredAssets());
game->assetManager.queueSwap(
scene->getRequiredAssets(), this->getRequiredAssets()
);
game->assetManager.syncLoad();
scene->stage();
this->game->sceneCutover(scene);

View File

@ -16,8 +16,9 @@ namespace Dawn {
void onSceneEnded() {
auto scene = new SubSceneRendererScene<Scene_8>(this->game);
auto assets = game->scene->getRequiredAssets();
game->assetManager.queueSwap(assets, this->getRequiredAssets());
game->assetManager.queueSwap(
scene->getRequiredAssets(), this->getRequiredAssets()
);
game->assetManager.syncLoad();
scene->stage();
this->game->sceneCutover(scene);

View File

@ -27,8 +27,9 @@ namespace Dawn {
void onSceneEnded() {
auto scene = new SubSceneRendererScene<Scene_9>(this->game);
auto assets = game->scene->getRequiredAssets();
game->assetManager.queueSwap(assets, this->getRequiredAssets());
game->assetManager.queueSwap(
scene->getRequiredAssets(), this->getRequiredAssets()
);
game->assetManager.syncLoad();
scene->stage();
this->game->sceneCutover(scene);

View File

@ -16,8 +16,9 @@ namespace Dawn {
void onSceneEnded() {
auto scene = new SubSceneRendererScene<Scene_10>(this->game);
auto assets = game->scene->getRequiredAssets();
game->assetManager.queueSwap(assets, this->getRequiredAssets());
game->assetManager.queueSwap(
scene->getRequiredAssets(), this->getRequiredAssets()
);
game->assetManager.syncLoad();
scene->stage();
this->game->sceneCutover(scene);