Starting new VN Structure
This commit is contained in:
10
archive/visualnovel/events/animation/CMakeLists.txt
Normal file
10
archive/visualnovel/events/animation/CMakeLists.txt
Normal file
@ -0,0 +1,10 @@
|
||||
# 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
|
||||
VisualNovelAnimationEvent.cpp
|
||||
)
|
@ -0,0 +1,27 @@
|
||||
// Copyright (c) 2022 Dominic Masters
|
||||
//
|
||||
// This software is released under the MIT License.
|
||||
// https://opensource.org/licenses/MIT
|
||||
|
||||
#include "VisualNovelAnimationEvent.hpp"
|
||||
#include "game/DawnGame.hpp"
|
||||
|
||||
using namespace Dawn;
|
||||
|
||||
VisualNovelAnimationEvent::VisualNovelAnimationEvent(
|
||||
VisualNovelManager *manager
|
||||
) : IVisualNovelEvent(manager) {
|
||||
}
|
||||
|
||||
void VisualNovelAnimationEvent::onStart(IVisualNovelEvent *previous) {
|
||||
|
||||
}
|
||||
|
||||
bool_t VisualNovelAnimationEvent::onUpdate() {
|
||||
this->animation->tick(this->manager->getGame()->timeManager.delta);
|
||||
return !this->animation->finished;
|
||||
}
|
||||
|
||||
void VisualNovelAnimationEvent::onEnd() {
|
||||
|
||||
}
|
@ -0,0 +1,22 @@
|
||||
// Copyright (c) 2022 Dominic Masters
|
||||
//
|
||||
// This software is released under the MIT License.
|
||||
// https://opensource.org/licenses/MIT
|
||||
|
||||
#pragma once
|
||||
#include "visualnovel/VisualNovelManager.hpp"
|
||||
#include "display/animation/Animation.hpp"
|
||||
|
||||
namespace Dawn {
|
||||
class VisualNovelAnimationEvent : public IVisualNovelEvent {
|
||||
protected:
|
||||
struct Animation *animation;
|
||||
|
||||
void onStart(IVisualNovelEvent *previous) override;
|
||||
bool_t onUpdate() override;
|
||||
void onEnd() override;
|
||||
|
||||
public:
|
||||
VisualNovelAnimationEvent(VisualNovelManager *manager);
|
||||
};
|
||||
}
|
@ -0,0 +1,26 @@
|
||||
// Copyright (c) 2022 Dominic Masters
|
||||
//
|
||||
// This software is released under the MIT License.
|
||||
// https://opensource.org/licenses/MIT
|
||||
|
||||
#pragma once
|
||||
#include "VisualNovelAnimationEvent.hpp"
|
||||
#include "display/animation/SimpleAnimation.hpp"
|
||||
|
||||
namespace Dawn {
|
||||
template<typename T>
|
||||
class VisualNovelSimpleAnimationEvent : public VisualNovelAnimationEvent {
|
||||
public:
|
||||
struct SimpleAnimation<T> simpleAnimation;
|
||||
|
||||
VisualNovelSimpleAnimationEvent(
|
||||
VisualNovelManager *man,
|
||||
T *modifies
|
||||
) :
|
||||
VisualNovelAnimationEvent(man),
|
||||
simpleAnimation(modifies)
|
||||
{
|
||||
this->animation = &this->simpleAnimation;
|
||||
}
|
||||
};
|
||||
}
|
@ -0,0 +1,24 @@
|
||||
// Copyright (c) 2023 Dominic Masters
|
||||
//
|
||||
// This software is released under the MIT License.
|
||||
// https://opensource.org/licenses/MIT
|
||||
|
||||
#pragma once
|
||||
#include "VisualNovelAnimationEvent.hpp"
|
||||
#include "display/animation/SimpleCallbackAnimation.hpp"
|
||||
|
||||
namespace Dawn {
|
||||
template<typename T, class I>
|
||||
class VisualNovelSimpleCallbackAnimationEvent :
|
||||
public VisualNovelAnimationEvent
|
||||
{
|
||||
public:
|
||||
struct SimpleCallbackAnimation<T, I> callbackAnimation;
|
||||
|
||||
VisualNovelSimpleCallbackAnimationEvent(VisualNovelManager *man) :
|
||||
VisualNovelAnimationEvent(man)
|
||||
{
|
||||
this->animation = &callbackAnimation;
|
||||
}
|
||||
};
|
||||
}
|
Reference in New Issue
Block a user