1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
|
#include "SCA_IActuator.h"
#include "SCA_2DFilterActuator.h"
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <iostream>
SCA_2DFilterActuator::SCA_2DFilterActuator(
SCA_IObject *gameobj,
RAS_2DFilterManager::RAS_2DFILTER_MODE type,
short flag,
float float_arg,
int int_arg,
RAS_IRasterizer* rasterizer,
RAS_IRenderTools* rendertools,
PyTypeObject* T)
: SCA_IActuator(gameobj, T),
m_type(type),
m_flag(flag),
m_int_arg(int_arg),
m_float_arg(float_arg),
m_rasterizer(rasterizer),
m_rendertools(rendertools)
{
}
SCA_2DFilterActuator::~SCA_2DFilterActuator()
{
}
CValue* SCA_2DFilterActuator::GetReplica()
{
SCA_2DFilterActuator* replica = new SCA_2DFilterActuator(*this);
replica->ProcessReplica();
CValue::AddDataToReplica(replica);
return replica;
}
bool SCA_2DFilterActuator::Update()
{
bool result = false;
bool bNegativeEvent = IsNegativeEvent();
RemoveAllEvents();
if (bNegativeEvent)
return false; // do nothing on negative events
if( m_type == RAS_2DFilterManager::RAS_2DFILTER_MOTIONBLUR )
{
if(!m_flag)
{
m_rasterizer->EnableMotionBlur(m_float_arg);
}
else
{
m_rasterizer->DisableMotionBlur();
}
}
else if(m_type < RAS_2DFilterManager::RAS_2DFILTER_NUMBER_OF_FILTERS)
{
m_rendertools->Update2DFilter(m_type, m_int_arg);
}
return true;
}
PyTypeObject SCA_2DFilterActuator::Type = {
PyObject_HEAD_INIT(&PyType_Type)
0,
"SCA_2DFilterActuator",
sizeof(SCA_2DFilterActuator),
0,
PyDestructor,
0,
__getattr,
__setattr,
0,
__repr,
0,
0,
0,
0,
0
};
PyParentObject SCA_2DFilterActuator::Parents[] = {
&SCA_2DFilterActuator::Type,
&SCA_IActuator::Type,
&SCA_ILogicBrick::Type,
&CValue::Type,
NULL
};
PyMethodDef SCA_2DFilterActuator::Methods[] = {
/* add python functions to deal with m_msg... */
{NULL,NULL}
};
PyObject* SCA_2DFilterActuator::_getattr(const STR_String& attr) {
_getattr_up(SCA_IActuator);
}
|