UFO: Alien Invasion
ui_node_model.h
Go to the documentation of this file.
1
5/*
6Copyright (C) 2002-2022 UFO: Alien Invasion.
7
8This program is free software; you can redistribute it and/or
9modify it under the terms of the GNU General Public License
10as published by the Free Software Foundation; either version 2
11of the License, or (at your option) any later version.
12
13This program is distributed in the hope that it will be useful,
14but WITHOUT ANY WARRANTY; without even the implied warranty of
15MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
16
17See the GNU General Public License for more details.
18
19You should have received a copy of the GNU General Public License
20along with this program; if not, write to the Free Software
21Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22
23*/
24
25#pragma once
26
27#include "../ui_nodes.h"
29#include "../../cl_renderer.h"
31class uiModelNode : public uiLocatedNode {
32 void draw(uiNode_t* node) override;
33 void onMouseDown(uiNode_t* node, int x, int y, int button) override;
34 void onMouseUp(uiNode_t* node, int x, int y, int button) override;
35 void onLoading(uiNode_t* node) override;
36 void onLoaded(uiNode_t* node) override;
37 void clone(uiNode_t const* source, uiNode_t* clone) override;
38 void initNodeDynamic(uiNode_t* node) override;
39 void deleteNode(uiNode_t* node) override;
40 void onCapturedMouseMove(uiNode_t* node, int x, int y) override;
41 void doLayout (uiNode_t* node) override;
42};
43
44#define UI_MAX_MODELS 128
45
47typedef struct uiModel_s {
48 char* id;
49 char* anim;
50 char* parent;
51 char* tag;
52 int skin;
53 char* model;
57 struct uiModel_s* next;
58} uiModel_t;
59
63typedef struct modelExtraData_s {
69 const char* skin;
70 const char* model;
71 const char* tag;
73 const char* animation;
74 bool autoscale;
79
80uiModel_t* UI_GetUIModel(const char* modelName);
81void UI_DrawModelNode(uiNode_t* node, const char* source);
82void UI_RegisterModelNode(uiBehaviour_t* behaviour);
83
84void UI_Model_SetModelSource (uiNode_t* node, const char* modelName);
85void UI_Model_SetSkinSource (uiNode_t* node, const char* skinName);
86void UI_Model_SetAnimationSource (uiNode_t* node, const char* animName);
87void UI_Model_SetTagSource (uiNode_t* node, const char* tagName);
void onLoading(uiNode_t *node) override
Called before loading. Used to set default attribute values.
void deleteNode(uiNode_t *node) override
void initNodeDynamic(uiNode_t *node) override
void onMouseDown(uiNode_t *node, int x, int y, int button) override
void onLoaded(uiNode_t *node) override
void draw(uiNode_t *node) override
void clone(uiNode_t const *source, uiNode_t *clone) override
Call to update a cloned node.
void onCapturedMouseMove(uiNode_t *node, int x, int y) override
void onMouseUp(uiNode_t *node, int x, int y, int button) override
void doLayout(uiNode_t *node) override
Call to update the node layout. This common code revalidates the node tree.
voidpf uLong int origin
Definition: ioapi.h:45
extradata for the model node
Definition: ui_node_model.h:63
const char * animation
Definition: ui_node_model.h:73
const char * model
Definition: ui_node_model.h:70
const char * tag
Definition: ui_node_model.h:71
const char * skin
Definition: ui_node_model.h:69
animState_t * animationState
Definition: ui_node_model.h:72
node behaviour, how a node work
Definition: ui_behaviour.h:39
Model that have more than one part (top and down part of an aircraft)
Definition: ui_node_model.h:47
char * parent
Definition: ui_node_model.h:50
struct uiModel_s * next
Definition: ui_node_model.h:57
char * anim
Definition: ui_node_model.h:49
char * tag
Definition: ui_node_model.h:51
vec3_t angles
Definition: ui_node_model.h:55
animState_t animState
Definition: ui_node_model.h:54
char * model
Definition: ui_node_model.h:53
vec4_t color
Definition: ui_node_model.h:56
char * id
Definition: ui_node_model.h:48
Atomic structure used to define most of the UI.
Definition: ui_nodes.h:80
vec_t vec3_t[3]
Definition: ufotypes.h:39
vec_t vec4_t[4]
Definition: ufotypes.h:40
static const vec3_t scale
void UI_Model_SetTagSource(uiNode_t *node, const char *tagName)
void UI_Model_SetAnimationSource(uiNode_t *node, const char *animName)
uiModel_t * UI_GetUIModel(const char *modelName)
Returns pointer to UI model.
void UI_DrawModelNode(uiNode_t *node, const char *source)
void UI_RegisterModelNode(uiBehaviour_t *behaviour)
void UI_Model_SetModelSource(uiNode_t *node, const char *modelName)
void UI_Model_SetSkinSource(uiNode_t *node, const char *skinName)