1 // NeL - MMORPG Framework <http://dev.ryzom.com/projects/nel/>
2 // Copyright (C) 2010 Winch Gate Property Limited
4 // This program is free software: you can redistribute it and/or modify
5 // it under the terms of the GNU Affero General Public License as
6 // published by the Free Software Foundation, either version 3 of the
7 // License, or (at your option) any later version.
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU Affero General Public License for more details.
14 // You should have received a copy of the GNU Affero General Public License
15 // along with this program. If not, see <http://www.gnu.org/licenses/>.
25 #include "nel/misc/rgba.h"
26 #include "nel/misc/vector.h"
28 #include "nel/3d/ps_attrib_maker.h"
29 #include "nel/3d/texture.h"
31 #include "particle_workspace.h"
34 // wrapper to read/write a value of type T
35 template <class T
> class IPSWrapper
38 CParticleWorkspace::CNode
*OwnerNode
; // Owner node of the property. When the property is modified, then the node will be marked as 'modified'
40 IPSWrapper() : OwnerNode(NULL
)
43 // for derivers : get a value
44 virtual T
get(void) const = 0;
45 void setAndUpdateModifiedFlag(const T
&value
)
49 OwnerNode
->setModified(true);
54 // for derivers : set a value
55 virtual void set(const T
&) = 0;
59 // wrapper to read/write a scheme of type T
60 template <class T
> class IPSSchemeWrapper
63 CParticleWorkspace::CNode
*OwnerNode
; // Owner node of the property. When the property is modified, then the node will be marked as 'modified'
65 IPSSchemeWrapper() : OwnerNode(NULL
) {}
66 typedef NL3D::CPSAttribMaker
<T
> scheme_type
;
67 virtual scheme_type
*getScheme(void) const = 0;
68 void setSchemeAndUpdateModifiedFlag(scheme_type
*s
)
72 OwnerNode
->setModified(true);
77 virtual void setScheme(scheme_type
*s
) = 0;
83 typedef IPSWrapper
<NLMISC::CRGBA
> IPSWrapperRGBA
;
84 typedef IPSSchemeWrapper
<NLMISC::CRGBA
> IPSSchemeWrapperRGBA
;
87 typedef IPSWrapper
<float> IPSWrapperFloat
;
88 typedef IPSSchemeWrapper
<float> IPSSchemeWrapperFloat
;
91 typedef IPSWrapper
<uint32
> IPSWrapperUInt
;
92 typedef IPSSchemeWrapper
<uint32
> IPSSchemeWrapperUInt
;
96 class IPSWrapperTexture
99 CParticleWorkspace::CNode
*OwnerNode
;
102 IPSWrapperTexture() : OwnerNode(NULL
) {}
103 virtual NL3D::ITexture
*get(void) = 0;
104 virtual void setAndUpdateModifiedFlag(NL3D::ITexture
*tex
)
106 if (OwnerNode
) OwnerNode
->setModified(true);
110 virtual void set(NL3D::ITexture
*) = 0;