]> git.lizzy.rs Git - dragonblocks_alpha.git/blob - src/server/voxelctx.h
1da3d1c97eb42d4b1e98b69546296b4d2724f089
[dragonblocks_alpha.git] / src / server / voxelctx.h
1 #ifndef _VOXELCTX_H_
2 #define _VOXELCTX_H_
3
4 #define VOXELCTXSTATE(ctx) (*((VoxelctxState *) (ctx)->statestack.first->key))
5
6 #include <linmath.h/linmath.h>
7 #include <dragontype/list.h>
8 #include <dragontype/number.h>
9 #include "server/server_map.h"
10
11
12
13 #include <dragontype/array.h>
14
15
16 typedef struct
17 {
18         vec4 pos;
19         vec3 scale;
20         mat4x4 mat;
21         f32 h, s, l;
22         s32 life;
23         Array strs;
24 } VoxelctxState;
25
26 typedef struct
27 {
28         v3s32 pos;
29         List *changed_blocks;
30         MapgenStage mgs;
31         List statestack;
32         s32 random;
33 } Voxelctx;
34
35 Voxelctx *voxelctx_create(List *changed_blocks, MapgenStage mgs, v3s32 pos);
36 void voxelctx_delete(Voxelctx *ctx);
37 void voxelctx_hue(Voxelctx *ctx, f32 value);
38 void voxelctx_sat(Voxelctx *ctx, f32 value);
39 void voxelctx_light(Voxelctx *ctx, f32 value);
40 void voxelctx_life(Voxelctx *ctx, s32 value);
41 void voxelctx_x(Voxelctx *ctx, f32 value);
42 void voxelctx_y(Voxelctx *ctx, f32 value);
43 void voxelctx_z(Voxelctx *ctx, f32 value);
44 void voxelctx_rx(Voxelctx *ctx, f32 value);
45 void voxelctx_ry(Voxelctx *ctx, f32 value);
46 void voxelctx_rz(Voxelctx *ctx, f32 value);
47 void voxelctx_sx(Voxelctx *ctx, f32 value);
48 void voxelctx_sy(Voxelctx *ctx, f32 value);
49 void voxelctx_sz(Voxelctx *ctx, f32 value);
50 void voxelctx_s(Voxelctx *ctx, f32 value);
51 void voxelctx_pop(Voxelctx *ctx);
52 void voxelctx_push(Voxelctx *ctx);
53 bool voxelctx_is_alive(Voxelctx *ctx);
54 void voxelctx_cube(Voxelctx *ctx, Node node, bool use_hsl);
55 void voxelctx_cylinder(Voxelctx *ctx, Node node, bool use_hsl);
56 f32 voxelctx_random(Voxelctx *ctx, f32 base, f32 vary);
57
58 #endif