SEGS  0.6.1-develop [3e741b81]
Super Entity Game Server
trick_definitions.h
Go to the documentation of this file.
1 /*
2  * SEGS - Super Entity Game Server
3  * http://www.segs.io/
4  * Copyright (c) 2006 - 2019 SEGS Team (see AUTHORS.md)
5  * This software is licensed under the terms of the 3-clause BSD License. See LICENSE.md for details.
6  */
7 
8 #pragma once
9 
10 #include "Colors.h"
12 
13 #include <glm/vec3.hpp>
14 #include <glm/vec2.hpp>
15 #include <QtCore/QString>
16 #include <QtCore/QHash>
17 #include <vector>
18 enum eBlendMode : uint8_t;
19 
20 enum TrickFlags : uint32_t
21 {
22  Additive = 0x1,
23  ScrollST0 = 0x2,
24  FrontFace = 0x4,
25  CameraFace = 0x8,
26  DistAlpha = 0x10,
27  ColorOnly = 0x20,
28  DoubleSided = 0x40,
29  NoZTest = 0x80,
30  ReflectTex1 = 0x100,
31  ScrollST1 = 0x200,
32  NightLight = 0x400,
33  NoZWrite = 0x800,
34  Wireframe = 0x1000,
35  NoDraw = 0x2000,
36  STAnimate = 0x4000,
37  ParticleSys = 0x8000,
38  NoColl = 0x10000,
39  SetColor = 0x20000,
40  VertexAlpha = 0x40000,
41  NoFog = 0x80000,
42  FogHasStartAndEnd= 0x100000,
43  EditorVisible = 0x200000,
44  CastShadow = 0x400000,
45  LightFace = 0x800000,
46  ReflectTex0 = 0x1000000,
47  AlphaRef = 0x2000000,
48  SimpleAlphaSort = 0x4000000,
49  TexBias = 0x8000000,
50  NightGlow = 0x10000000,
51  SelectOnly = 0x20000000,
52  STSScale = 0x40000000,
53  NotSelectable = 0x80000000,
54 };
55 
57 {
58  QByteArray src_file;
59  QByteArray name;
60  QByteArray Blend;
61  QByteArray BumpMap;
62  glm::vec2 Fade{0, 0};
63  glm::vec2 ScaleST0{0, 0};
64  glm::vec2 ScaleST1{0, 0};
65  uint32_t Flags;
66  uint32_t BlendType;
68  QByteArray Surface; // Name of this surface WOOD METAL etc.
69  float Gloss;
70 };
71 
72 struct ColorList
73 {
74  RGBA field_0[16];
75  int count; // count of color 'key frames'
76  float scale;
77 };
78 
80 {
81  glm::vec2 ScrollST0;
82  glm::vec2 ScrollST1;
83  glm::vec2 tex_scale;
86  uint32_t _TrickFlags=0;
87  float SortBias=0;
88  struct GeometryModifiers *info=nullptr;
89  bool isFlag(TrickFlags v) const {
90  return (_TrickFlags & uint32_t(v))!=0;
91  }
92 };
93 
94 enum GroupFlags : uint32_t
95 {
96  VisOutside = 0x1,
97  VisBlocker = 0x2,
99  VisTray = 0x8,
100  VisShell = 0x10,
101  VisWindow = 0x20,
102  VisDoorFrame = 0x40,
103  RegionMarker = 0x80,
104  VolumeTrigger = 0x100,
105  WaterVolume = 0x200,
106  LavaVolume = 0x400,
107  DoorVolume = 0x800,
108  ParentFade = 0x1000,
109  KeyLight = 0x2000,
111  RedWaterVolume = 0x8000, // only in I2
112  MaterialVolume =0x10000, // only in I2
113 };
114 
116 {
117  QByteArray src_name;
118  QByteArray name;
120  int GfxFlags;
121  uint32_t ObjFlags;
122  uint32_t GroupFlags;
123  eBlendMode blend_mode;
124  float LodNear;
125  float LodFar;
126  float LodNearFade;
127  float LodFarFade;
128  std::vector<TextureAnim_Data> StAnim;
129  glm::vec2 FogDist;
130  float ShadowDist;
131  float AlphaRef;
132  float ObjTexBias;
133  glm::vec2 NightGlow;
134  float Sway;
135  float Sway_Rotate;
136  ColorList clists[2];
137  float LodScale;
138 };
139 
140 enum TexOpt : uint32_t
141 {
142  FADE = 0x0001,
143  DUAL = 0x0010,
144  REPLACEABLE = 0x0800,
145  BUMPMAP = 0x1000,
146 };
147 
149 {
150  std::vector<TextureModifiers> texture_mods;
151  std::vector<GeometryModifiers> geometry_mods;
152  // for every directory in the texture's path we can have a modifier.
153  QHash<QString,TextureModifiers *> m_texture_path_to_mod;
154  QHash<QString,GeometryModifiers *> g_tricks_string_hash_tab;
155 };
156 GeometryModifiers *findGeomModifier(SceneModifiers &tricks,const QString &modelname, const QString &trick_path);
Definition: trick_definitions.h:28
float LodFar
Definition: trick_definitions.h:125
GeometryModifiers * findGeomModifier(SceneModifiers &tricks, const QString &modelname, const QString &trick_path)
Definition: trick_definitions.cpp:5
Definition: Colors.h:62
Definition: trick_definitions.h:27
Definition: trick_definitions.h:38
QByteArray src_name
Definition: trick_definitions.h:117
Definition: trick_definitions.h:108
float Gloss
Definition: trick_definitions.h:69
Definition: trick_definitions.h:111
eBlendMode blend_mode
Definition: trick_definitions.h:123
Definition: trick_definitions.h:45
Definition: trick_definitions.h:51
Definition: trick_definitions.h:40
glm::vec2 ScrollST0
Definition: trick_definitions.h:81
Definition: trick_definitions.h:22
Definition: trick_definitions.h:101
glm::vec2 FogDist
Definition: trick_definitions.h:129
Definition: trick_definitions.h:142
Definition: trick_definitions.h:30
float Sway_Rotate
Definition: trick_definitions.h:135
float ShadowDist
Definition: trick_definitions.h:130
Definition: trick_definitions.h:26
float ObjTexBias
Definition: trick_definitions.h:132
bool isFlag(TrickFlags v) const
Definition: trick_definitions.h:89
Definition: trick_definitions.h:42
Definition: trick_definitions.h:48
Definition: trick_definitions.h:35
Definition: trick_definitions.h:39
std::vector< GeometryModifiers > geometry_mods
Definition: trick_definitions.h:151
Definition: trick_definitions.h:37
std::vector< TextureAnim_Data > StAnim
Definition: trick_definitions.h:128
Definition: trick_definitions.h:43
float LodNear
Definition: trick_definitions.h:124
QByteArray BumpMap
Definition: trick_definitions.h:61
Definition: trick_definitions.h:103
QByteArray Surface
Definition: trick_definitions.h:68
Definition: trick_definitions.h:33
Definition: trick_definitions.h:104
float LodFarFade
Definition: trick_definitions.h:127
uint32_t ObjFlags
Definition: trick_definitions.h:121
Definition: trick_definitions.h:115
Definition: trick_definitions.h:106
Definition: trick_definitions.h:112
QByteArray name
Definition: trick_definitions.h:59
Definition: trick_definitions.h:144
float AlphaRef
Definition: trick_definitions.h:131
RGBA TintColor0
Definition: trick_definitions.h:84
glm::vec2 ScrollST1
Definition: trick_definitions.h:82
Definition: trick_definitions.h:24
QHash< QString, GeometryModifiers * > g_tricks_string_hash_tab
Definition: trick_definitions.h:154
Definition: trick_definitions.h:53
std::vector< TextureModifiers > texture_mods
Definition: trick_definitions.h:150
Definition: trick_definitions.h:143
RGBA TintColor1
Definition: trick_definitions.h:85
Definition: trick_definitions.h:46
Definition: trick_definitions.h:25
uint32_t GroupFlags
Definition: trick_definitions.h:122
float Sway
Definition: trick_definitions.h:134
Definition: trick_definitions.h:105
Definition: trick_definitions.h:79
QByteArray Blend
Definition: trick_definitions.h:60
Definition: trick_definitions.h:34
Definition: trick_definitions.h:31
Definition: trick_definitions.h:96
int GfxFlags
Definition: trick_definitions.h:120
Definition: trick_definitions.h:97
TexOpt
Definition: trick_definitions.h:140
glm::vec2 ScaleST0
Definition: trick_definitions.h:63
Definition: trick_definitions.h:47
Definition: trick_definitions.h:100
glm::vec2 ScaleST1
Definition: trick_definitions.h:64
Definition: trick_definitions.h:107
Definition: trick_definitions.h:50
Definition: trick_definitions.h:41
float scale
Definition: trick_definitions.h:76
Definition: trick_definitions.h:109
Definition: trick_definitions.h:102
int surfaceBitIdx
Definition: trick_definitions.h:67
glm::vec2 Fade
Definition: trick_definitions.h:62
glm::vec2 tex_scale
Definition: trick_definitions.h:83
Definition: trick_definitions.h:23
Definition: trick_definitions.h:99
Definition: trick_definitions.h:98
Definition: trick_definitions.h:49
float LodScale
Definition: trick_definitions.h:137
Definition: trick_definitions.h:145
Definition: trick_definitions.h:72
QByteArray name
Definition: trick_definitions.h:118
ModelModifiers node
Definition: trick_definitions.h:119
uint32_t BlendType
Definition: trick_definitions.h:66
QHash< QString, TextureModifiers * > m_texture_path_to_mod
Definition: trick_definitions.h:153
Definition: trick_definitions.h:44
int count
Definition: trick_definitions.h:75
glm::vec2 NightGlow
Definition: trick_definitions.h:133
float LodNearFade
Definition: trick_definitions.h:126
GroupFlags
Definition: trick_definitions.h:94
Definition: trick_definitions.h:29
Definition: trick_definitions.h:56
Definition: trick_definitions.h:148
Definition: trick_definitions.h:52
uint32_t Flags
Definition: trick_definitions.h:65
QByteArray src_file
Definition: trick_definitions.h:58
Definition: trick_definitions.h:36
Definition: trick_definitions.h:32
Definition: trick_definitions.h:110
TrickFlags
Definition: trick_definitions.h:20