Kinoko
A reimplementation of Mario Kart Wii's physics engine in C++
Toggle main menu visibility
Loading...
Searching...
No Matches
AnmMgr.hh
1
#pragma once
2
3
#include "game/system/ResourceManager.hh"
4
5
#include <abstract/g3d/ResFile.hh>
6
7
#include <egg/core/Allocator.hh>
8
9
namespace
Kinoko::Render
{
10
11
class
DrawMdl
;
12
13
enum class
AnmType : s32 {
14
Empty = -1,
15
Chr = 0,
16
Clr = 1,
17
Srt = 2,
18
Pat = 3,
19
Shp = 4,
20
Max = 5,
21
};
22
23
class
AnmNodeChr {
24
public
:
25
AnmNodeChr(
Abstract::g3d::AnmObjChrRes
anmObjChrRes, AnmType anmType,
size_t
idx)
26
: m_anmObjChrRes(anmObjChrRes), m_anmType(anmType), m_idx(idx) {}
27
29
[[nodiscard]] f32 frameCount()
const
{
30
return
static_cast<
f32
>
(m_anmObjChrRes.frameCount());
31
}
32
34
[[nodiscard]] f32 frame()
const
{
35
return
m_anmObjChrRes.frame();
36
}
37
38
private
:
39
Abstract::g3d::AnmObjChrRes
m_anmObjChrRes;
40
[[maybe_unused]] AnmType m_anmType;
41
[[maybe_unused]]
size_t
m_idx;
42
};
43
44
class
AnmMgr {
45
public
:
47
AnmMgr(
DrawMdl
*drawMdl) : m_parent(drawMdl) {}
48
49
void
linkAnims(
size_t
idx,
const
Abstract::g3d::ResFile
*resFile,
const
char
*name,
50
AnmType anmType);
51
void
playAnim(f32 frame, f32 rate,
size_t
idx);
52
54
[[nodiscard]]
const
AnmNodeChr
*activeAnim(AnmType anmType)
const
{
55
return
m_activeAnims[
static_cast<
size_t
>
(anmType)];
56
}
57
58
private
:
59
[[maybe_unused]]
DrawMdl
*m_parent;
60
std::list<AnmNodeChr, EGG::Allocator<AnmNodeChr>> m_anmList;
61
std::array<AnmNodeChr *, static_cast<size_t>(AnmType::Max) - 1> m_activeAnims;
62
};
63
64
}
// namespace Kinoko::Render
Kinoko::Abstract::g3d::AnmObjChrRes
Definition
ResAnmChr.hh:228
Kinoko::Abstract::g3d::ResFile
Represents a binary resource file which contains object models, textures, and animations.
Definition
ResFile.hh:14
Kinoko::Render::AnmNodeChr
Definition
AnmMgr.hh:23
Kinoko::Render::DrawMdl
Definition
DrawMdl.hh:7
Kinoko::Render
Pertains to rendering the kart model.
Definition
KartObjectProxy.hh:25
game
render
AnmMgr.hh
Made by
Malleo
. Logo by
vabold
. Website generated by
Doxygen
1.17.0