Just breaking stuff
This commit is contained in:
1 parent
374ae30b88
commit
cc7091717c
156 files changed
+4
-4531
No files matched your search
-26
@@ -1,26 +0,0 @@
|
||||
# Project update 2023-02-26
|
||||
Things are going quite smoothly but I feel like I'm a bit stuck where I am now.
|
||||
There are parts of the engine that actually work really great and a few parts
|
||||
that do not.
|
||||
|
||||
Currently, here are the parts of the engine that I think need a total rework, or
|
||||
need more work to make good;
|
||||
- Fonts. Currently they work "ok" but it's difficult to common font things, and
|
||||
they are acting inconsistent. All fonts should "basically be the same", but
|
||||
whenever I change fonts the baselines and line heights go WAY off. I also
|
||||
believe it should be easier to change font colors, including in the MIDDLE of
|
||||
a word. I also still need to handle things like variable replacement mid-text
|
||||
so that I can do, say, %playername% or similar.
|
||||
- Physics. It is brand new and still generally good how it is, but it will for
|
||||
sure need revisiting at some point.
|
||||
- State Management. This is more of a conceptual thing but I'd like to make it
|
||||
easier for states to be influenced by properties, e.g. changing position can
|
||||
be done with a simple += rather than a get() and set().
|
||||
- Item Repositories. At the moment Scene items are attached to the scene, and
|
||||
then components are attached to those, it should be more performant to simply
|
||||
have each scene item type have a repo, and then map sceneitem ids to those.
|
||||
That will improve performance of a lot of things, and make the memory
|
||||
footprint smaller too.
|
||||
- Using std:: methods more. I've learned a tonne of C++ since I started this
|
||||
project, I'd love to use std pointers if they weren't a bit annoying, and
|
||||
also use the std::function to support anonymous functions.
|
||||
@@ -1,19 +1,3 @@
|
||||
# Dawn Project
|
||||
Simple in code, complex in structure game engine for creating small, fast and
|
||||
reusable games.
|
||||
|
||||
## Folder Structure
|
||||
```Markdown
|
||||
.
|
||||
├── assets # Game Assets and Files (before optimization)
|
||||
├── cmake
|
||||
| ├── modules # Tools to allow CMake to find third-party libraries
|
||||
| ├── targets # Variable lists to control what will be built
|
||||
├── lib # Third-Party Submodule Libraries
|
||||
├── src
|
||||
| ├── dawn # Game engine, common project tools and utilities
|
||||
| ├── dawnglfw # Engine files for GLFW Support
|
||||
| ├── dawnopengl # Engine files for OpenGL Support
|
||||
| ├── dawnpokergame # Poker Game Project
|
||||
| ├── dawnwin32 # Engine files for WIN32 Host
|
||||
```
|
||||
@@ -1,9 +0,0 @@
|
||||
# Copyright (c) 2022 Dominic Masters
|
||||
#
|
||||
# This software is released under the MIT License.
|
||||
# https://opensource.org/licenses/MIT
|
||||
|
||||
set(DAWN_BUILDING dawnplatformergame CACHE INTERNAL ${DAWN_CACHE_TARGET})
|
||||
set(DAWN_TARGET_WIN32 true CACHE INTERNAL ${DAWN_CACHE_TARGET})
|
||||
set(DAWN_TARGET_GLFW true CACHE INTERNAL ${DAWN_CACHE_TARGET})
|
||||
set(DAWN_TARGET_NAME "PlatformerGame" CACHE INTERNAL ${DAWN_CACHE_TARGET})
|
||||
@@ -1,9 +0,0 @@
|
||||
# Copyright (c) 2022 Dominic Masters
|
||||
#
|
||||
# This software is released under the MIT License.
|
||||
# https://opensource.org/licenses/MIT
|
||||
|
||||
set(DAWN_BUILDING dawnpokergame CACHE INTERNAL ${DAWN_CACHE_TARGET})
|
||||
set(DAWN_TARGET_LINUX64 true CACHE INTERNAL ${DAWN_CACHE_TARGET})
|
||||
set(DAWN_TARGET_GLFW true CACHE INTERNAL ${DAWN_CACHE_TARGET})
|
||||
set(DAWN_TARGET_NAME "PlatformerGame" CACHE INTERNAL ${DAWN_CACHE_TARGET})
|
||||
@@ -1,9 +0,0 @@
|
||||
# Copyright (c) 2022 Dominic Masters
|
||||
#
|
||||
# This software is released under the MIT License.
|
||||
# https://opensource.org/licenses/MIT
|
||||
|
||||
set(DAWN_BUILDING dawnpokergame CACHE INTERNAL ${DAWN_CACHE_TARGET})
|
||||
set(DAWN_TARGET_WIN32 true CACHE INTERNAL ${DAWN_CACHE_TARGET})
|
||||
set(DAWN_TARGET_GLFW true CACHE INTERNAL ${DAWN_CACHE_TARGET})
|
||||
set(DAWN_TARGET_NAME "PokerGame" CACHE INTERNAL ${DAWN_CACHE_TARGET})
|
||||
@@ -1,9 +0,0 @@
|
||||
# Copyright (c) 2022 Dominic Masters
|
||||
#
|
||||
# This software is released under the MIT License.
|
||||
# https://opensource.org/licenses/MIT
|
||||
|
||||
set(DAWN_BUILDING dawnpokergame CACHE INTERNAL ${DAWN_CACHE_TARGET})
|
||||
set(DAWN_TARGET_WIN32 true CACHE INTERNAL ${DAWN_CACHE_TARGET})
|
||||
set(DAWN_TARGET_SDL2 true CACHE INTERNAL ${DAWN_CACHE_TARGET})
|
||||
set(DAWN_TARGET_NAME "PokerGame" CACHE INTERNAL ${DAWN_CACHE_TARGET})
|
||||
@@ -1,9 +0,0 @@
|
||||
# Copyright (c) 2022 Dominic Masters
|
||||
#
|
||||
# This software is released under the MIT License.
|
||||
# https://opensource.org/licenses/MIT
|
||||
|
||||
set(DAWN_BUILDING dawntictactoe CACHE INTERNAL ${DAWN_CACHE_TARGET})
|
||||
set(DAWN_TARGET_LINUX64 true CACHE INTERNAL ${DAWN_CACHE_TARGET})
|
||||
set(DAWN_TARGET_GLFW true CACHE INTERNAL ${DAWN_CACHE_TARGET})
|
||||
set(DAWN_TARGET_NAME "TicTacToe" CACHE INTERNAL ${DAWN_CACHE_TARGET})
|
||||
@@ -1,95 +0,0 @@
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
|
||||
const DIR_SOURCES = path.resolve('src');
|
||||
|
||||
const fileGetContents = filePath => fs.readFileSync(filePath, 'utf-8');
|
||||
|
||||
const ensureCopyright = (file, contents) => {
|
||||
if(
|
||||
contents.includes('Copyright (c)') &&
|
||||
contents.includes('MIT')
|
||||
) return;
|
||||
throw new Error(`${file} is missing its copyright!`);
|
||||
}
|
||||
|
||||
const ensurePragma = (file, contents) => {
|
||||
if(contents.includes('#pragma once')) return;
|
||||
throw new Error(`${file} is missing a #pragma once`);
|
||||
}
|
||||
|
||||
|
||||
const fileHandleCpp = filePath => {
|
||||
// Load contents
|
||||
const contents = fileGetContents(filePath);
|
||||
ensureCopyright(filePath, contents);
|
||||
}
|
||||
|
||||
const fileHandleC = filePath => {
|
||||
// Load contents
|
||||
const contents = fileGetContents(filePath);
|
||||
ensureCopyright(filePath, contents);
|
||||
}
|
||||
|
||||
const fileHandleHpp = filePath => {
|
||||
// Load contents
|
||||
const contents = fileGetContents(filePath);
|
||||
|
||||
ensureCopyright(filePath, contents);
|
||||
ensurePragma(filePath, contents);
|
||||
}
|
||||
|
||||
const fileHandleH = filePath => {
|
||||
// Load contents
|
||||
const contents = fileGetContents(filePath);
|
||||
|
||||
ensureCopyright(filePath, contents);
|
||||
ensurePragma(filePath, contents);
|
||||
}
|
||||
|
||||
const fileHandleCmake = filePath => {
|
||||
// Load contents
|
||||
const contents = fileGetContents(filePath);
|
||||
|
||||
// Check for the copyright
|
||||
ensureCopyright(filePath, contents);
|
||||
}
|
||||
|
||||
|
||||
|
||||
const fileScan = filePath => {
|
||||
const ext = path.extname(filePath).replace(/\./g, '');
|
||||
const base = path.basename(filePath);
|
||||
|
||||
if(ext === 'cpp') {
|
||||
fileHandleCpp(filePath);
|
||||
} else if(ext === 'hpp') {
|
||||
fileHandleHpp(filePath);
|
||||
} else if(ext === 'c') {
|
||||
fileHandleC(filePath);
|
||||
} else if(ext === 'h') {
|
||||
fileHandleH(filePath);
|
||||
}else if(base === 'CMakeLists.txt') {
|
||||
fileHandleCmake(filePath);
|
||||
} else {
|
||||
throw new Error(`Unknown file type ${filePath}`);
|
||||
}
|
||||
};
|
||||
|
||||
const dirScan = directory => {
|
||||
const contents = fs.readdirSync(directory);
|
||||
contents.forEach(filePath => {
|
||||
const abs = path.join(directory, filePath);
|
||||
const stat = fs.statSync(abs);
|
||||
if(stat.isDirectory()) {
|
||||
dirScan(abs);
|
||||
} else {
|
||||
fileScan(abs);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
(() => {
|
||||
dirScan(DIR_SOURCES);
|
||||
console.log('Lint done');
|
||||
})();
|
||||
@@ -36,10 +36,6 @@ add_subdirectory(scene)
|
||||
add_subdirectory(state)
|
||||
add_subdirectory(time)
|
||||
|
||||
if(DAWN_VISUAL_NOVEL)
|
||||
add_subdirectory(visualnovel)
|
||||
endif()
|
||||
|
||||
# Definitions
|
||||
target_compile_definitions(${DAWN_TARGET_NAME}
|
||||
PUBLIC
|
||||
|
||||
@@ -6,3 +6,7 @@
|
||||
# Subdirs
|
||||
add_subdirectory(poker)
|
||||
add_subdirectory(tictactoe)
|
||||
|
||||
if(DAWN_VISUAL_NOVEL)
|
||||
add_subdirectory(visualnovel)
|
||||
endif()
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -1,30 +0,0 @@
|
||||
# Copyright (c) 2022 Dominic Masters
|
||||
#
|
||||
# This software is released under the MIT License.
|
||||
# https://opensource.org/licenses/MIT
|
||||
|
||||
# Build Project
|
||||
add_executable(${DAWN_TARGET_NAME})
|
||||
|
||||
# Includes
|
||||
target_include_directories(${DAWN_TARGET_NAME}
|
||||
PUBLIC
|
||||
${CMAKE_CURRENT_LIST_DIR}
|
||||
)
|
||||
|
||||
# Subdirs
|
||||
add_subdirectory(components)
|
||||
add_subdirectory(game)
|
||||
add_subdirectory(save)
|
||||
|
||||
# Assets
|
||||
set(DIR_GAME_ASSETS games/platformergame)
|
||||
tool_language(language_en ${DIR_GAME_ASSETS}/locale/en.csv)
|
||||
tool_texture(texture_test texture_test.png)
|
||||
tool_tileset(tileset_aqua texture_aqua ${DIR_GAME_ASSETS}/tileset/s4m_ur4i_minivania_tilemap_aqua.png 32 32)
|
||||
|
||||
add_dependencies(${DAWN_TARGET_NAME}
|
||||
language_en
|
||||
texture_test
|
||||
tileset_aqua
|
||||
)
|
||||
@@ -1,10 +0,0 @@
|
||||
# Copyright (c) 2023 Dominic Masters
|
||||
#
|
||||
# This software is released under the MIT License.
|
||||
# https://opensource.org/licenses/MIT
|
||||
|
||||
# Sources
|
||||
target_sources(${DAWN_TARGET_NAME}
|
||||
PRIVATE
|
||||
PlayerController.cpp
|
||||
)
|
||||
@@ -1,35 +0,0 @@
|
||||
// Copyright (c) 2023 Dominic Masters
|
||||
//
|
||||
// This software is released under the MIT License.
|
||||
// https://opensource.org/licenses/MIT
|
||||
|
||||
#include "PlayerController.hpp"
|
||||
#include "game/DawnGame.hpp"
|
||||
|
||||
using namespace Dawn;
|
||||
|
||||
PlayerController::PlayerController(SceneItem *i) : SceneItemComponent(i) {}
|
||||
|
||||
void PlayerController::onSceneUpdate() {
|
||||
auto im = &getGame()->inputManager;
|
||||
auto delta = getGame()->timeManager.delta;
|
||||
|
||||
glm::vec2 iMove = im->getAxis2D(
|
||||
INPUT_BIND_NEGATIVE_X, INPUT_BIND_POSITIVE_X,
|
||||
INPUT_BIND_NEGATIVE_Y, INPUT_BIND_POSITIVE_Y
|
||||
);
|
||||
|
||||
glm::vec2 pos = this->transform->getLocalPosition();
|
||||
this->transform->setLocalPosition(
|
||||
this->transform->getLocalPosition() + glm::vec3(iMove * delta * 20.0f, 0)
|
||||
);
|
||||
}
|
||||
|
||||
void PlayerController::onStart() {
|
||||
assertNotNull(this->camera);
|
||||
getScene()->eventSceneUnpausedUpdate.addListener(this, &PlayerController::onSceneUpdate);
|
||||
}
|
||||
|
||||
PlayerController::~PlayerController() {
|
||||
getScene()->eventSceneUnpausedUpdate.removeListener(this, &PlayerController::onSceneUpdate);
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
// Copyright (c) 2023 Dominic Masters
|
||||
//
|
||||
// This software is released under the MIT License.
|
||||
// https://opensource.org/licenses/MIT
|
||||
|
||||
#pragma once
|
||||
#include "scene/components/Components.hpp"
|
||||
|
||||
namespace Dawn {
|
||||
class PlayerController : public SceneItemComponent {
|
||||
protected:
|
||||
void onSceneUpdate();
|
||||
|
||||
public:
|
||||
Camera *camera = nullptr;
|
||||
|
||||
PlayerController(SceneItem *item);
|
||||
|
||||
void onStart() override;
|
||||
|
||||
~PlayerController();
|
||||
};
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
# Copyright (c) 2022 Dominic Masters
|
||||
#
|
||||
# This software is released under the MIT License.
|
||||
# https://opensource.org/licenses/MIT
|
||||
|
||||
# Sources
|
||||
target_sources(${DAWN_TARGET_NAME}
|
||||
PRIVATE
|
||||
DawnGame.cpp
|
||||
)
|
||||
@@ -1,40 +0,0 @@
|
||||
// Copyright (c) 2022 Dominic Masters
|
||||
//
|
||||
// This software is released under the MIT License.
|
||||
// https://opensource.org/licenses/MIT
|
||||
|
||||
#include "DawnGame.hpp"
|
||||
#include "scenes/TestScene.hpp"
|
||||
|
||||
using namespace Dawn;
|
||||
|
||||
DawnGame::DawnGame(DawnHost *host) :
|
||||
host(host),
|
||||
renderManager(this),
|
||||
inputManager(this),
|
||||
localeManager(this),
|
||||
saveManager(this)
|
||||
{
|
||||
}
|
||||
|
||||
int32_t DawnGame::init() {
|
||||
this->assetManager.init();
|
||||
this->localeManager.init();
|
||||
this->renderManager.init();
|
||||
|
||||
this->scene = new TestScene(this);
|
||||
|
||||
return DAWN_GAME_INIT_RESULT_SUCCESS;
|
||||
}
|
||||
|
||||
int32_t DawnGame::update(float_t delta) {
|
||||
this->assetManager.update();
|
||||
this->inputManager.update();
|
||||
this->timeManager.update(delta);
|
||||
|
||||
if(this->scene != nullptr) this->scene->update();
|
||||
|
||||
this->renderManager.update();
|
||||
|
||||
return DAWN_GAME_UPDATE_RESULT_SUCCESS;
|
||||
}
|
||||
@@ -1,27 +0,0 @@
|
||||
// Copyright (c) 2022 Dominic Masters
|
||||
//
|
||||
// This software is released under the MIT License.
|
||||
// https://opensource.org/licenses/MIT
|
||||
|
||||
#pragma once
|
||||
#include "game/_DawnGame.hpp"
|
||||
#include "scene/components/Components.hpp"
|
||||
#include "save/DawnGameSaveManager.hpp"
|
||||
|
||||
namespace Dawn {
|
||||
class DawnGame : public IDawnGame {
|
||||
public:
|
||||
DawnHost *host;
|
||||
RenderManager renderManager;
|
||||
AssetManager assetManager;
|
||||
InputManager inputManager;
|
||||
TimeManager timeManager;
|
||||
LocaleManager localeManager;
|
||||
DawnGameSaveManager saveManager;
|
||||
PhysicsManager physicsManager;
|
||||
|
||||
DawnGame(DawnHost *host);
|
||||
int32_t init() override;
|
||||
int32_t update(float_t delta) override;
|
||||
};
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
// Copyright (c) 2022 Dominic Masters
|
||||
//
|
||||
// This software is released under the MIT License.
|
||||
// https://opensource.org/licenses/MIT
|
||||
|
||||
#pragma once
|
||||
#include "input/InputManager.hpp"
|
||||
|
||||
#define INPUT_BIND(n) ((inputbind_t)n)
|
||||
#define INPUT_BIND_ACCEPT INPUT_BIND(1)
|
||||
#define INPUT_BIND_NEGATIVE_X INPUT_BIND(2)
|
||||
#define INPUT_BIND_POSITIVE_X INPUT_BIND(3)
|
||||
#define INPUT_BIND_NEGATIVE_Y INPUT_BIND(4)
|
||||
#define INPUT_BIND_POSITIVE_Y INPUT_BIND(5)
|
||||
@@ -1,46 +0,0 @@
|
||||
// Copyright (c) 2023 Dominic Masters
|
||||
//
|
||||
// This software is released under the MIT License.
|
||||
// https://opensource.org/licenses/MIT
|
||||
|
||||
#pragma once
|
||||
#include "prefab/SceneItemPrefab.hpp"
|
||||
#include "scene/components/Components.hpp"
|
||||
#include "components/PlayerController.hpp"
|
||||
|
||||
namespace Dawn {
|
||||
class PlayerPrefab : public SceneItemPrefab<PlayerPrefab> {
|
||||
public:
|
||||
static std::vector<Asset*> prefabAssets(AssetManager *man) {
|
||||
std::vector<Asset*> assets;
|
||||
assets.push_back(man->get<TilesetAsset>("tileset_aqua"));
|
||||
assets.push_back(man->get<TextureAsset>("texture_aqua"));
|
||||
return assets;
|
||||
}
|
||||
|
||||
//
|
||||
MeshHost *meshHost;
|
||||
TiledSprite *tiledSprite;
|
||||
Material *material;
|
||||
MeshRenderer *meshRenderer;
|
||||
PlayerController *playerController;
|
||||
|
||||
PlayerPrefab(Scene *s, sceneitemid_t i) : SceneItemPrefab(s, i) {}
|
||||
|
||||
void prefabInit(AssetManager *man) override {
|
||||
auto tileset = man->get<TilesetAsset>("tileset_aqua");
|
||||
auto texture = man->get<TextureAsset>("texture_aqua");
|
||||
|
||||
meshHost = addComponent<MeshHost>();
|
||||
tiledSprite = addComponent<TiledSprite>();
|
||||
material = addComponent<Material>();
|
||||
meshRenderer = addComponent<MeshRenderer>();
|
||||
playerController = addComponent<PlayerController>();
|
||||
|
||||
tiledSprite->setTilesetAndSize(&tileset->tileset);
|
||||
tiledSprite->setTile(896);
|
||||
|
||||
material->textureValues[material->getShader()->getParameterByName("u_Text")] = &texture->texture;
|
||||
}
|
||||
};
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
# Copyright (c) 2022 Dominic Masters
|
||||
#
|
||||
# This software is released under the MIT License.
|
||||
# https://opensource.org/licenses/MIT
|
||||
|
||||
# Sources
|
||||
target_sources(${DAWN_TARGET_NAME}
|
||||
PRIVATE
|
||||
DawnGameSaveManager.cpp
|
||||
)
|
||||
@@ -1,28 +0,0 @@
|
||||
// Copyright (c) 2022 Dominic Masters
|
||||
//
|
||||
// This software is released under the MIT License.
|
||||
// https://opensource.org/licenses/MIT
|
||||
|
||||
#include "DawnGameSaveManager.hpp"
|
||||
|
||||
using namespace Dawn;
|
||||
|
||||
DawnGameSaveManager::DawnGameSaveManager(DawnGame *game) : SaveManager(game) {
|
||||
}
|
||||
|
||||
bool_t DawnGameSaveManager::validateSave(struct SaveFile raw) {
|
||||
if(!raw.has(POKER_SAVE_KEY_EXAMPLE)) return true;
|
||||
this->currentSave.copy(raw, POKER_SAVE_KEY_EXAMPLE);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void DawnGameSaveManager::setExample(int32_t val) {
|
||||
savedata_t value;
|
||||
value.i32 = val;
|
||||
this->currentSave.set(POKER_SAVE_KEY_EXAMPLE, value);
|
||||
}
|
||||
|
||||
int32_t DawnGameSaveManager::getExample() {
|
||||
return this->currentSave.get(POKER_SAVE_KEY_EXAMPLE).i32;
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
// Copyright (c) 2022 Dominic Masters
|
||||
//
|
||||
// This software is released under the MIT License.
|
||||
// https://opensource.org/licenses/MIT
|
||||
|
||||
#pragma once
|
||||
#include "save/SaveManager.hpp"
|
||||
|
||||
#define POKER_SAVE_KEY_EXAMPLE "poker.example"
|
||||
|
||||
namespace Dawn {
|
||||
class DawnGameSaveManager : public SaveManager {
|
||||
protected:
|
||||
virtual bool_t validateSave(struct SaveFile raw) override;
|
||||
|
||||
public:
|
||||
DawnGameSaveManager(DawnGame *game);
|
||||
|
||||
void setExample(int32_t value);
|
||||
int32_t getExample();
|
||||
};
|
||||
}
|
||||
@@ -1,33 +0,0 @@
|
||||
// Copyright (c) 2022 Dominic Masters
|
||||
//
|
||||
// This software is released under the MIT License.
|
||||
// https://opensource.org/licenses/MIT
|
||||
|
||||
#pragma once
|
||||
#include "scene/Scene.hpp"
|
||||
#include "prefabs/PlayerPrefab.hpp"
|
||||
|
||||
namespace Dawn {
|
||||
class TestScene : public Scene {
|
||||
protected:
|
||||
void stage() override {
|
||||
auto camera = Camera::create(this);
|
||||
camera->type = CAMERA_TYPE_ORTHONOGRAPHIC;
|
||||
camera->item->addComponent<PixelPerfectCamera>();
|
||||
camera->transform->lookAt(glm::vec3(0, 0, 10), glm::vec3(0, 0, 0));
|
||||
|
||||
auto player = PlayerPrefab::create(this);
|
||||
player->playerController->camera = camera;
|
||||
}
|
||||
|
||||
std::vector<Asset*> getRequiredAssets() override {
|
||||
auto assMan = &this->game->assetManager;
|
||||
std::vector<Asset*> assets;
|
||||
vectorAppend(&assets, PlayerPrefab::getRequiredAssets(assMan));
|
||||
return assets;
|
||||
}
|
||||
|
||||
public:
|
||||
TestScene(DawnGame *game) : Scene(game) {}
|
||||
};
|
||||
}
|
||||
@@ -1,34 +0,0 @@
|
||||
# Copyright (c) 2022 Dominic Masters
|
||||
#
|
||||
# This software is released under the MIT License.
|
||||
# https://opensource.org/licenses/MIT
|
||||
|
||||
# Add Common Engine Parts
|
||||
set(DAWN_VISUAL_NOVEL true CACHE INTERNAL ${DAWN_CACHE_TARGET})
|
||||
|
||||
# Build Project
|
||||
add_executable(${DAWN_TARGET_NAME})
|
||||
|
||||
# Includes
|
||||
target_include_directories(${DAWN_TARGET_NAME}
|
||||
PUBLIC
|
||||
${CMAKE_CURRENT_LIST_DIR}
|
||||
)
|
||||
|
||||
# Subdirs
|
||||
add_subdirectory(game)
|
||||
add_subdirectory(ui)
|
||||
add_subdirectory(visualnovel)
|
||||
add_subdirectory(prefabs)
|
||||
add_subdirectory(save)
|
||||
add_subdirectory(scenes)
|
||||
|
||||
# Assets
|
||||
set(DIR_GAME_ASSETS games/pokergame)
|
||||
tool_texture(texture_test texture_test.png)
|
||||
tool_language(locale_poker ${DIR_GAME_ASSETS}/locale/locale.xml)
|
||||
tool_tileset(tileset_death texture_death ${DIR_GAME_ASSETS}/characters/death/sheet.png 1 3)
|
||||
tool_tileset(tileset_penny texture_penny ${DIR_GAME_ASSETS}/characters/penny/sheet.png 1 3)
|
||||
tool_truetype(truetype_bizudp ${DIR_GAME_ASSETS}/font/BIZUDPGothic-Regular.ttf truetype_bizudp 2048 2048 120)
|
||||
tool_audio(audio_test borrowed/sample_short.wav)
|
||||
tool_vnscene(Scene_1 ${DIR_GAME_ASSETS}/vn/Scene_1.xml)
|
||||
@@ -1,10 +0,0 @@
|
||||
# Copyright (c) 2022 Dominic Masters
|
||||
#
|
||||
# This software is released under the MIT License.
|
||||
# https://opensource.org/licenses/MIT
|
||||
|
||||
# Sources
|
||||
target_sources(${DAWN_TARGET_NAME}
|
||||
PRIVATE
|
||||
DawnGame.cpp
|
||||
)
|
||||
@@ -1,59 +0,0 @@
|
||||
// Copyright (c) 2022 Dominic Masters
|
||||
//
|
||||
// This software is released under the MIT License.
|
||||
// https://opensource.org/licenses/MIT
|
||||
|
||||
#include "DawnGame.hpp"
|
||||
#include "scenes/Scene_1.hpp"
|
||||
|
||||
using namespace Dawn;
|
||||
|
||||
DawnGame::DawnGame(DawnHost *host) :
|
||||
host(host),
|
||||
renderManager(this),
|
||||
inputManager(this),
|
||||
localeManager(this),
|
||||
saveManager(this),
|
||||
audioManager(this)
|
||||
{
|
||||
}
|
||||
|
||||
int32_t DawnGame::init() {
|
||||
this->assetManager.init();
|
||||
this->localeManager.init();
|
||||
this->renderManager.init();
|
||||
this->audioManager.init();
|
||||
|
||||
this->scene = new Scene_1(this);
|
||||
|
||||
return DAWN_GAME_INIT_RESULT_SUCCESS;
|
||||
}
|
||||
|
||||
int32_t DawnGame::update(float_t delta) {
|
||||
if(this->sceneToCutTo != nullptr) {
|
||||
if(this->sceneToCutTo == this->scene) {
|
||||
delete this->scene;
|
||||
this->scene = nullptr;
|
||||
} else {
|
||||
delete this->scene;
|
||||
this->scene = this->sceneToCutTo;
|
||||
}
|
||||
this->sceneToCutTo = nullptr;
|
||||
}
|
||||
|
||||
this->assetManager.update();
|
||||
this->inputManager.update();
|
||||
this->timeManager.update(delta);
|
||||
|
||||
if(this->scene != nullptr) this->scene->update();
|
||||
|
||||
this->renderManager.update();
|
||||
|
||||
return DAWN_GAME_UPDATE_RESULT_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
void DawnGame::sceneCutover(Scene *scene) {
|
||||
if(scene == nullptr) scene = this->scene;
|
||||
this->sceneToCutTo = scene;
|
||||
}
|
||||
@@ -1,31 +0,0 @@
|
||||
// Copyright (c) 2022 Dominic Masters
|
||||
//
|
||||
// This software is released under the MIT License.
|
||||
// https://opensource.org/licenses/MIT
|
||||
|
||||
#pragma once
|
||||
#include "game/_DawnGame.hpp"
|
||||
#include "scene/components/Components.hpp"
|
||||
#include "save/PokerSaveManager.hpp"
|
||||
|
||||
namespace Dawn {
|
||||
class DawnGame : public IDawnGame {
|
||||
private:
|
||||
Scene *sceneToCutTo = nullptr;
|
||||
|
||||
public:
|
||||
DawnHost *host;
|
||||
RenderManager renderManager;
|
||||
AssetManager assetManager;
|
||||
InputManager inputManager;
|
||||
TimeManager timeManager;
|
||||
LocaleManager localeManager;
|
||||
PokerSaveManager saveManager;
|
||||
AudioManager audioManager;
|
||||
|
||||
DawnGame(DawnHost *host);
|
||||
int32_t init() override;
|
||||
int32_t update(float_t delta) override;
|
||||
void sceneCutover(Scene *scene) override;
|
||||
};
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
// Copyright (c) 2022 Dominic Masters
|
||||
//
|
||||
// This software is released under the MIT License.
|
||||
// https://opensource.org/licenses/MIT
|
||||
|
||||
#pragma once
|
||||
#include "input/InputManager.hpp"
|
||||
|
||||
#define dbind(n) ((inputbind_t)n)
|
||||
|
||||
#define INPUT_BIND_ACCEPT dbind(1)
|
||||
#define INPUT_BIND_NEGATIVE_X dbind(2)
|
||||
#define INPUT_BIND_POSITIVE_X dbind(3)
|
||||
#define INPUT_BIND_NEGATIVE_Y dbind(4)
|
||||
#define INPUT_BIND_POSITIVE_Y dbind(5)
|
||||
@@ -1,6 +0,0 @@
|
||||
# Copyright (c) 2022 Dominic Masters
|
||||
#
|
||||
# This software is released under the MIT License.
|
||||
# https://opensource.org/licenses/MIT
|
||||
|
||||
add_subdirectory(characters)
|
||||
@@ -1,11 +0,0 @@
|
||||
# Copyright (c) 2023 Dominic Masters
|
||||
#
|
||||
# This software is released under the MIT License.
|
||||
# https://opensource.org/licenses/MIT
|
||||
|
||||
# Sources
|
||||
target_sources(${DAWN_TARGET_NAME}
|
||||
PRIVATE
|
||||
CharacterPrefab.cpp
|
||||
DeathPrefab.cpp
|
||||
)
|
||||
@@ -1,8 +0,0 @@
|
||||
// Copyright (c) 2023 Dominic Masters
|
||||
//
|
||||
// This software is released under the MIT License.
|
||||
// https://opensource.org/licenses/MIT
|
||||
|
||||
#include "CharacterPrefab.hpp"
|
||||
|
||||
using namespace Dawn;
|
||||
@@ -1,82 +0,0 @@
|
||||
// Copyright (c) 2023 Dominic Masters
|
||||
//
|
||||
// This software is released under the MIT License.
|
||||
// https://opensource.org/licenses/MIT
|
||||
|
||||
#pragma once
|
||||
#include "prefab/SceneItemPrefab.hpp"
|
||||
#include "scene/Scene.hpp"
|
||||
#include "scene/components/display/MeshRenderer.hpp"
|
||||
#include "scene/components/display/AnimationController.hpp"
|
||||
#include "scene/components/display/MeshHost.hpp"
|
||||
#include "scene/components/display/material/SimpleTexturedMaterial.hpp"
|
||||
#include "scene/components/audio/AudioSource.hpp"
|
||||
#include "visualnovel/components/VisualNovelCharacter.hpp"
|
||||
|
||||
namespace Dawn {
|
||||
template<class O>
|
||||
class CharacterPrefab : public SceneItemPrefab<O> {
|
||||
protected:
|
||||
/**
|
||||
* Character Prefab will request you to initialize your characters'
|
||||
* emotions here, including loading assets,
|
||||
*
|
||||
* @return struct VisualNovelCharacterEmotion
|
||||
*/
|
||||
virtual struct VisualNovelCharacterEmotion defineAndGetInitialEmotion(
|
||||
AssetManager *assMan
|
||||
) = 0;
|
||||
|
||||
|
||||
public:
|
||||
static std::vector<Asset*> prefabAssets(AssetManager *assMan) {
|
||||
return std::vector<Asset*>{
|
||||
assMan->get<TextureAsset>(O::getCharacterTexture()),
|
||||
assMan->get<TilesetAsset>(O::getCharacterTileset())
|
||||
};
|
||||
}
|
||||
|
||||
// Instance
|
||||
VisualNovelCharacter *vnCharacter;
|
||||
AnimationController *animation;
|
||||
TextureAsset *characterTexture;
|
||||
TilesetAsset *characterTileset;
|
||||
MeshRenderer *meshRenderer;
|
||||
MeshHost *meshHost;
|
||||
SimpleTexturedMaterial *material;
|
||||
TiledSprite *tiledSprite;
|
||||
AudioSource *audioSource;
|
||||
|
||||
CharacterPrefab(Scene *s, sceneitemid_t i) : SceneItemPrefab<O>(s, i) {}
|
||||
|
||||
void prefabInit(AssetManager *man) override {
|
||||
characterTexture = man->get<TextureAsset>(O::getCharacterTexture());
|
||||
characterTileset = man->get<TilesetAsset>(O::getCharacterTileset());
|
||||
|
||||
// Emotions
|
||||
auto emotion = this->defineAndGetInitialEmotion(man);
|
||||
|
||||
// Components
|
||||
meshRenderer = this->template addComponent<MeshRenderer>();
|
||||
meshHost = this->template addComponent<MeshHost>();
|
||||
|
||||
material = this->template addComponent<SimpleTexturedMaterial>();
|
||||
material->texture = &characterTexture->texture;
|
||||
|
||||
vnCharacter = this->template addComponent<VisualNovelCharacter>();
|
||||
vnCharacter->nameKey = O::getLanguagePrefix() + ".name";
|
||||
|
||||
animation = this->template addComponent<AnimationController>();
|
||||
|
||||
tiledSprite = this->template addComponent<TiledSprite>();
|
||||
tiledSprite->setTileset(&characterTileset->tileset);
|
||||
float_t ratio = characterTileset->tileset.getTileWidth() / characterTileset->tileset.getTileHeight();
|
||||
tiledSprite->setSize(glm::vec2(ratio, 1.0f));
|
||||
tiledSprite->setTile(emotion.tile);
|
||||
|
||||
audioSource = this->template addComponent<AudioSource>();
|
||||
|
||||
this->transform.setLocalPosition(glm::vec3(0, 0, 0));
|
||||
}
|
||||
};
|
||||
}
|
||||
@@ -1,32 +0,0 @@
|
||||
// Copyright (c) 2023 Dominic Masters
|
||||
//
|
||||
// This software is released under the MIT License.
|
||||
// https://opensource.org/licenses/MIT
|
||||
|
||||
#include "DeathPrefab.hpp"
|
||||
|
||||
using namespace Dawn;
|
||||
|
||||
std::string DeathPrefab::getCharacterTexture() {
|
||||
return "texture_death";
|
||||
}
|
||||
|
||||
std::string DeathPrefab::getCharacterTileset() {
|
||||
return "tileset_death";
|
||||
}
|
||||
|
||||
std::string DeathPrefab::getLanguagePrefix() {
|
||||
return "character.death";
|
||||
}
|
||||
|
||||
struct VisualNovelCharacterEmotion DeathPrefab::defineAndGetInitialEmotion(
|
||||
AssetManager *man
|
||||
) {
|
||||
this->emotionHappy.tile = 0;
|
||||
|
||||
this->emotionConcerned.tile = 1;
|
||||
|
||||
this->emotionSurprised.tile = 2;
|
||||
|
||||
return this->emotionHappy;
|
||||
}
|
||||
@@ -1,29 +0,0 @@
|
||||
// Copyright (c) 2023 Dominic Masters
|
||||
//
|
||||
// This software is released under the MIT License.
|
||||
// https://opensource.org/licenses/MIT
|
||||
|
||||
#pragma once
|
||||
#include "prefabs/characters/CharacterPrefab.hpp"
|
||||
|
||||
namespace Dawn {
|
||||
class DeathPrefab : public CharacterPrefab<DeathPrefab> {
|
||||
protected:
|
||||
|
||||
struct VisualNovelCharacterEmotion defineAndGetInitialEmotion(
|
||||
AssetManager *man
|
||||
) override;
|
||||
|
||||
public:
|
||||
static std::string getCharacterTexture();
|
||||
static std::string getCharacterTileset();
|
||||
static std::string getLanguagePrefix();
|
||||
|
||||
struct VisualNovelCharacterEmotion emotionHappy;
|
||||
struct VisualNovelCharacterEmotion emotionConcerned;
|
||||
struct VisualNovelCharacterEmotion emotionSurprised;
|
||||
struct VisualNovelCharacterEmotion emotionUnset;
|
||||
|
||||
DeathPrefab(Scene *s, sceneitemid_t i) : CharacterPrefab(s,i) {}
|
||||
};
|
||||
}
|
||||
@@ -1,68 +0,0 @@
|
||||
// Copyright (c) 2023 Dominic Masters
|
||||
//
|
||||
// This software is released under the MIT License.
|
||||
// https://opensource.org/licenses/MIT
|
||||
|
||||
#pragma once
|
||||
#include "prefab/SceneItemPrefab.hpp"
|
||||
#include "asset/AssetManager.hpp"
|
||||
#include "poker/PokerPlayer.hpp"
|
||||
#include "scene/components/Components.hpp"
|
||||
#include "visualnovel/components/VisualNovelCharacter.hpp"
|
||||
#include "display/animation/TiledSpriteAnimation.hpp"
|
||||
#include "scene/components/display/material/SimpleTexturedMaterial.hpp"
|
||||
|
||||
namespace Dawn {
|
||||
class PennyPrefab : public SceneItemPrefab<PennyPrefab> {
|
||||
public:
|
||||
VisualNovelCharacter *vnCharacter;
|
||||
PokerPlayer *pokerPlayer;
|
||||
SimpleTexturedMaterial *material;
|
||||
|
||||
struct VisualNovelCharacterEmotion emotionHappy;
|
||||
struct VisualNovelCharacterEmotion emotionSurprised;
|
||||
struct VisualNovelCharacterEmotion emotionConcerned;
|
||||
|
||||
static std::vector<Asset*> prefabAssets(AssetManager *assMan) {
|
||||
return std::vector<Asset*>{
|
||||
assMan->get<TextureAsset>("texture_penny"),
|
||||
assMan->get<TilesetAsset>("tileset_penny")
|
||||
};
|
||||
}
|
||||
|
||||
PennyPrefab(Scene *scene, sceneitemid_t id) : SceneItemPrefab(scene, id){}
|
||||
|
||||
void prefabInit(AssetManager *man) override {
|
||||
// Assets
|
||||
auto textureAsset = man->get<TextureAsset>("texture_penny");
|
||||
auto tilesetAsset = man->get<TilesetAsset>("tileset_penny");
|
||||
|
||||
// Emotions
|
||||
this->emotionHappy.tile = 0;
|
||||
|
||||
this->emotionSurprised.tile = 1;
|
||||
|
||||
this->emotionConcerned.tile = 2;
|
||||
|
||||
// Components
|
||||
auto meshRenderer = this->addComponent<MeshRenderer>();
|
||||
auto meshHost = this->addComponent<MeshHost>();
|
||||
|
||||
material = this->addComponent<SimpleTexturedMaterial>();
|
||||
material->texture = &textureAsset->texture;
|
||||
|
||||
auto animation = this->addComponent<AnimationController>();
|
||||
|
||||
pokerPlayer = this->addComponent<PokerPlayer>();
|
||||
|
||||
vnCharacter = this->addComponent<VisualNovelCharacter>();
|
||||
vnCharacter->nameKey = "character.penny.name";
|
||||
|
||||
auto tiledSprite = this->addComponent<TiledSprite>();
|
||||
tiledSprite->setTilesetAndSize(&tilesetAsset->tileset);
|
||||
tiledSprite->setTile(0);
|
||||
|
||||
this->transform.setLocalPosition(glm::vec3(0, 0, 0));
|
||||
}
|
||||
};
|
||||
}
|
||||
@@ -1,25 +0,0 @@
|
||||
// Copyright (c) 2023 Dominic Masters
|
||||
//
|
||||
// This software is released under the MIT License.
|
||||
// https://opensource.org/licenses/MIT
|
||||
|
||||
#pragma once
|
||||
#include "prefab/UIPrefab.hpp"
|
||||
#include "ui/UIBorder.hpp"
|
||||
|
||||
namespace Dawn {
|
||||
class UIBorderPrefab : public UIPrefab<UIBorder, UIBorderPrefab> {
|
||||
public:
|
||||
static std::vector<Asset*> prefabAssets(AssetManager *man) {
|
||||
std::vector<Asset*> assets;
|
||||
assets.push_back(man->get<TextureAsset>("texture_test"));
|
||||
return assets;
|
||||
}
|
||||
|
||||
static void prefabApply(AssetManager *man, UIBorder *border) {
|
||||
auto text = man->get<TextureAsset>("texture_test");
|
||||
border->texture = &text->texture;
|
||||
border->setBorderSize(glm::vec2(4, 4));
|
||||
}
|
||||
};
|
||||
}
|
||||
@@ -1,43 +0,0 @@
|
||||
// Copyright (c) 2023 Dominic Masters
|
||||
//
|
||||
// This software is released under the MIT License.
|
||||
// https://opensource.org/licenses/MIT
|
||||
|
||||
#pragma once
|
||||
#include "prefabs/ui/UIBorderPrefab.hpp"
|
||||
#include "visualnovel/ui/VisualNovelTextbox.hpp"
|
||||
|
||||
namespace Dawn {
|
||||
class VisualNovelTextboxPrefab :
|
||||
public UIPrefab<VisualNovelTextbox, VisualNovelTextboxPrefab>
|
||||
{
|
||||
public:
|
||||
static std::vector<Asset*> prefabAssets(AssetManager *man) {
|
||||
std::vector<Asset*> assets;
|
||||
assets.push_back(man->get<TrueTypeAsset>("truetype_bizudp"));
|
||||
vectorAppend(&assets, UIBorderPrefab::getRequiredAssets(man));
|
||||
return assets;
|
||||
}
|
||||
|
||||
static void prefabApply(AssetManager *man, VisualNovelTextbox *textbox) {
|
||||
auto assetFont = man->get<TrueTypeAsset>("truetype_bizudp");
|
||||
UIBorderPrefab::apply(&textbox->border);
|
||||
textbox->setFont(&assetFont->font);
|
||||
textbox->setFontSize(36.0f);
|
||||
textbox->setLabelPadding(glm::vec2(2, 2));
|
||||
textbox->label.textColor = COLOR_WHITE;
|
||||
|
||||
textbox->setTransform(
|
||||
UI_COMPONENT_ALIGN_STRETCH, UI_COMPONENT_ALIGN_END,
|
||||
glm::vec4(
|
||||
0,
|
||||
(assetFont->font.getLineHeight(textbox->getFontSize()) * 4) +
|
||||
(textbox->border.getBorderSize().y * 2.0f) +
|
||||
(textbox->getLabelPadding().y * 2.0f),
|
||||
0, 0
|
||||
),
|
||||
0.0f
|
||||
);
|
||||
}
|
||||
};
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
# Copyright (c) 2022 Dominic Masters
|
||||
#
|
||||
# This software is released under the MIT License.
|
||||
# https://opensource.org/licenses/MIT
|
||||
|
||||
# Sources
|
||||
target_sources(${DAWN_TARGET_NAME}
|
||||
PRIVATE
|
||||
PokerSaveManager.cpp
|
||||
)
|
||||
@@ -1,28 +0,0 @@
|
||||
// Copyright (c) 2022 Dominic Masters
|
||||
//
|
||||
// This software is released under the MIT License.
|
||||
// https://opensource.org/licenses/MIT
|
||||
|
||||
#include "PokerSaveManager.hpp"
|
||||
|
||||
using namespace Dawn;
|
||||
|
||||
PokerSaveManager::PokerSaveManager(DawnGame *game) : SaveManager(game) {
|
||||
}
|
||||
|
||||
bool_t PokerSaveManager::validateSave(struct SaveFile raw) {
|
||||
if(!raw.has(POKER_SAVE_KEY_EXAMPLE)) return true;
|
||||
this->currentSave.copy(raw, POKER_SAVE_KEY_EXAMPLE);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void PokerSaveManager::setExample(int32_t val) {
|
||||
savedata_t value;
|
||||
value.i32 = val;
|
||||
this->currentSave.set(POKER_SAVE_KEY_EXAMPLE, value);
|
||||
}
|
||||
|
||||
int32_t PokerSaveManager::getExample() {
|
||||
return this->currentSave.get(POKER_SAVE_KEY_EXAMPLE).i32;
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
// Copyright (c) 2022 Dominic Masters
|
||||
//
|
||||
// This software is released under the MIT License.
|
||||
// https://opensource.org/licenses/MIT
|
||||
|
||||
#pragma once
|
||||
#include "save/SaveManager.hpp"
|
||||
|
||||
#define POKER_SAVE_KEY_EXAMPLE "poker.example"
|
||||
|
||||
namespace Dawn {
|
||||
class PokerSaveManager : public SaveManager {
|
||||
protected:
|
||||
virtual bool_t validateSave(struct SaveFile raw) override;
|
||||
|
||||
public:
|
||||
PokerSaveManager(DawnGame *game);
|
||||
|
||||
void setExample(int32_t value);
|
||||
int32_t getExample();
|
||||
};
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
# Copyright (c) 2022 Dominic Masters
|
||||
#
|
||||
# This software is released under the MIT License.
|
||||
# https://opensource.org/licenses/MIT
|
||||
|
||||
# Sources
|
||||
target_sources(${DAWN_TARGET_NAME}
|
||||
PRIVATE
|
||||
PokerVNScene.cpp
|
||||
)
|
||||
@@ -1,39 +0,0 @@
|
||||
// Copyright (c) 2022 Dominic Masters
|
||||
//
|
||||
// This software is released under the MIT License.
|
||||
// https://opensource.org/licenses/MIT
|
||||
|
||||
#include "PokerVNScene.hpp"
|
||||
|
||||
using namespace Dawn;
|
||||
|
||||
PokerVNScene::PokerVNScene(DawnGame *game) : SimpleVNScene(game) {
|
||||
|
||||
}
|
||||
|
||||
std::vector<Asset*> PokerVNScene::getRequiredAssets() {
|
||||
auto assMan = &this->game->assetManager;
|
||||
std::vector<Asset*> assets;
|
||||
vectorAppend(&assets, SimpleVNScene::getRequiredAssets());
|
||||
vectorAppend(&assets, PokerPlayerDisplay::getAssets(assMan));
|
||||
return assets;
|
||||
}
|
||||
|
||||
void PokerVNScene::vnStage() {
|
||||
|
||||
auto pokerGameItem = this->createSceneItem();
|
||||
this->pokerGame = pokerGameItem->addComponent<PokerGame>();
|
||||
|
||||
this->pokerPlayers = this->getPokerPlayers();
|
||||
|
||||
auto it = this->pokerPlayers.begin();
|
||||
int32_t i = 0;
|
||||
while(it != this->pokerPlayers.end()) {
|
||||
auto player = *it;
|
||||
// auto uiPlayer = canvas->addElement<PokerPlayerDisplay>();
|
||||
// uiPlayer->setTransform(UI_COMPONENT_ALIGN_START, UI_COMPONENT_ALIGN_START, glm::vec4(i * 220, 0, 220, 200), 0);
|
||||
// uiPlayer->setPlayer(player);
|
||||
++it;
|
||||
++i;
|
||||
}
|
||||
}
|
||||
@@ -1,39 +0,0 @@
|
||||
// Copyright (c) 2022 Dominic Masters
|
||||
//
|
||||
// This software is released under the MIT License.
|
||||
// https://opensource.org/licenses/MIT
|
||||
|
||||
#pragma once
|
||||
#include "visualnovel/scene/SimpleVNScene.hpp"
|
||||
#include "poker/PokerGame.hpp"
|
||||
#include "visualnovel/events/PokerBetLoopEvent.hpp"
|
||||
#include "visualnovel/events/PokerInitialEvent.hpp"
|
||||
#include "ui/PokerPlayerDisplay.hpp"
|
||||
|
||||
namespace Dawn {
|
||||
class PokerVNScene : public SimpleVNScene {
|
||||
protected:
|
||||
void vnStage() override;
|
||||
std::vector<Asset*> getRequiredAssets() override;
|
||||
|
||||
/**
|
||||
* Returns the Poker Players that are in this poker scene.
|
||||
*
|
||||
* @return List of Poker Players.
|
||||
*/
|
||||
virtual std::vector<PokerPlayer*> getPokerPlayers() = 0;
|
||||
|
||||
public:
|
||||
PokerGame *pokerGame;
|
||||
std::vector<PokerPlayer*> pokerPlayers;
|
||||
std::map<PokerPlayer*, PokerPlayerDisplay*> pokerPlayerDisplays;
|
||||
|
||||
/**
|
||||
* Create a simple Poker Visual Novel Scene. Simplifies some of the less
|
||||
* interesting parts of a poker VN game.
|
||||
*
|
||||
* @param game Game that this poker scene belongs to.
|
||||
*/
|
||||
PokerVNScene(DawnGame *game);
|
||||
};
|
||||
}
|
||||
@@ -1,45 +0,0 @@
|
||||
// Copyright (c) 2022 Dominic Masters
|
||||
//
|
||||
// This software is released under the MIT License.
|
||||
// https://opensource.org/licenses/MIT
|
||||
|
||||
#pragma once
|
||||
#include "visualnovel/scene/SimpleVNScene.hpp"
|
||||
#include "scenes/Scene_11.hpp"
|
||||
|
||||
namespace Dawn {
|
||||
class Scene_10 : public SimpleVNScene {
|
||||
protected:
|
||||
void vnStage() override {
|
||||
|
||||
}
|
||||
|
||||
void onSceneEnded() {
|
||||
auto scene = new Scene_11(this->game);
|
||||
game->assetManager.queueSwap(
|
||||
scene->getRequiredAssets(), this->getRequiredAssets()
|
||||
);
|
||||
game->assetManager.syncLoad();
|
||||
scene->stage();
|
||||
this->game->sceneCutover(scene);
|
||||
}
|
||||
|
||||
public:
|
||||
Scene_10(DawnGame *game) : SimpleVNScene(game) {
|
||||
}
|
||||
|
||||
std::vector<Asset*> getRequiredAssets() override {
|
||||
std::vector<Asset*> assets = SimpleVNScene::getRequiredAssets();
|
||||
return assets;
|
||||
}
|
||||
|
||||
IVisualNovelEvent * getVNEvent() override {
|
||||
auto start = new VisualNovelPauseEvent(vnManager, 0.1f);
|
||||
start
|
||||
->then(new VisualNovelTextboxEvent(vnManager, "scene.10.1"))
|
||||
->then(new VisualNovelCallbackEvent<Scene_10>(vnManager, this, &Scene_10::onSceneEnded))
|
||||
;
|
||||
return start;
|
||||
}
|
||||
};
|
||||
}
|
||||
@@ -1,45 +0,0 @@
|
||||
// Copyright (c) 2022 Dominic Masters
|
||||
//
|
||||
// This software is released under the MIT License.
|
||||
// https://opensource.org/licenses/MIT
|
||||
|
||||
#pragma once
|
||||
#include "visualnovel/scene/SimpleVNScene.hpp"
|
||||
#include "scenes/Scene_12.hpp"
|
||||
|
||||
namespace Dawn {
|
||||
class Scene_11 : public SimpleVNScene {
|
||||
protected:
|
||||
void vnStage() override {
|
||||
|
||||
}
|
||||
|
||||
void onSceneEnded() {
|
||||
auto scene = new Scene_12(this->game);
|
||||
game->assetManager.queueSwap(
|
||||
scene->getRequiredAssets(), this->getRequiredAssets()
|
||||
);
|
||||
game->assetManager.syncLoad();
|
||||
scene->stage();
|
||||
this->game->sceneCutover(scene);
|
||||
}
|
||||
|
||||
public:
|
||||
Scene_11(DawnGame *game) : SimpleVNScene(game) {
|
||||
}
|
||||
|
||||
std::vector<Asset*> getRequiredAssets() override {
|
||||
std::vector<Asset*> assets = SimpleVNScene::getRequiredAssets();
|
||||
return assets;
|
||||
}
|
||||
|
||||
IVisualNovelEvent * getVNEvent() override {
|
||||
auto start = new VisualNovelPauseEvent(vnManager, 0.1f);
|
||||
start
|
||||
->then(new VisualNovelTextboxEvent(vnManager, "scene.11.1"))
|
||||
->then(new VisualNovelCallbackEvent<Scene_11>(vnManager, this, &Scene_11::onSceneEnded))
|
||||
;
|
||||
return start;
|
||||
}
|
||||
};
|
||||
}
|
||||
@@ -1,66 +0,0 @@
|
||||
// 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_13.hpp"
|
||||
|
||||
namespace Dawn {
|
||||
class Scene_12 : 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 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 {
|
||||
return std::vector<PokerPlayer*>{
|
||||
this->penny->getComponent<PokerPlayer>(),
|
||||
this->julie->getComponent<PokerPlayer>(),
|
||||
this->sammy->getComponent<PokerPlayer>(),
|
||||
this->lucy->getComponent<PokerPlayer>()
|
||||
};
|
||||
}
|
||||
|
||||
public:
|
||||
Scene_12(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;
|
||||
}
|
||||
|
||||
IVisualNovelEvent * getVNEvent() override {
|
||||
auto start = new VisualNovelTextboxEvent(vnManager, "scene.12.1");
|
||||
start
|
||||
->then(new VisualNovelCallbackEvent<Scene_12>(vnManager, this, &Scene_12::onSceneEnded))
|
||||
;
|
||||
return start;
|
||||
}
|
||||
};
|
||||
}
|
||||
@@ -1,45 +0,0 @@
|
||||
// Copyright (c) 2022 Dominic Masters
|
||||
//
|
||||
// This software is released under the MIT License.
|
||||
// https://opensource.org/licenses/MIT
|
||||
|
||||
#pragma once
|
||||
#include "visualnovel/scene/SimpleVNScene.hpp"
|
||||
#include "scenes/Scene_14.hpp"
|
||||
|
||||
namespace Dawn {
|
||||
class Scene_13 : public SimpleVNScene {
|
||||
protected:
|
||||
void vnStage() override {
|
||||
|
||||
}
|
||||
|
||||
void onSceneEnded() {
|
||||
auto scene = new Scene_14(this->game);
|
||||
game->assetManager.queueSwap(
|
||||
scene->getRequiredAssets(), this->getRequiredAssets()
|
||||
);
|
||||
game->assetManager.syncLoad();
|
||||
scene->stage();
|
||||
this->game->sceneCutover(scene);
|
||||
}
|
||||
|
||||
public:
|
||||
Scene_13(DawnGame *game) : SimpleVNScene(game) {
|
||||
}
|
||||
|
||||
std::vector<Asset*> getRequiredAssets() override {
|
||||
std::vector<Asset*> assets = SimpleVNScene::getRequiredAssets();
|
||||
return assets;
|
||||
}
|
||||
|
||||
IVisualNovelEvent * getVNEvent() override {
|
||||
auto start = new VisualNovelPauseEvent(vnManager, 0.1f);
|
||||
start
|
||||
->then(new VisualNovelTextboxEvent(vnManager, "scene.13.1"))
|
||||
->then(new VisualNovelCallbackEvent<Scene_13>(vnManager, this, &Scene_13::onSceneEnded))
|
||||
;
|
||||
return start;
|
||||
}
|
||||
};
|
||||
}
|
||||
@@ -1,45 +0,0 @@
|
||||
// Copyright (c) 2022 Dominic Masters
|
||||
//
|
||||
// This software is released under the MIT License.
|
||||
// https://opensource.org/licenses/MIT
|
||||
|
||||
#pragma once
|
||||
#include "visualnovel/scene/SimpleVNScene.hpp"
|
||||
#include "scenes/Scene_15.hpp"
|
||||
|
||||
namespace Dawn {
|
||||
class Scene_14 : public SimpleVNScene {
|
||||
protected:
|
||||
void vnStage() override {
|
||||
|
||||
}
|
||||
|
||||
void onSceneEnded() {
|
||||
auto scene = new Scene_15(this->game);
|
||||
game->assetManager.queueSwap(
|
||||
scene->getRequiredAssets(), this->getRequiredAssets()
|
||||
);
|
||||
game->assetManager.syncLoad();
|
||||
scene->stage();
|
||||
this->game->sceneCutover(scene);
|
||||
}
|
||||
|
||||
public:
|
||||
Scene_14(DawnGame *game) : SimpleVNScene(game) {
|
||||
}
|
||||
|
||||
std::vector<Asset*> getRequiredAssets() override {
|
||||
std::vector<Asset*> assets = SimpleVNScene::getRequiredAssets();
|
||||
return assets;
|
||||
}
|
||||
|
||||
IVisualNovelEvent * getVNEvent() override {
|
||||
auto start = new VisualNovelPauseEvent(vnManager, 0.1f);
|
||||
start
|
||||
->then(new VisualNovelTextboxEvent(vnManager, "scene.14.1"))
|
||||
->then(new VisualNovelCallbackEvent<Scene_14>(vnManager, this, &Scene_14::onSceneEnded))
|
||||
;
|
||||
return start;
|
||||
}
|
||||
};
|
||||
}
|
||||
@@ -1,45 +0,0 @@
|
||||
// Copyright (c) 2022 Dominic Masters
|
||||
//
|
||||
// This software is released under the MIT License.
|
||||
// https://opensource.org/licenses/MIT
|
||||
|
||||
#pragma once
|
||||
#include "visualnovel/scene/SimpleVNScene.hpp"
|
||||
#include "scenes/Scene_16.hpp"
|
||||
|
||||
namespace Dawn {
|
||||
class Scene_15 : public SimpleVNScene {
|
||||
protected:
|
||||
void vnStage() override {
|
||||
|
||||
}
|
||||
|
||||
void onSceneEnded() {
|
||||
auto scene = new Scene_16(this->game);
|
||||
game->assetManager.queueSwap(
|
||||
scene->getRequiredAssets(), this->getRequiredAssets()
|
||||
);
|
||||
game->assetManager.syncLoad();
|
||||
scene->stage();
|
||||
this->game->sceneCutover(scene);
|
||||
}
|
||||
|
||||
public:
|
||||
Scene_15(DawnGame *game) : SimpleVNScene(game) {
|
||||
}
|
||||
|
||||
std::vector<Asset*> getRequiredAssets() override {
|
||||
std::vector<Asset*> assets = SimpleVNScene::getRequiredAssets();
|
||||
return assets;
|
||||
}
|
||||
|
||||
IVisualNovelEvent * getVNEvent() override {
|
||||
auto start = new VisualNovelPauseEvent(vnManager, 0.1f);
|
||||
start
|
||||
->then(new VisualNovelTextboxEvent(vnManager, "scene.15.1"))
|
||||
->then(new VisualNovelCallbackEvent<Scene_15>(vnManager, this, &Scene_15::onSceneEnded))
|
||||
;
|
||||
return start;
|
||||
}
|
||||
};
|
||||
}
|
||||
@@ -1,45 +0,0 @@
|
||||
// Copyright (c) 2022 Dominic Masters
|
||||
//
|
||||
// This software is released under the MIT License.
|
||||
// https://opensource.org/licenses/MIT
|
||||
|
||||
#pragma once
|
||||
#include "visualnovel/scene/SimpleVNScene.hpp"
|
||||
#include "scenes/Scene_17.hpp"
|
||||
|
||||
namespace Dawn {
|
||||
class Scene_16 : public SimpleVNScene {
|
||||
protected:
|
||||
void vnStage() override {
|
||||
|
||||
}
|
||||
|
||||
void onSceneEnded() {
|
||||
auto scene = new Scene_17(this->game);
|
||||
game->assetManager.queueSwap(
|
||||
scene->getRequiredAssets(), this->getRequiredAssets()
|
||||
);
|
||||
game->assetManager.syncLoad();
|
||||
scene->stage();
|
||||
this->game->sceneCutover(scene);
|
||||
}
|
||||
public:
|
||||
Scene_16(DawnGame *game) : SimpleVNScene(game) {
|
||||
}
|
||||
|
||||
std::vector<Asset*> getRequiredAssets() override {
|
||||
std::vector<Asset*> assets = SimpleVNScene::getRequiredAssets();
|
||||
return assets;
|
||||
}
|
||||
|
||||
IVisualNovelEvent * getVNEvent() override {
|
||||
auto start = new VisualNovelPauseEvent(vnManager, 0.1f);
|
||||
start
|
||||
->then(new VisualNovelTextboxEvent(vnManager, "scene.16.1"))
|
||||
->then(new VisualNovelCallbackEvent<Scene_16>(vnManager, this, &Scene_16::onSceneEnded))
|
||||
;
|
||||
return start;
|
||||
}
|
||||
|
||||
};
|
||||
}
|
||||
@@ -1,66 +0,0 @@
|
||||
// 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 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>()
|
||||
};
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
IVisualNovelEvent * getVNEvent() override {
|
||||
auto start = new VisualNovelTextboxEvent(vnManager, "scene.17.1");
|
||||
start
|
||||
->then(new VisualNovelCallbackEvent<Scene_17>(vnManager, this, &Scene_17::onSceneEnded))
|
||||
;
|
||||
return start;
|
||||
}
|
||||
};
|
||||
}
|
||||
@@ -1,37 +0,0 @@
|
||||
// Copyright (c) 2022 Dominic Masters
|
||||
//
|
||||
// This software is released under the MIT License.
|
||||
// https://opensource.org/licenses/MIT
|
||||
|
||||
#pragma once
|
||||
#include "visualnovel/scene/SimpleVNScene.hpp"
|
||||
|
||||
namespace Dawn {
|
||||
class Scene_18 : public SimpleVNScene {
|
||||
protected:
|
||||
void vnStage() override {
|
||||
|
||||
}
|
||||
|
||||
void onSceneEnded() {
|
||||
}
|
||||
|
||||
public:
|
||||
Scene_18(DawnGame *game) : SimpleVNScene(game) {
|
||||
}
|
||||
|
||||
std::vector<Asset*> getRequiredAssets() override {
|
||||
std::vector<Asset*> assets = SimpleVNScene::getRequiredAssets();
|
||||
return assets;
|
||||
}
|
||||
|
||||
IVisualNovelEvent * getVNEvent() override {
|
||||
auto start = new VisualNovelPauseEvent(vnManager, 0.1f);
|
||||
start
|
||||
->then(new VisualNovelTextboxEvent(vnManager, "scene.18.1"))
|
||||
->then(new VisualNovelCallbackEvent<Scene_18>(vnManager, this, &Scene_18::onSceneEnded))
|
||||
;
|
||||
return start;
|
||||
}
|
||||
};
|
||||
}
|
||||
@@ -1,46 +0,0 @@
|
||||
// Copyright (c) 2022 Dominic Masters
|
||||
//
|
||||
// This software is released under the MIT License.
|
||||
// https://opensource.org/licenses/MIT
|
||||
|
||||
#pragma once
|
||||
#include "visualnovel/scene/SimpleVNScene.hpp"
|
||||
#include "scenes/Scene_3.hpp"
|
||||
|
||||
namespace Dawn {
|
||||
class Scene_2 : public SimpleVNScene {
|
||||
protected:
|
||||
void vnStage() override {
|
||||
|
||||
}
|
||||
|
||||
void onSceneEnded() {
|
||||
auto scene = new Scene_3(this->game);
|
||||
game->assetManager.queueSwap(
|
||||
scene->getRequiredAssets(), this->getRequiredAssets()
|
||||
);
|
||||
game->assetManager.syncLoad();
|
||||
scene->stage();
|
||||
this->game->sceneCutover(scene);
|
||||
}
|
||||
|
||||
public:
|
||||
Scene_2(DawnGame *game) : SimpleVNScene(game) {
|
||||
|
||||
}
|
||||
|
||||
std::vector<Asset*> getRequiredAssets() override {
|
||||
std::vector<Asset*> assets = SimpleVNScene::getRequiredAssets();
|
||||
return assets;
|
||||
}
|
||||
|
||||
IVisualNovelEvent * getVNEvent() override {
|
||||
auto start = new VisualNovelPauseEvent(vnManager, 0.1f);
|
||||
start
|
||||
->then(new VisualNovelTextboxEvent(vnManager, "scene.2.1"))
|
||||
->then(new VisualNovelCallbackEvent<Scene_2>(vnManager, this, &Scene_2::onSceneEnded))
|
||||
;
|
||||
return start;
|
||||
}
|
||||
};
|
||||
}
|
||||
@@ -1,46 +0,0 @@
|
||||
// Copyright (c) 2022 Dominic Masters
|
||||
//
|
||||
// This software is released under the MIT License.
|
||||
// https://opensource.org/licenses/MIT
|
||||
|
||||
#pragma once
|
||||
#include "visualnovel/scene/SimpleVNScene.hpp"
|
||||
#include "scenes/Scene_4.hpp"
|
||||
|
||||
namespace Dawn {
|
||||
class Scene_3 : public SimpleVNScene {
|
||||
protected:
|
||||
void vnStage() override {
|
||||
|
||||
}
|
||||
|
||||
void onSceneEnded() {
|
||||
auto scene = new Scene_4(this->game);
|
||||
game->assetManager.queueSwap(
|
||||
scene->getRequiredAssets(), this->getRequiredAssets()
|
||||
);
|
||||
game->assetManager.syncLoad();
|
||||
scene->stage();
|
||||
this->game->sceneCutover(scene);
|
||||
}
|
||||
|
||||
public:
|
||||
Scene_3(DawnGame *game) : SimpleVNScene(game) {
|
||||
|
||||
}
|
||||
|
||||
std::vector<Asset*> getRequiredAssets() override {
|
||||
std::vector<Asset*> assets = SimpleVNScene::getRequiredAssets();
|
||||
return assets;
|
||||
}
|
||||
|
||||
IVisualNovelEvent * getVNEvent() override {
|
||||
auto start = new VisualNovelPauseEvent(vnManager, 0.1f);
|
||||
start
|
||||
->then(new VisualNovelTextboxEvent(vnManager, "scene.3.1"))
|
||||
->then(new VisualNovelCallbackEvent<Scene_3>(vnManager, this, &Scene_3::onSceneEnded))
|
||||
;
|
||||
return start;
|
||||
}
|
||||
};
|
||||
}
|
||||
@@ -1,66 +0,0 @@
|
||||
// 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_5.hpp"
|
||||
|
||||
namespace Dawn {
|
||||
class Scene_4 : 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 Scene_5(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>()
|
||||
};
|
||||
}
|
||||
|
||||
public:
|
||||
Scene_4(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;
|
||||
}
|
||||
|
||||
IVisualNovelEvent * getVNEvent() override {
|
||||
auto start = new VisualNovelTextboxEvent(vnManager, "scene.4.1");
|
||||
start
|
||||
->then(new VisualNovelCallbackEvent<Scene_4>(vnManager, this, &Scene_4::onSceneEnded))
|
||||
;
|
||||
return start;
|
||||
}
|
||||
};
|
||||
}
|
||||
@@ -1,46 +0,0 @@
|
||||
// Copyright (c) 2022 Dominic Masters
|
||||
//
|
||||
// This software is released under the MIT License.
|
||||
// https://opensource.org/licenses/MIT
|
||||
|
||||
#pragma once
|
||||
#include "visualnovel/scene/SimpleVNScene.hpp"
|
||||
#include "scenes/Scene_6.hpp"
|
||||
|
||||
namespace Dawn {
|
||||
class Scene_5 : public SimpleVNScene {
|
||||
protected:
|
||||
void vnStage() override {
|
||||
|
||||
}
|
||||
|
||||
void onSceneEnded() {
|
||||
auto scene = new Scene_6(this->game);
|
||||
game->assetManager.queueSwap(
|
||||
scene->getRequiredAssets(), this->getRequiredAssets()
|
||||
);
|
||||
game->assetManager.syncLoad();
|
||||
scene->stage();
|
||||
this->game->sceneCutover(scene);
|
||||
}
|
||||
|
||||
public:
|
||||
Scene_5(DawnGame *game) : SimpleVNScene(game) {
|
||||
|
||||
}
|
||||
|
||||
std::vector<Asset*> getRequiredAssets() override {
|
||||
std::vector<Asset*> assets = SimpleVNScene::getRequiredAssets();
|
||||
return assets;
|
||||
}
|
||||
|
||||
IVisualNovelEvent * getVNEvent() override {
|
||||
auto start = new VisualNovelPauseEvent(vnManager, 0.1f);
|
||||
start
|
||||
->then(new VisualNovelTextboxEvent(vnManager, "scene.5.1"))
|
||||
->then(new VisualNovelCallbackEvent<Scene_5>(vnManager, this, &Scene_5::onSceneEnded))
|
||||
;
|
||||
return start;
|
||||
}
|
||||
};
|
||||
}
|
||||
@@ -1,46 +0,0 @@
|
||||
// Copyright (c) 2022 Dominic Masters
|
||||
//
|
||||
// This software is released under the MIT License.
|
||||
// https://opensource.org/licenses/MIT
|
||||
|
||||
#pragma once
|
||||
#include "visualnovel/scene/SimpleVNScene.hpp"
|
||||
#include "scenes/Scene_7.hpp"
|
||||
|
||||
namespace Dawn {
|
||||
class Scene_6 : public SimpleVNScene {
|
||||
protected:
|
||||
void vnStage() override {
|
||||
|
||||
}
|
||||
|
||||
void onSceneEnded() {
|
||||
auto scene = new Scene_7(this->game);
|
||||
game->assetManager.queueSwap(
|
||||
scene->getRequiredAssets(), this->getRequiredAssets()
|
||||
);
|
||||
game->assetManager.syncLoad();
|
||||
scene->stage();
|
||||
this->game->sceneCutover(scene);
|
||||
}
|
||||
|
||||
public:
|
||||
Scene_6(DawnGame *game) : SimpleVNScene(game) {
|
||||
|
||||
}
|
||||
|
||||
std::vector<Asset*> getRequiredAssets() override {
|
||||
std::vector<Asset*> assets = SimpleVNScene::getRequiredAssets();
|
||||
return assets;
|
||||
}
|
||||
|
||||
IVisualNovelEvent * getVNEvent() override {
|
||||
auto start = new VisualNovelPauseEvent(vnManager, 0.1f);
|
||||
start
|
||||
->then(new VisualNovelTextboxEvent(vnManager, "scene.6.1"))
|
||||
->then(new VisualNovelCallbackEvent<Scene_6>(vnManager, this, &Scene_6::onSceneEnded))
|
||||
;
|
||||
return start;
|
||||
}
|
||||
};
|
||||
}
|
||||
@@ -1,45 +0,0 @@
|
||||
// Copyright (c) 2022 Dominic Masters
|
||||
//
|
||||
// This software is released under the MIT License.
|
||||
// https://opensource.org/licenses/MIT
|
||||
|
||||
#pragma once
|
||||
#include "visualnovel/scene/SimpleVNScene.hpp"
|
||||
#include "scenes/Scene_8.hpp"
|
||||
|
||||
namespace Dawn {
|
||||
class Scene_7 : public SimpleVNScene {
|
||||
protected:
|
||||
void vnStage() override {
|
||||
|
||||
}
|
||||
|
||||
void onSceneEnded() {
|
||||
auto scene = new Scene_8(this->game);
|
||||
game->assetManager.queueSwap(
|
||||
scene->getRequiredAssets(), this->getRequiredAssets()
|
||||
);
|
||||
game->assetManager.syncLoad();
|
||||
scene->stage();
|
||||
this->game->sceneCutover(scene);
|
||||
}
|
||||
|
||||
public:
|
||||
Scene_7(DawnGame *game) : SimpleVNScene(game) {
|
||||
}
|
||||
|
||||
std::vector<Asset*> getRequiredAssets() override {
|
||||
std::vector<Asset*> assets = SimpleVNScene::getRequiredAssets();
|
||||
return assets;
|
||||
}
|
||||
|
||||
IVisualNovelEvent * getVNEvent() override {
|
||||
auto start = new VisualNovelPauseEvent(vnManager, 0.1f);
|
||||
start
|
||||
->then(new VisualNovelTextboxEvent(vnManager, "scene.7.1"))
|
||||
->then(new VisualNovelCallbackEvent<Scene_7>(vnManager, this, &Scene_7::onSceneEnded))
|
||||
;
|
||||
return start;
|
||||
}
|
||||
};
|
||||
}
|
||||
@@ -1,66 +0,0 @@
|
||||
// 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_9.hpp"
|
||||
|
||||
namespace Dawn {
|
||||
class Scene_8 : 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 Scene_9(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>()
|
||||
};
|
||||
}
|
||||
|
||||
public:
|
||||
Scene_8(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;
|
||||
}
|
||||
|
||||
IVisualNovelEvent * getVNEvent() override {
|
||||
auto start = new VisualNovelTextboxEvent(vnManager, "scene.8.1");
|
||||
start
|
||||
->then(new VisualNovelCallbackEvent<Scene_8>(vnManager, this, &Scene_8::onSceneEnded))
|
||||
;
|
||||
return start;
|
||||
}
|
||||
};
|
||||
}
|
||||
Loaded 100 of 156 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user