Repository navigation
Expand file tree
/
Copy pathSDL_FColor.cls
More file actions
135 lines (98 loc) · 2.7 KB
/
Copy pathSDL_FColor.cls
File metadata and controls
135 lines (98 loc) · 2.7 KB
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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
"Filed out from Dolphin Smalltalk"!
ExternalStructure subclass: #SDL_FColor
instanceVariableNames: ''
classVariableNames: '_OffsetOf_a _OffsetOf_b _OffsetOf_g _OffsetOf_r'
poolDictionaries: ''
classInstanceVariableNames: ''!
SDL_FColor guid: (GUID fromString: '{9fedb342-c5e4-4a8e-805e-331d11831c08}')!
SDL_FColor addClassConstant: '_OffsetOf_a' value: 16rC!
SDL_FColor addClassConstant: '_OffsetOf_b' value: 16r8!
SDL_FColor addClassConstant: '_OffsetOf_g' value: 16r4!
SDL_FColor addClassConstant: '_OffsetOf_r' value: 16r0!
SDL_FColor comment: ''!
!SDL_FColor categoriesForClass!External-Data-Structured! !
!SDL_FColor methodsFor!
a
"Answer the <Float> value of the receiver's 'a' field."
^bytes floatAtOffset: _OffsetOf_a!
a: aFloat
"Set the receiver's 'a' field to the value of the argument, aFloat"
bytes floatAtOffset: _OffsetOf_a put: aFloat!
alpha
^self a!
asSDLColor
^SDL_Color new
r: (self r * 255) truncated;
g: (self g * 255) truncated;
b: (self b * 255) truncated;
a: (self a * 255) truncated!
asSDLFColor
^self!
b
"Answer the <Float> value of the receiver's 'b' field."
^bytes floatAtOffset: _OffsetOf_b!
b: aFloat
"Set the receiver's 'b' field to the value of the argument, aFloat"
bytes floatAtOffset: _OffsetOf_b put: aFloat!
blue
^self b!
g
"Answer the <Float> value of the receiver's 'g' field."
^bytes floatAtOffset: _OffsetOf_g!
g: aFloat
"Set the receiver's 'g' field to the value of the argument, aFloat"
bytes floatAtOffset: _OffsetOf_g put: aFloat!
green
^self g!
r
"Answer the <Float> value of the receiver's 'r' field."
^bytes floatAtOffset: _OffsetOf_r!
r: aFloat
"Set the receiver's 'r' field to the value of the argument, aFloat"
bytes floatAtOffset: _OffsetOf_r put: aFloat!
red
^self r! !
!SDL_FColor categoriesForMethods!
a!**compiled accessors**!public! !
a:!**compiled accessors**!public! !
alpha!public! !
asSDLColor!public! !
asSDLFColor!public! !
b!**compiled accessors**!public! !
b:!**compiled accessors**!public! !
blue!public! !
g!**compiled accessors**!public! !
g:!**compiled accessors**!public! !
green!public! !
r!**compiled accessors**!public! !
r:!**compiled accessors**!public! !
red!public! !
!
!SDL_FColor class methodsFor!
defineFields
"self compileDefinition"
self
defineField: #r type: FLOATField new;
defineField: #g type: FLOATField new;
defineField: #b type: FLOATField new;
defineField: #a type: FLOATField new!
getFieldNames
^#(#r #g #b #a)!
r: r g: g b: b a: a
^self new
r: r;
g: g;
b: b;
a: a!
white
^self new
r: 1.0;
g: 1.0;
b: 1.0;
a: 1.0! !
!SDL_FColor class categoriesForMethods!
defineFields!public! !
getFieldNames!**compiled accessors**!constants!private! !
r:g:b:a:!public! !
white!public! !
!