wavelength 1.0.0
Loading...
Searching...
No Matches
setmataction.h
Go to the documentation of this file.
1#pragma once
2
4#include "math/color.h"
5#include "rnd/rndmat.h"
6#include "rnd/rndtex.h"
7#include "script/dataarray.h"
8
18public:
25 ~SetMatAction() override = default;
26
36 explicit SetMatAction(DataArray *pAction);
37
44 void Exec() override;
45
46private:
47 // The values the node set.
48 enum Flag {
49 kFlagBaseColor = 0x1,
50 kFlagLightColor = 0x2,
51 kFlagEdgeColor = 0x4,
52 kFlagAlpha = 0x20,
53 kFlagBlend1 = 0x40,
54 kFlagBlend2 = 0x80,
55 kFlagBlend3 = 0x100,
56 kFlagTex1 = 0x200,
57 kFlagTex2 = 0x400,
58 kFlagTex3 = 0x800,
59 };
60
61 // The number of stages the action can change.
62 static constexpr int kNumStages = 3;
63
64 // Warn unless the material has a stage, counted from 1.
65 void CheckStage(DataArray *pAction, int nStage);
66
67 int mFlags;
68 RndMat *mMat;
69 alignas(16) Color mBaseColor;
70 alignas(16) Color mLightColor;
71 alignas(16) Color mEdgeColor;
72 float mAlpha;
73 int mBlend[kNumStages];
74 RndTex *mTex[kNumStages];
75};
Reference-counted array of script data nodes.
Definition dataarray.h:20
Surface description: blending, lighting colours, culling, and a list of texture stages.
Definition rndmat.h:20
Texture, a bitmap loaded from a file or rendered to.
Definition rndtex.h:17
~SetMatAction() override=default
Destroy the object.
void Exec() override
Write the values the node set into the material.
SetMatAction(DataArray *pAction)
Read the action.
Something a trigger does when its conditions hold.
Definition triggeraction.h:15
Linear colour with four float components.
Definition color.h:12