]> git.lizzy.rs Git - minetest.git/blob - src/client/clientevent.h
Implement shadow offsets for the new SM distortion function (#12191)
[minetest.git] / src / client / clientevent.h
1 /*
2 Minetest
3 Copyright (C) 2017 nerzhul, Loic Blot <loic.blot@unix-experience.fr>
4
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU Lesser General Public License as published by
7 the Free Software Foundation; either version 2.1 of the License, or
8 (at your option) any later version.
9
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 GNU Lesser General Public License for more details.
14
15 You should have received a copy of the GNU Lesser General Public License along
16 with this program; if not, write to the Free Software Foundation, Inc.,
17 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18 */
19
20 #pragma once
21
22 #include <string>
23 #include "irrlichttypes_bloated.h"
24
25 struct ParticleParameters;
26 struct ParticleSpawnerParameters;
27 struct SkyboxParams;
28 struct SunParams;
29 struct MoonParams;
30 struct StarParams;
31
32 enum ClientEventType : u8
33 {
34         CE_NONE,
35         CE_PLAYER_DAMAGE,
36         CE_PLAYER_FORCE_MOVE,
37         CE_DEATHSCREEN,
38         CE_SHOW_FORMSPEC,
39         CE_SHOW_LOCAL_FORMSPEC,
40         CE_SPAWN_PARTICLE,
41         CE_ADD_PARTICLESPAWNER,
42         CE_DELETE_PARTICLESPAWNER,
43         CE_HUDADD,
44         CE_HUDRM,
45         CE_HUDCHANGE,
46         CE_SET_SKY,
47         CE_SET_SUN,
48         CE_SET_MOON,
49         CE_SET_STARS,
50         CE_OVERRIDE_DAY_NIGHT_RATIO,
51         CE_CLOUD_PARAMS,
52         CLIENTEVENT_MAX,
53 };
54
55 struct ClientEventHudAdd
56 {
57         u32 server_id;
58         u8 type;
59         v2f pos, scale;
60         std::string name;
61         std::string text, text2;
62         u32 number, item, dir, style;
63         v2f align, offset;
64         v3f world_pos;
65         v2s32 size;
66         s16 z_index;
67 };
68
69 struct ClientEventHudChange
70 {
71         u32 id;
72         HudElementStat stat;
73         v2f v2fdata;
74         std::string sdata;
75         u32 data;
76         v3f v3fdata;
77         v2s32 v2s32data;
78 };
79
80 struct ClientEvent
81 {
82         ClientEventType type;
83         union
84         {
85                 // struct{
86                 //} none;
87                 struct
88                 {
89                         u16 amount;
90                 } player_damage;
91                 struct
92                 {
93                         f32 pitch;
94                         f32 yaw;
95                 } player_force_move;
96                 struct
97                 {
98                         bool set_camera_point_target;
99                         f32 camera_point_target_x;
100                         f32 camera_point_target_y;
101                         f32 camera_point_target_z;
102                 } deathscreen;
103                 struct
104                 {
105                         std::string *formspec;
106                         std::string *formname;
107                 } show_formspec;
108                 // struct{
109                 //} textures_updated;
110                 ParticleParameters *spawn_particle;
111                 struct
112                 {
113                         ParticleSpawnerParameters *p;
114                         u16 attached_id;
115                         u64 id;
116                 } add_particlespawner;
117                 struct
118                 {
119                         u32 id;
120                 } delete_particlespawner;
121                 ClientEventHudAdd *hudadd;
122                 struct
123                 {
124                         u32 id;
125                 } hudrm;
126                 ClientEventHudChange *hudchange;
127                 SkyboxParams *set_sky;
128                 struct
129                 {
130                         bool do_override;
131                         float ratio_f;
132                 } override_day_night_ratio;
133                 struct
134                 {
135                         f32 density;
136                         u32 color_bright;
137                         u32 color_ambient;
138                         f32 height;
139                         f32 thickness;
140                         f32 speed_x;
141                         f32 speed_y;
142                 } cloud_params;
143                 SunParams *sun_params;
144                 MoonParams *moon_params;
145                 StarParams *star_params;
146         };
147 };