]> git.sesse.net Git - movit/blob - effect.cpp
Build with debug info.
[movit] / effect.cpp
1 #include <string.h>
2 #include <assert.h>
3 #include "effect.h"
4
5 bool Effect::set_int(const std::string &key, int value)
6 {
7         if (params_int.count(key) == 0) {
8                 return false;
9         }
10         *params_int[key] = value;
11         return true;
12 }
13
14 bool Effect::set_float(const std::string &key, float value)
15 {
16         if (params_float.count(key) == 0) {
17                 return false;
18         }
19         *params_float[key] = value;
20         return true;
21 }
22
23 bool Effect::set_vec3(const std::string &key, const float *values)
24 {
25         if (params_vec3.count(key) == 0) {
26                 return false;
27         }
28         memcpy(params_vec3[key], values, sizeof(float) * 3);
29         return true;
30 }
31
32 void Effect::register_int(const std::string &key, int *value)
33 {
34         assert(params_int.count(key) == 0);
35         params_int[key] = value;
36 }
37
38 void Effect::register_float(const std::string &key, float *value)
39 {
40         assert(params_float.count(key) == 0);
41         params_float[key] = value;
42 }
43
44 void Effect::register_vec3(const std::string &key, float *values)
45 {
46         assert(params_vec3.count(key) == 0);
47         params_vec3[key] = values;
48 }
49