Kinoko
A reimplementation of Mario Kart Wii's physics engine in C++
Toggle main menu visibility
Loading...
Searching...
No Matches
ObjectFlowTable.cc
1
#include "ObjectFlowTable.hh"
2
3
#include "game/system/ResourceManager.hh"
4
5
#include <cstring>
6
7
namespace
Kinoko::Field
{
8
10
ObjectFlowTable::ObjectFlowTable(
const
char
*filename) {
11
SFile
*file =
reinterpret_cast<
SFile
*
>
(System::ResourceManager::Instance()->getFile(filename,
12
nullptr
, System::ArchiveId::Core));
13
14
m_count = parse<s16>(file->count);
15
m_sets = file->sets;
16
m_slots =
reinterpret_cast<
const
s16 *
>
(m_sets + m_count);
17
}
18
20
ObjectFlowTable::~ObjectFlowTable() =
default
;
21
23
ObjectId ObjectFlowTable::getIdFromName(
const
char
*name)
const
{
24
for
(s16 i = 0; i < m_count; ++i) {
25
const
auto
*curSet = set(i);
26
ASSERT(curSet);
27
28
if
(strncmp(name, curSet->name,
sizeof
(curSet->name)) == 0) {
29
return
static_cast<
ObjectId
>
(parse<u16>(curSet->id));
30
}
31
}
32
33
return
ObjectId::None;
34
}
35
36
}
// namespace Kinoko::Field
Kinoko::Field
Pertains to collision.
Definition
BoxColManager.cc:10
Kinoko::Field::ObjectFlowTable::SFile
Definition
ObjectFlowTable.hh:63
game
field
ObjectFlowTable.cc
Made by
Malleo
. Logo by
vabold
. Website generated by
Doxygen
1.17.0