sead
Loading...
Searching...
No Matches
aglParameter.hpp
Go to the documentation of this file.
1
#
pragma
once
2
3
#
include
<
basis
/
seadNew
.
h
>
4
#
include
<
gfx
/
seadColor
.
h
>
5
#
include
<
math
/
seadVector
.
h
>
6
7
namespace
agl
{
namespace
utl
{
8
9
template
<
typename
T
>
10
inline
ParameterBase
*
Parameter
<
T
>::
clone
(
sead
::
Heap
*
heap
,
IParameterObj
*
p_obj
)
const
11
{
12
return
new
(
heap
, 4)
Parameter
<
T
>(
getValue
(),
getParameterName
(),
getLabel
(),
getMeta
(),
p_obj
);
13
}
14
15
template
<
typename
T
>
template
<
typename
U
>
16
inline
void
Parameter
<
T
>::
setValue
(
const
U
&
value
)
17
{
18
mValue
=
value
;
19
}
20
21
template
<>
template
<>
22
inline
void
Parameter
<
sead
::
Vector2f
>::
setValue
(
const
sead
::
Vector2f
&
value
)
23
{
24
mValue
.
set
(
value
);
25
}
26
27
template
<>
template
<>
28
inline
void
Parameter
<
sead
::
Vector3f
>::
setValue
(
const
sead
::
Vector3f
&
value
)
29
{
30
mValue
.
set
(
value
);
31
}
32
33
template
<>
template
<>
34
inline
void
Parameter
<
sead
::
Vector4f
>::
setValue
(
const
sead
::
Vector4f
&
value
)
35
{
36
mValue
.
set
(
value
);
37
}
38
39
static_assert
(
sizeof
(
Parameter
<
bool
>) == 0x14);
40
static_assert
(
sizeof
(
Parameter
<
s32
>) == 0x14);
41
static_assert
(
sizeof
(
Parameter
<
f32
>) == 0x14);
42
static_assert
(
sizeof
(
Parameter
<
sead
::
Vector2f
>) == 0x18);
43
static_assert
(
sizeof
(
Parameter
<
sead
::
Vector3f
>) == 0x1C);
44
static_assert
(
sizeof
(
Parameter
<
sead
::
Vector4f
>) == 0x20);
45
static_assert
(
sizeof
(
Parameter
<
sead
::
Color4f
>) == 0x20);
46
static_assert
(
sizeof
(
Parameter
<
sead
::
FixedSafeString
<32> >) == 0x3C);
47
48
template
<
typename
T
>
49
void
ParameterBase
::
copyLerp_
(
const
ParameterBase
&
parameter_a
,
const
ParameterBase
&
parameter_b
,
f32
t
)
50
{
51
static_cast
<
T
*>(
ptr
())->
setLerp
(*
static_cast
<
const
T
*>(
parameter_a
.
ptr
()), *
static_cast
<
const
T
*>(
parameter_b
.
ptr
()),
t
);
52
}
53
54
template
<>
55
inline
void
ParameterBase
::
copyLerp_
<
f32
>(
const
ParameterBase
&
parameter_a
,
const
ParameterBase
&
parameter_b
,
f32
t
)
56
{
57
*
static_cast
<
f32
*>(
ptr
()) =
sead
::
Mathf
::
lerp
(*
static_cast
<
const
f32
*>(
parameter_a
.
ptr
()), *
static_cast
<
const
f32
*>(
parameter_b
.
ptr
()),
t
);
58
}
59
60
template
<>
61
inline
ParameterBase
::
ParameterType
62
Parameter
<
bool
>::
getParameterType
()
const
63
{
64
return
cType_bool
;
65
}
66
67
template
<>
68
inline
ParameterBase
::
ParameterType
69
Parameter
<
s32
>::
getParameterType
()
const
70
{
71
return
cType_int
;
72
}
73
74
template
<>
75
inline
ParameterBase
::
ParameterType
76
Parameter
<
f32
>::
getParameterType
()
const
77
{
78
return
cType_f32
;
79
}
80
81
template
<>
82
inline
ParameterBase
::
ParameterType
83
Parameter
<
sead
::
Vector2f
>::
getParameterType
()
const
84
{
85
return
cType_vec2
;
86
}
87
88
template
<>
89
inline
ParameterBase
::
ParameterType
90
Parameter
<
sead
::
Vector3f
>::
getParameterType
()
const
91
{
92
return
cType_vec3
;
93
}
94
95
template
<>
96
inline
ParameterBase
::
ParameterType
97
Parameter
<
sead
::
Vector4f
>::
getParameterType
()
const
98
{
99
return
cType_vec4
;
100
}
101
102
template
<>
103
inline
ParameterBase
::
ParameterType
104
Parameter
<
sead
::
Color4f
>::
getParameterType
()
const
105
{
106
return
cType_color
;
107
}
108
109
template
<>
110
inline
ParameterBase
::
ParameterType
111
Parameter
<
sead
::
FixedSafeString
<32> >::
getParameterType
()
const
112
{
113
return
cType_string32
;
114
}
115
116
template
<>
117
inline
const
void
*
118
Parameter
<
sead
::
FixedSafeString
<32> >::
ptr
()
const
119
{
120
return
mValue
.
cstr
();
121
}
122
123
template
<>
124
inline
void
*
125
Parameter
<
sead
::
FixedSafeString
<32> >::
ptr
()
126
{
127
return
mValue
.
getBuffer
();
128
}
129
130
template
<>
131
inline
size_t
132
Parameter
<
sead
::
FixedSafeString
<32> >::
size
()
const
133
{
134
return
32;
135
}
136
137
} }
agl::utl
Definition
aglImageFilter2D.h:11
agl
Definition
aglDisplayList.cpp:5
packages
agl
include
utility
aglParameter.hpp
Generated by
1.14.0