Starting new VN Structure
This commit is contained in:
17
src/dawnliminal/CMakeLists.txt
Normal file
17
src/dawnliminal/CMakeLists.txt
Normal file
@ -0,0 +1,17 @@
|
||||
# Copyright (c) 2023 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(game)
|
||||
add_subdirectory(save)
|
10
src/dawnliminal/game/CMakeLists.txt
Normal file
10
src/dawnliminal/game/CMakeLists.txt
Normal file
@ -0,0 +1,10 @@
|
||||
# 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
|
||||
LiminalGame.cpp
|
||||
)
|
13
src/dawnliminal/game/LiminalGame.cpp
Normal file
13
src/dawnliminal/game/LiminalGame.cpp
Normal file
@ -0,0 +1,13 @@
|
||||
// Copyright (c) 2023 Dominic Masters
|
||||
//
|
||||
// This software is released under the MIT License.
|
||||
// https://opensource.org/licenses/MIT
|
||||
|
||||
#include "game/DawnGame.hpp"
|
||||
#include "scenes/HelloWorldScene.hpp"
|
||||
|
||||
using namespace Dawn;
|
||||
|
||||
Scene * Dawn::dawnGameGetInitialScene(DawnGame *game) {
|
||||
return new HelloWorldScene(game);
|
||||
}
|
19
src/dawnliminal/input/InputBinds.hpp
Normal file
19
src/dawnliminal/input/InputBinds.hpp
Normal file
@ -0,0 +1,19 @@
|
||||
// Copyright (c) 2023 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)
|
||||
#define INPUT_BIND_MOUSE_X INPUT_BIND(6)
|
||||
#define INPUT_BIND_MOUSE_Y INPUT_BIND(7)
|
||||
#define INPUT_BIND_MOUSE_CLICK INPUT_BIND(8)
|
||||
#define INPUT_BIND_CANCEL INPUT_BIND(9)
|
10
src/dawnliminal/save/CMakeLists.txt
Normal file
10
src/dawnliminal/save/CMakeLists.txt
Normal file
@ -0,0 +1,10 @@
|
||||
# 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
|
||||
LiminalSave.cpp
|
||||
)
|
12
src/dawnliminal/save/LiminalSave.cpp
Normal file
12
src/dawnliminal/save/LiminalSave.cpp
Normal file
@ -0,0 +1,12 @@
|
||||
// Copyright (c) 2023 Dominic Masters
|
||||
//
|
||||
// This software is released under the MIT License.
|
||||
// https://opensource.org/licenses/MIT
|
||||
|
||||
#include "save/SaveManager.hpp"
|
||||
|
||||
using namespace Dawn;
|
||||
|
||||
bool_t Dawn::saveValidateFile(struct SaveFile raw) {
|
||||
return false;
|
||||
}
|
48
src/dawnliminal/scenes/HelloWorldScene.hpp
Normal file
48
src/dawnliminal/scenes/HelloWorldScene.hpp
Normal file
@ -0,0 +1,48 @@
|
||||
// Copyright (c) 2023 Dominic Masters
|
||||
//
|
||||
// This software is released under the MIT License.
|
||||
// https://opensource.org/licenses/MIT
|
||||
|
||||
#pragma once
|
||||
#include "scene/Scene.hpp"
|
||||
#include "scene/components/display/Camera.hpp"
|
||||
#include "prefabs/SimpleSpinningCubePrefab.hpp"
|
||||
#include "games/vn/components/VNManager.hpp"
|
||||
#include "games/vn/events/VNDummyEvent.hpp"
|
||||
|
||||
namespace Dawn {
|
||||
class HelloWorldScene : public Scene {
|
||||
protected:
|
||||
Camera *camera;
|
||||
UICanvas *canvas;
|
||||
|
||||
void stage() override {
|
||||
canvas = UICanvas::create(this);
|
||||
|
||||
camera = Camera::create(this);
|
||||
camera->fov = 0.436332f;
|
||||
camera->transform->lookAt(glm::vec3(10, 10, 10), glm::vec3(0, 0, 0));
|
||||
|
||||
auto cube = SimpleSpinningCubePrefab::create(this);
|
||||
|
||||
auto vnItem = this->createSceneItem();
|
||||
auto vnManager = vnItem->addComponent<VNManager>();
|
||||
|
||||
auto eventTest = vnManager->createEvent<VNDummyEvent>();
|
||||
eventTest
|
||||
->then(vnManager->createEvent<VNDummyEvent>())
|
||||
->then(vnManager->createEvent<VNDummyEvent>())
|
||||
;
|
||||
vnManager->setEvent(eventTest);
|
||||
}
|
||||
|
||||
std::vector<Asset*> getRequiredAssets() override {
|
||||
auto assMan = &this->game->assetManager;
|
||||
std::vector<Asset*> assets;
|
||||
return assets;
|
||||
}
|
||||
|
||||
public:
|
||||
HelloWorldScene(DawnGame *game) : Scene(game) {}
|
||||
};
|
||||
}
|
Reference in New Issue
Block a user