OpenMoHAA 0.82.0
Loading...
Searching...
No Matches
skeletor_name_lists.h
1/*
2===========================================================================
3Copyright (C) 2023 the OpenMoHAA team
4
5This file is part of OpenMoHAA source code.
6
7OpenMoHAA source code is free software; you can redistribute it
8and/or modify it under the terms of the GNU General Public License as
9published by the Free Software Foundation; either version 2 of the License,
10or (at your option) any later version.
11
12OpenMoHAA source code is distributed in the hope that it will be
13useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
14MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15GNU General Public License for more details.
16
17You should have received a copy of the GNU General Public License
18along with OpenMoHAA source code; if not, write to the Free Software
19Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20===========================================================================
21*/
22
23// skeletor_name_lists.h : Skeletor name lists
24
25#pragma once
26
27#define MAX_SKELETOR_CHANNELS 2560 // Limit was 2048 before 2.30
28#define MAX_CHANNEL_NAME 32
29
30typedef struct ChannelName_s {
31 char name[MAX_CHANNEL_NAME];
32 short channelNum;
33} ChannelName_t;
34
35#ifdef __cplusplus
36
38{
39 short int m_iNumChannels;
40 ChannelName_t m_Channels[MAX_SKELETOR_CHANNELS];
41 short int m_lookup[MAX_SKELETOR_CHANNELS];
42
43public:
45
46 int RegisterChannel(const char *name);
47 int FindNameLookup(const char *name);
48 void PrintContents();
49 const char *FindName(int index);
50 int NumChannels() const;
51
52private:
53 const char *FindNameFromLookup(int index);
54 bool FindIndexFromName(const char *name, int *indexPtr);
55 void SortIntoTable(int index);
56 void CopyChannel(ChannelName_t *dest, const ChannelName_t *source);
57 void SetChannelName(ChannelName_t *channel, const char *newName);
58};
59
60typedef enum channelType_e {
61 CHANNEL_ROTATION,
62 CHANNEL_POSITION,
63 CHANNEL_NONE,
64 CHANNEL_VALUE
65} channelType_t;
66
67channelType_t GetBoneChannelType(const char* name);
68
69#else
70
71typedef struct {
72 short int m_iNumChannels;
73 ChannelName_t m_Channels[MAX_SKELETOR_CHANNELS];
74 short int m_lookup[MAX_SKELETOR_CHANNELS];
76
77#endif
Definition skeletor_name_lists.h:71
Definition skeletor_name_lists.h:30