33 static char THIS_FILE[] = __FILE__;
39 :
View(c), material(0), zoom(1), x_offset(0), y_offset(0),
40 nmarks(0), select_mode(SELECT_REPLACE), active(false)
69 int x1 = (int) (cx - (
zoom * w/2));
70 int x2 = (int) (cx + (
zoom * w/2));
71 int y1 = (int) (cy - (
zoom * h/2));
72 int y2 = (int) (cy + (
zoom * h/2));
84 for (
int i = 0; i < p->
nverts; i++) {
90 double tu1 = vset->
tu[n1];
91 double tv1 = vset->
tv[n1];
92 double tu2 = vset->
tu[n2];
93 double tv2 = vset->
tv[n2];
95 x1 = (int) (cx +
zoom * w * (tu1-0.5));
96 x2 = (int) (cx +
zoom * w * (tu2-0.5));
97 y1 = (int) (cy +
zoom * h * (tv1-0.5));
98 y2 = (int) (cy +
zoom * h * (tv2-0.5));
117 int nlines = end-batch;
119 for (
int i = 0; i < nlines; i++) {
120 points[4*i+0] = (float)
marks[batch + i].x;
121 points[4*i+1] = (float)
marks[batch + i].y;
122 points[4*i+2] = (float)
marks[batch + i + 1].x;
123 points[4*i+3] = (float)
marks[batch + i + 1].y;
130 const char* title =
"UV Editor";
132 int len = strlen(title);
182 float du = (float) (dx/w);
183 float dv = (float) (dy/h);
187 DWORD p = value >> 16;
188 DWORD n = value & 0xffff;
191 if (poly && n < poly->nverts) {
193 int v = poly->
verts[n];
238 int w = bmp->
Width();
253 for (
int i = 0; i < p->
nverts; i++) {
254 int n1 = p->
verts[i];
255 double tu1 = vset->
tu[n1];
256 double tv1 = vset->
tv[n1];
258 int x1 = (int) (cx +
zoom * w * (tu1-0.5));
259 int y1 = (int) (cy +
zoom * h * (tv1-0.5));
261 int dx = abs(
marks[0].x - x1);
262 int dy = abs(
marks[0].y - y1);
264 if (dx < 4 && dy < 4) {
265 WORD p_index = iter.
index();
266 DWORD value = (p_index << 16) | i;
276 bool contains =
false;
301 for (
int i = 0; i < p->
nverts; i++) {
302 int n1 = p->
verts[i];
303 double tu1 = vset->
tu[n1];
304 double tv1 = vset->
tv[n1];
306 int x1 = (int) (cx +
zoom * w * (tu1-0.5));
307 int y1 = (int) (cy +
zoom * h * (tv1-0.5));
311 if (rgn.PtInRegion(p)) {
312 WORD p_index = iter.
index();
313 DWORD value = (p_index << 16) | i;
322 bool contains =
false;
352 for (
int i = 0; i < p->
nverts; i++) {
353 WORD p_index = iter.
index();
354 DWORD value = (p_index << 16) | i;
376 for (
int i = 0; i < p->
nverts; i++) {
377 WORD p_index = iter.
index();
378 DWORD value = (p_index << 16) | i;
380 bool contains =
false;
382 for (; svi !=
selverts.end(); ++svi) {
383 if (*svi == value) contains =
true;
399 DWORD value = (p << 16) | v;
401 bool contains =
false;
417 int w = bmp->
Width();
429 for (
int i = 0; i < poly->
nverts; i++) {
430 int n1 = poly->
verts[i];
431 double tu1 = vset->
tu[n1];
432 double tv1 = vset->
tv[n1];
434 int x1 = (int) (cx +
zoom * w * (tu1-0.5));
435 int y1 = (int) (cy +
zoom * h * (tv1-0.5));
437 int dx = abs(p.x - x1);
438 int dy = abs(p.y - y1);
440 if (dx < 4 && dy < 4) {