loadDet.tcl
7.65 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
set loadDetailOptions {.loadDetailTfileL .loadDetailFormatMB .loadDetailTexelSizeMB .loadDetailWidthL .loadDetailHeightL .loadDetailAddrsL .loadDetailWrapMirsMB .loadDetailClampsCB .loadDetailMasksL .loadDetailShiftsL .loadDetailWrapMirtMB .loadDetailClamptCB .loadDetailMasktL .loadDetailShifttL .loadDetailPalttL .loadDetailDoneB }
set loadDetailEntries { .loadDetailTfileE .loadDetailFormatE .loadDetailTexelSizeL .loadDetailWidthE .loadDetailHeightE .loadDetailAddrsE .loadDetailWrapMirsL .loadDetailClampsL .loadDetailMasksE .loadDetailShiftsE .loadDetailWrapMirtL .loadDetailClamptL .loadDetailMasktE .loadDetailShifttE .loadDetailPalttE }
for {set i 0} {$i < [llength $loadDetailOptions]} {incr i 1} {
frame .loadDetailFrame$i
}
label .loadDetailLoadDetL -text "LoadDetailMap" -relief groove
label .loadDetailTfileL -width 10 -text "detFile" -relief groove
entry .loadDetailTfileE -width 8 -relief sunken -textvariable loadDetailTfile
set loadDetailTfile \$ROOT/PR/apps/rdptex/RGBA16grid.h
menubutton .loadDetailFormatMB -text "texFmt" -width 10 -relief raised -menu .loadDetailFormatMB.menu -bg LightGray -activebackground LightGray
menu .loadDetailFormatMB.menu
.loadDetailFormatMB.menu add radiobutton -label RGBA -command CloadDetailFormat -variable loadDetailFormat -value 0
.loadDetailFormatMB.menu add radiobutton -label YUV -command CloadDetailFormat -variable loadDetailFormat -value 1
.loadDetailFormatMB.menu add radiobutton -label CI -command CloadDetailFormat -variable loadDetailFormat -value 2
.loadDetailFormatMB.menu add radiobutton -label IA -command CloadDetailFormat -variable loadDetailFormat -value 3
.loadDetailFormatMB.menu add radiobutton -label I -command CloadDetailFormat -variable loadDetailFormat -value 4
set loadDetailFormat 0
set LloadDetailFormat RGBA
label .loadDetailFormatE -width 8 -relief sunken -textvariable LloadDetailFormat
proc CloadDetailFormat {} {
global loadDetailFormat
global LloadDetailFormat
switch $loadDetailFormat {
0 {set LloadDetailFormat RGBA}
1 {set LloadDetailFormat YUV}
2 {set LloadDetailFormat CI}
3 {set LloadDetailFormat IA}
4 {set LloadDetailFormat I}
}
}
menubutton .loadDetailTexelSizeMB -text "texSiz" -width 10 -relief raised -menu .loadDetailTexelSizeMB.menu -bg LightGray -activebackground LightGray
menu .loadDetailTexelSizeMB.menu
.loadDetailTexelSizeMB.menu add radiobutton -label 4 -command CloadDetailTexelSize -variable loadDetailTexelSize -value 0
.loadDetailTexelSizeMB.menu add radiobutton -label 8 -command CloadDetailTexelSize -variable loadDetailTexelSize -value 1
.loadDetailTexelSizeMB.menu add radiobutton -label 16 -command CloadDetailTexelSize -variable loadDetailTexelSize -value 2
.loadDetailTexelSizeMB.menu add radiobutton -label 32 -command CloadDetailTexelSize -variable loadDetailTexelSize -value 3
set LloadDetailTexelSize 16
set loadDetailTexelSize 2
label .loadDetailTexelSizeL -width 8 -relief sunken -textvariable LloadDetailTexelSize
proc CloadDetailTexelSize {} {
global loadDetailTexelSize
global LloadDetailTexelSize
switch $loadDetailTexelSize {
0 {set LloadDetailTexelSize 4}
1 {set LloadDetailTexelSize 8}
2 {set LloadDetailTexelSize 16}
3 {set LloadDetailTexelSize 32}
}
}
label .loadDetailWidthL -width 10 -text "width" -relief groove
entry .loadDetailWidthE -width 8 -relief sunken -textvariable loadDetailWidth
set loadDetailWidth 32
label .loadDetailHeightL -width 10 -text "height" -relief groove
entry .loadDetailHeightE -width 8 -relief sunken -textvariable loadDetailHeight
set loadDetailHeight 32
set loadDetailTmemaddr 256
label .loadDetailAddrsL -width 10 -text "tmemAddr" -relief groove
label .loadDetailAddrsE -width 8 -relief sunken -text $loadDetailTmemaddr
menubutton .loadDetailWrapMirsMB -width 10 -text "wrapMirrS" -relief raised -menu .loadDetailWrapMirsMB.menu -bg LightGray -activebackground LightGray
menu .loadDetailWrapMirsMB.menu
.loadDetailWrapMirsMB.menu add radiobutton -label wrapS -command CloadDetailWrapMirS -variable loadDetailWrapMirS -value 0
.loadDetailWrapMirsMB.menu add radiobutton -label mirrorS -command CloadDetailWrapMirS -variable loadDetailWrapMirS -value 1
set loadDetailWrapMirS 0
set LloadDetailWrapMirS wrapS
label .loadDetailWrapMirsL -width 8 -relief sunken -textvariable LloadDetailWrapMirS
proc CloadDetailWrapMirS {} {
global loadDetailWrapMirS
global LloadDetailWrapMirS
switch $loadDetailWrapMirS {
0 {set LloadDetailWrapMirS wrS}
1 {set LloadDetailWrapMirS miS}
}
}
checkbutton .loadDetailClampsCB -width 7 -command loadDetailClampSsetLabel -padx 3 -text "clampS" -variable loadDetailClampS
set loadDetailClampS 1
label .loadDetailClampsL -width 8 -relief sunken -textvariable loadDetailClampsLabel
set loadDetailClampsLabel On
proc loadDetailClampSsetLabel {} {
global loadDetailClampS
global loadDetailClampsLabel
if {$loadDetailClampS == 1} {
set loadDetailClampsLabel "On"
} else {
set loadDetailClampsLabel "Off"
}
}
label .loadDetailMasksL -width 10 -text "maskS" -relief groove
entry .loadDetailMasksE -width 8 -relief sunken -textvariable loadDetailMaskS
set loadDetailMaskS 5
label .loadDetailShiftsL -width 10 -text "shiftS" -relief groove
entry .loadDetailShiftsE -width 8 -relief sunken -textvariable loadDetailShiftS
set loadDetailShiftS 5
menubutton .loadDetailWrapMirtMB -width 10 -text "wrapMirrT" -relief raised -menu .loadDetailWrapMirtMB.menu -bg LightGray -activebackground LightGray
menu .loadDetailWrapMirtMB.menu
.loadDetailWrapMirtMB.menu add radiobutton -label wrapT -command CloadDetailWrapMirT -variable loadDetailWrapMirT -value 0
.loadDetailWrapMirtMB.menu add radiobutton -label mirrorT -command CloadDetailWrapMirT -variable loadDetailWrapMirT -value 1
set loadDetailWrapMirT 0
set LloadDetailWrapMirT wrapT
label .loadDetailWrapMirtL -width 8 -relief sunken -textvariable LloadDetailWrapMirT
proc CloadDetailWrapMirT {} {
global loadDetailWrapMirT
global LloadDetailWrapMirT
switch $loadDetailWrapMirT {
0 {set LloadDetailWrapMirT wrT}
1 {set LloadDetailWrapMirT miT}
}
}
checkbutton .loadDetailClamptCB -width 7 -command loadDetailClampTsetLabel -padx 3 -text "clampT" -variable loadDetailClampT
set loadDetailClampT 1
label .loadDetailClamptL -width 8 -relief sunken -textvariable loadDetailClamptLabel
set loadDetailClamptLabel On
proc loadDetailClampTsetLabel {} {
global loadDetailClampT
global loadDetailClamptLabel
if {$loadDetailClampT == 1} {
set loadDetailClamptLabel "On"
} else {
set loadDetailClamptLabel "Off"
}
}
menubutton .loadDetailWcmtMB -width 10 -text "wcmT" -relief raised -menu .loadDetailWcmtMB.menu -bg LightGray -activebackground LightGray
menu .loadDetailWcmtMB.menu
.loadDetailWcmtMB.menu add radiobutton -label WrapT -variable loadDetailWcmt -value wrapT
.loadDetailWcmtMB.menu add radiobutton -label ClampT -variable loadDetailWcmt -value clampT
.loadDetailWcmtMB.menu add radiobutton -label MirrorT -variable loadDetailWcmt -value mirrorT
set loadDetailWcmt wrapT
label .loadDetailWcmtL -width 8 -relief sunken -textvariable loadDetailWcmt
label .loadDetailMasktL -width 10 -text "maskT" -relief groove
entry .loadDetailMasktE -width 8 -relief sunken -textvariable loadDetailMaskt
set loadDetailMaskt 4
label .loadDetailShifttL -width 10 -text "shiftT" -relief groove
entry .loadDetailShifttE -width 8 -relief sunken -textvariable loadDetailShiftT
set loadDetailShiftT 5
label .loadDetailPalttL -width 10 -text "palette" -relief groove
entry .loadDetailPalttE -width 8 -relief sunken -textvariable loadDetailPalette
set loadDetailPalette 0
checkbutton .loadDetailMipmapCB -text "mipmap" -variable loadDetailMipmap
set loadDetailMipmap 0
button .loadDetailDoneB -command loadDet -text "done"