OpenMoHAA 0.82.0
Loading...
Searching...
No Matches
tiki.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#pragma once
24
25#include "q_shared.h"
26
27#include "../tiki/tiki_shared.h"
28
29#ifdef __cplusplus
30class Archiver;
31# include "../qcommon/mem_blockalloc.h"
32# include "../qcommon/con_set.h"
33# include "../qcommon/str.h"
34#endif
35
36#define MAX_TIKI_LOAD_ANIMS 4095
37#define MAX_TIKI_LOAD_SKEL_INDEX 12
38#define MAX_TIKI_LOAD_SERVER_INIT_COMMANDS 160
39#define MAX_TIKI_LOAD_CLIENT_INIT_COMMANDS 180 // 2.30: Increased from 160 to 180
40#define MAX_TIKI_LOAD_HEADMODELS_LENGTH 4096
41#define MAX_TIKI_LOAD_HEADSKINS_LENGTH 4096
42#define MAX_TIKI_LOAD_MODEL_BUFFER 8192
43
44#define MAX_TIKI_LOAD_FRAME_SERVER_COMMANDS 32
45#define MAX_TIKI_LOAD_FRAME_CLIENT_COMMANDS 128
46
47#define MAX_TIKI_LOAD_SHADERS 4
48
49typedef struct AliasList_s AliasList_t;
50typedef struct AliasListNode_s AliasListNode_t;
51typedef struct msg_s msg_t;
52
53typedef struct {
54 int indexes[3];
56
57typedef struct {
58 vec2_t st;
59} tikiSt_t;
60
61typedef struct {
62 short unsigned int xyz[3];
63 short int normal;
65
66typedef struct {
67 vec3_t origin;
68 vec3_t axis[3];
70
71typedef struct {
72 char name[64];
73} tikiTag_t;
74
75typedef struct {
76 qboolean valid;
77 int surface;
78 vec3_t position;
79 vec3_t normal;
80 float damage_multiplier;
82
83typedef struct {
84 int indexes[3];
86
87typedef struct dtikicmd_s {
88 int frame_num;
89 int num_args;
90 char **args;
91} dtikicmd_t;
92
93typedef struct {
94 int frame_num;
95 int num_args;
96 char **args;
97 char location[MAX_QPATH];
99
100typedef struct {
101 int num_args;
102 char **args;
104
105typedef struct {
106 char name[MAX_NAME_LENGTH];
107 char shader[MAX_TIKI_LOAD_SHADERS][MAX_RES_NAME];
108 int numskins;
109 int flags;
110 float damage_multiplier;
112
113typedef struct {
114 char *alias;
115 char name[MAX_QPATH];
116 char location[MAX_QPATH];
117 float weight;
118 float blendtime;
119 int flags;
120 int num_client_cmds;
121 int num_server_cmds;
122 dloadframecmd_t *loadservercmds[MAX_TIKI_LOAD_FRAME_SERVER_COMMANDS];
123 dloadframecmd_t *loadclientcmds[MAX_TIKI_LOAD_FRAME_CLIENT_COMMANDS];
125
126typedef struct dloaddef_s dloaddef_t;
127
128#include "tiki_script.h"
129
130#ifdef __cplusplus
131
132typedef struct dloaddef_s {
133 const char *path;
134 class TikiScript tikiFile;
135
136 dloadanim_t *loadanims[MAX_TIKI_LOAD_ANIMS];
137 dloadinitcmd_t *loadserverinitcmds[MAX_TIKI_LOAD_SERVER_INIT_COMMANDS];
138 dloadinitcmd_t *loadclientinitcmds[MAX_TIKI_LOAD_CLIENT_INIT_COMMANDS];
139
140 int skelIndex_ld[MAX_TIKI_LOAD_SKEL_INDEX];
141 int numanims;
142 int numserverinitcmds;
143 int numclientinitcmds;
144
145 char headmodels[MAX_TIKI_LOAD_HEADMODELS_LENGTH];
146 char headskins[MAX_TIKI_LOAD_HEADSKINS_LENGTH];
147 qboolean bIsCharacter;
148
149 struct msg_s *modelBuf;
150 unsigned char modelData[MAX_TIKI_LOAD_MODEL_BUFFER];
151
152 qboolean bInIncludesSection;
153
154 // Added in 2.0
155 //====
156 char idleSkel[MAX_QPATH];
157 int numskels;
158 qboolean hasSkel;
159 //====
160} dloaddef_t;
161
162#endif
163
164#include "../skeletor/skeletor.h"
165
166#include "../qcommon/tiki_main.h"
167#include "../tiki/tiki_anim.h"
168#include "../tiki/tiki_cache.h"
169#include "../tiki/tiki_commands.h"
170#include "../tiki/tiki_files.h"
171#include "../tiki/tiki_imports.h"
172#include "../tiki/tiki_parse.h"
173#include "../tiki/tiki_skel.h"
174#include "../tiki/tiki_tag.h"
175#include "../tiki/tiki_utility.h"
176#include "../tiki/tiki_frame.h"
177#include "../tiki/tiki_surface.h"
178#include "../tiki/tiki_mesh.h"
Definition archive.h:86
Definition alias.h:40
Definition alias.h:63
Definition tiki.h:113
Definition tiki.h:93
Definition tiki.h:100
Definition tiki.h:105
Definition tiki.h:87
Definition qcommon.h:47
Definition tiki.h:83
Definition tiki.h:57
Definition tiki.h:66
Definition tiki.h:71
Definition tiki.h:53
Definition tiki.h:61
Definition tiki.h:75