texStateDone.tcl
6.06 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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
button .doneAllB -text "done" -command CsetTexStateAll
# This loop needed solely for create_callback.tcl to
# be able to pick up these variables.
for {set tile 0} {$tile < $numTiles} {incr tile 1} {
set setTileSizeSl$tile 0
set setTileSizeTl$tile 0
set setTileSizeSh$tile 0
set setTileSizeTh$tile 0
}
proc CshiftTileSize {} {
global fptr record numTiles
for {set tile 0} {$tile < $numTiles} {incr tile 1} {
global setTileFormat$tile setTileTexelSize$tile
global setTileLine$tile setTileWrapMirs$tile
global setTileClamps$tile setTileMaskS$tile
global setTileShiftS$tile setTileWrapMirt$tile
global setTileClampt$tile setTileMaskT$tile
global setTileShiftT$tile setTilePalette$tile
global setTileSizeSlFloat$tile setTileSizeTlFloat$tile
global setTileSizeSl$tile setTileSizeTl$tile
global setTileSizeShFloat$tile setTileSizeThFloat$tile
global setTileSizeSh$tile setTileSizeTh$tile
global setTileAddrs$tile
# multiply x 4 to account for 2 frac bits
set first setTileSizeSlFloat
set next $tile
upvar #0 $first$next x
set setTileSizeSl$tile [expr int($x * 4)]
set first setTileSizeShFloat
set next $tile
upvar #0 $first$next x
set setTileSizeSh$tile [expr int($x * 4)]
set first setTileSizeTlFloat
set next $tile
upvar #0 $first$next x
set setTileSizeTl$tile [expr int($x * 4)]
set first setTileSizeThFloat
set next $tile
upvar #0 $first$next x
set setTileSizeTh$tile [expr int($x * 4)]
}
}
proc CsetTexStateAll {} {
global fptr record numTiles
for {set tile 0} {$tile < $numTiles} {incr tile 1} {
global setTileFormat$tile setTileTexelSize$tile
global setTileLine$tile setTileWrapMirs$tile
global setTileClamps$tile setTileMaskS$tile
global setTileShiftS$tile setTileWrapMirt$tile
global setTileClampt$tile setTileMaskT$tile
global setTileShiftT$tile setTilePalette$tile
global setTileSizeSlFloat$tile setTileSizeTlFloat$tile
global setTileSizeSl$tile setTileSizeTl$tile
global setTileSizeShFloat$tile setTileSizeThFloat$tile
global setTileSizeSh$tile setTileSizeTh$tile
global setTileAddrs$tile
}
CshiftTileSize
global spTexEnable spTexScaleS spTexScaleT
global spTexPrimTile spTexMaxLevel
global setTimgFmt setTimgSize setTimgwidth setTimgDramAddr
global setTotherPersp setTotherDetail setTotherLOD setTotherTlut
global setTotherTexFilt setTotherConvert
#Note: Remember to add proc names in the recording process if such procs
#are added to the appropriate buttons e.g. clamp has no procs attached
if {$record == 1} {
for {set tile 0} {$tile < $numTiles} {incr tile 1} {
set first setTileFormat
set next $tile
upvar #0 $first$next x
puts $fptr "set setTileFormat$tile $x"
puts $fptr "CsetTileFormat"
set first setTileTexelSize
set next $tile
upvar #0 $first$next x
puts $fptr "set setTileTexelSize$tile $x"
puts $fptr "CsetTileTexelSize"
set first setTileLine
set next $tile
upvar #0 $first$next x
puts $fptr "set setTileLine$tile $x"
set first setTileAddrs
set next $tile
upvar #0 $first$next x
puts $fptr "set setTileAddrs$tile $x"
set first setTileWrapMirs
set next $tile
upvar #0 $first$next x
puts $fptr "set setTileWrapMirs$tile $x"
puts $fptr "CsetTileWrapMirs"
set first setTileClamps
set next $tile
upvar #0 $first$next x
puts $fptr "set setTileClamps$tile $x"
set first setTileMaskS
set next $tile
upvar #0 $first$next x
puts $fptr "set setTileMaskS$tile $x"
set first setTileShiftS
set next $tile
upvar #0 $first$next x
puts $fptr "set setTileShiftS$tile $x"
set first setTileWrapMirt
set next $tile
upvar #0 $first$next x
puts $fptr "set setTileWrapMirt$tile $x"
puts $fptr "CsetTileWrapMirt"
set first setTileClampt
set next $tile
upvar #0 $first$next x
puts $fptr "set setTileClampt$tile $x"
set first setTileMaskT
set next $tile
upvar #0 $first$next x
puts $fptr "set setTileMaskT$tile $x"
set first setTileShiftT
set next $tile
upvar #0 $first$next x
puts $fptr "set setTileShiftT$tile $x"
set first setTilePalette
set next $tile
upvar #0 $first$next x
puts $fptr "set setTilePalette$tile $x"
set first setTileSizeSlFloat
set next $tile
upvar #0 $first$next x
puts $fptr "set setTileSizeSlFloat$tile $x"
puts $fptr "CshiftTileSize"
set first setTileSizeShFloat
set next $tile
upvar #0 $first$next x
puts $fptr "set setTileSizeShFloat$tile $x"
puts $fptr "CshiftTileSize"
set first setTileSizeTlFloat
set next $tile
upvar #0 $first$next x
puts $fptr "set setTileSizeTlFloat$tile $x"
puts $fptr "CshiftTileSize"
set first setTileSizeThFloat
set next $tile
upvar #0 $first$next x
puts $fptr "set setTileSizeThFloat$tile $x"
puts $fptr "CshiftTileSize"
}
#--------------- spTex buttons --------------------------
puts $fptr "set spTexEnable $spTexEnable"
puts $fptr "set spTexScaleS $spTexScaleS"
puts $fptr "set spTexScaleT $spTexScaleT"
puts $fptr "set spTexPrimTile $spTexPrimTile"
puts $fptr "set spTexMaxLevel $spTexMaxLevel"
#--------------- setTimg buttons --------------------------
puts $fptr "set setTimgFmt $setTimgFmt"
puts $fptr "CsetTimgFmt"
puts $fptr "set setTimgSize $setTimgSize"
puts $fptr "CsetTimgSize"
puts $fptr "set setTimgwidth $setTimgwidth"
puts $fptr "set setTimgDramAddr $setTimgDramAddr"
#--------------- setTother buttons --------------------------
puts $fptr "set setTotherTexFilt $setTotherTexFilt"
puts $fptr "CsetTotherTexFilt"
puts $fptr "set setTotherPersp $setTotherPersp"
puts $fptr "set setTotherDetail $setTotherDetail"
puts $fptr "CsetTotherDetail"
puts $fptr "set setTotherLOD $setTotherLOD"
puts $fptr "set setTotherTlut $setTotherTlut"
puts $fptr "CsetTotherTlut"
puts $fptr "set setTotherConvert $setTotherConvert"
puts $fptr "CsetTotherConvert"
puts $fptr "CsetTexStateAll"
}
callback_spTex
callback_setTimg
callback_setTile
callback_setTileSize
callback_setTother
callback_send_dl
}
#CsetTexStateAll