[Qb2c-cvs] goengine/src/editor mapedit.cpp,1.13,1.14
Brought to you by:
b_lindeijer,
syn9
|
From: <b_l...@us...> - 2004-01-20 17:14:11
|
Update of /cvsroot/qb2c/goengine/src/editor
In directory sc8-pr-cvs1:/tmp/cvs-serv11303/src/editor
Modified Files:
mapedit.cpp
Log Message:
Many many warnings fixed. Still a lot to go...
Index: mapedit.cpp
===================================================================
RCS file: /cvsroot/qb2c/goengine/src/editor/mapedit.cpp,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** mapedit.cpp 20 Jan 2004 15:24:13 -0000 1.13
--- mapedit.cpp 20 Jan 2004 17:14:06 -0000 1.14
***************
*** 1385,1390 ****
if ((editingmode >= modify_light && editingmode < 900 && nselpoint > 0) || editingmode == modify_light_strength_by_selection)
{
! p = selpoint[0][3];
! if (editingmode == modify_light_strength_by_selection) p = selpointc[0][3];
if (p > -1 || (planeinfo[selplane].lastpoint = 0 && planeinfo[selplane].pointinfo[0][9] > 0))
{
--- 1385,1390 ----
if ((editingmode >= modify_light && editingmode < 900 && nselpoint > 0) || editingmode == modify_light_strength_by_selection)
{
! p = int(selpoint[0][3]);
! if (editingmode == modify_light_strength_by_selection) p = int(selpointc[0][3]);
if (p > -1 || (planeinfo[selplane].lastpoint = 0 && planeinfo[selplane].pointinfo[0][9] > 0))
{
***************
*** 1450,1454 ****
if ((mouse_b & 1 && checkmouse(384, 24 + 12 * 14, 511, 35 + 12 * 14)) || key[KEY_2])
{
! sellight = planeinfo[selplane].pointinfo[p][9] - 1;
selpointc[0][0] = selpoint[0][0];
selpointc[0][1] = selpoint[0][1];
--- 1450,1454 ----
if ((mouse_b & 1 && checkmouse(384, 24 + 12 * 14, 511, 35 + 12 * 14)) || key[KEY_2])
{
! sellight = short(planeinfo[selplane].pointinfo[p][9]) - 1;
selpointc[0][0] = selpoint[0][0];
selpointc[0][1] = selpoint[0][1];
***************
*** 1562,1566 ****
{
p = short(planeinfo[a].pointinfo[c][6]);
! if (checkmouse(pointinfo[p].x-clearance, pointinfo[p].y-clearance, pointinfo[p].x+clearance, pointinfo[p].y+clearance) && clicked == 0 && planeinfo[a].pointinfo[c][7] == 0)
{
rect(offscreen, int(pointinfo[p].x) - clearance-1, int(pointinfo[p].y) - clearance-1, int(pointinfo[p].x) + clearance+1, int(pointinfo[p].y) + clearance+1, bluec);
--- 1562,1566 ----
{
p = short(planeinfo[a].pointinfo[c][6]);
! if (checkmouse(short(pointinfo[p].x) - clearance, short(pointinfo[p].y) - clearance, short(pointinfo[p].x) + clearance, short(pointinfo[p].y) + clearance) && clicked == 0 && planeinfo[a].pointinfo[c][7] == 0)
{
rect(offscreen, int(pointinfo[p].x) - clearance-1, int(pointinfo[p].y) - clearance-1, int(pointinfo[p].x) + clearance+1, int(pointinfo[p].y) + clearance+1, bluec);
***************
*** 1623,1629 ****
c = lights[a][1];
! if (checkmouse(pointinfo[b].x - clearance, pointinfo[b].y - clearance, pointinfo[b].x + clearance, pointinfo[b].y + clearance))
{
! circle(offscreen, pointinfo[b].x, pointinfo[b].y, clearance * 2, bluec);
tselplane = pointinfo[b].plane;
--- 1623,1629 ----
c = lights[a][1];
! if (checkmouse(int(pointinfo[b].x) - clearance, int(pointinfo[b].y) - clearance, int(pointinfo[b].x) + clearance, int(pointinfo[b].y) + clearance))
{
! circle(offscreen, int(pointinfo[b].x), int(pointinfo[b].y), clearance * 2, bluec);
tselplane = pointinfo[b].plane;
***************
*** 1644,1652 ****
if (planeinfo[tselplane].pointinfo[c][7] == 0)
{
! p = planeinfo[tselplane].pointinfo[c][6];
! if (pointinfo[p].x < farleft && pointinfo[p].x > -1) farleft = pointinfo[p].x;
! if (pointinfo[p].x > farright && pointinfo[p].x < xres) farright = pointinfo[p].x;
! if (pointinfo[p].y < fartop && pointinfo[p].y > -1) fartop = pointinfo[p].y;
! if (pointinfo[p].y > farbottom && pointinfo[p].y < yres) farbottom = pointinfo[p].y;
}
--- 1644,1652 ----
if (planeinfo[tselplane].pointinfo[c][7] == 0)
{
! p = int(planeinfo[tselplane].pointinfo[c][6]);
! if (pointinfo[p].x < farleft && pointinfo[p].x > -1) farleft = short(pointinfo[p].x);
! if (pointinfo[p].x > farright && pointinfo[p].x < xres) farright = short(pointinfo[p].x);
! if (pointinfo[p].y < fartop && pointinfo[p].y > -1) fartop = short(pointinfo[p].y);
! if (pointinfo[p].y > farbottom && pointinfo[p].y < yres) farbottom = short(pointinfo[p].y);
}
***************
*** 1723,1729 ****
p3 = planeinfo[tselplane].polyinfo[c][2] + basepoint;
! if (planeinfo[selplane].pointinfo[p1][7] == 1) p1 = planeinfo[selplane].pointinfo[p1][8];
! if (planeinfo[selplane].pointinfo[p2][7] == 1) p2 = planeinfo[selplane].pointinfo[p2][8];
! if (planeinfo[selplane].pointinfo[p3][7] == 1) p3 = planeinfo[selplane].pointinfo[p3][8];
--- 1723,1729 ----
p3 = planeinfo[tselplane].polyinfo[c][2] + basepoint;
! if (planeinfo[selplane].pointinfo[p1][7] == 1) p1 = short(planeinfo[selplane].pointinfo[p1][8]);
! if (planeinfo[selplane].pointinfo[p2][7] == 1) p2 = short(planeinfo[selplane].pointinfo[p2][8]);
! if (planeinfo[selplane].pointinfo[p3][7] == 1) p3 = short(planeinfo[selplane].pointinfo[p3][8]);
***************
*** 1813,1826 ****
if (pointinfo[p].sz > -10) continue;
! fx = xcenter + sx / sz * xzoomratio;
if (pointinfo[p].x < 0 || pointinfo[p].x > xres) continue;
! fy = ycenter + sy / sz * yzoomratio - scrny;
if (pointinfo[p].y < 0 || pointinfo[p].y > yres) continue;
! x = abs(pointinfo[p].x - fx);
! circle (offscreen, pointinfo[p].x, pointinfo[p].y, clearance, orangec);
! circle (offscreen, pointinfo[p].x, pointinfo[p].y, x, orangec);
}
--- 1813,1826 ----
if (pointinfo[p].sz > -10) continue;
! fx = xcenter + short(sx / sz * xzoomratio);
if (pointinfo[p].x < 0 || pointinfo[p].x > xres) continue;
! fy = ycenter + short(sy / sz * yzoomratio) - scrny;
if (pointinfo[p].y < 0 || pointinfo[p].y > yres) continue;
! x = abs(int(pointinfo[p].x) - fx);
! circle(offscreen, int(pointinfo[p].x), int(pointinfo[p].y), clearance, orangec);
! circle(offscreen, int(pointinfo[p].x), int(pointinfo[p].y), int(x), orangec);
}
***************
*** 1838,1850 ****
if (sz > -10) continue;
- fx = xcenter + sx / sz * xzoomratio;
-
fx = xcenter + short(sx / sz * xzoomratio);
if (fx < 0 || fx > xres) continue;
-
- fy = ycenter + sy / sz * yzoomratio - scrny;
-
fy = ycenter + short(sy / sz * yzoomratio) - scrny;
--- 1838,1845 ----
***************
*** 1866,1873 ****
if (sz > -10) continue;
! fx = xcenter + sx / sz * xzoomratio;
if (fx < 0 || fx > xres) continue;
! fy = ycenter + sy / sz * yzoomratio - scrny;
if (fy < 0 || fy > yres) continue;
--- 1861,1868 ----
if (sz > -10) continue;
! fx = xcenter + short(sx / sz * xzoomratio);
if (fx < 0 || fx > xres) continue;
! fy = ycenter + short(sy / sz * yzoomratio) - scrny;
if (fy < 0 || fy > yres) continue;
***************
*** 1957,1961 ****
for (c = 0; c < 3; c++)
{
! p = selpoint[c][3];
if (p == -1)
{
--- 1952,1956 ----
for (c = 0; c < 3; c++)
{
! p = int(selpoint[c][3]);
if (p == -1)
{
***************
*** 1972,1980 ****
basepoly = selpoly[0];
! planeinfo[selplane].polyinfo[basepoly][0] = selpoint[0][3];
! planeinfo[selplane].polyinfo[basepoly][1] = selpoint[1][3];
! planeinfo[selplane].polyinfo[basepoly][2] = selpoint[2][3];
! nselpoly = 1;
rotate_plane(selplane);
--- 1967,1975 ----
basepoly = selpoly[0];
! planeinfo[selplane].polyinfo[basepoly][0] = short(selpoint[0][3]);
! planeinfo[selplane].polyinfo[basepoly][1] = short(selpoint[1][3]);
! planeinfo[selplane].polyinfo[basepoly][2] = short(selpoint[2][3]);
! nselpoly = 1;
rotate_plane(selplane);
***************
*** 1985,1989 ****
if (editingmode == addpoly && nselpoint == 3)
{
! basepoint = planeinfo[selplane].lastpoint + 1;
condense_rotate(selplane);
--- 1980,1984 ----
if (editingmode == addpoly && nselpoint == 3)
{
! basepoint = planeinfo[selplane].lastpoint + 1;
condense_rotate(selplane);
***************
*** 1991,1995 ****
for (c = 0; c < 3; c++)
{
! p = selpoint[c][3];
if (p == -1)
{
--- 1986,1990 ----
for (c = 0; c < 3; c++)
{
! p = int(selpoint[c][3]);
if (p == -1)
{
***************
*** 2006,2012 ****
basepoly = planeinfo[selplane].lastpoly + 1;
! planeinfo[selplane].polyinfo[basepoly][0] = selpoint[0][3];
! planeinfo[selplane].polyinfo[basepoly][1] = selpoint[1][3];
! planeinfo[selplane].polyinfo[basepoly][2] = selpoint[2][3];
for (c = 3; c < 10; c++)
{
--- 2001,2007 ----
basepoly = planeinfo[selplane].lastpoly + 1;
! planeinfo[selplane].polyinfo[basepoly][0] = short(selpoint[0][3]);
! planeinfo[selplane].polyinfo[basepoly][1] = short(selpoint[1][3]);
! planeinfo[selplane].polyinfo[basepoly][2] = short(selpoint[2][3]);
for (c = 3; c < 10; c++)
{
***************
*** 2163,2167 ****
}
} else {
! p = selpoint[c][3];
}
--- 2158,2162 ----
}
} else {
! p = int(selpoint[c][3]);
}
***************
*** 2259,2267 ****
by = top + 13 + y * w;
p = planeinfo[selplane].polyinfo[selpoly[0]][3];
! stretch_sprite(offscreen, textures[p], bx, by, s, s);
! line (offscreen, bx + (float)vtx[b][0] / 16 * s + g, by + (float)vtx[b][1] / 16 * s + g, bx + (float)vtx[b][2] / 16 * s + g, by + (float)vtx[b][3] / 16 * s + g, whitec);
! line (offscreen, bx + (float)vtx[b][4] / 16 * s + g, by + (float)vtx[b][5] / 16 * s + g, bx + (float)vtx[b][2] / 16 * s + g, by + (float)vtx[b][3] / 16 * s + g, whitec);
! line (offscreen, bx + (float)vtx[b][0] / 16 * s + g, by + (float)vtx[b][1] / 16 * s + g, bx + (float)vtx[b][4] / 16 * s + g, by + (float)vtx[b][5] / 16 * s + g, whitec);
d = 0;
--- 2254,2262 ----
by = top + 13 + y * w;
p = planeinfo[selplane].polyinfo[selpoly[0]][3];
! stretch_sprite(offscreen, textures[p], bx, by, int(s), int(s));
! line(offscreen, bx + int((float)vtx[b][0] / 16 * s) + g, by + int((float)vtx[b][1] / 16 * s) + g, bx + int((float)vtx[b][2] / 16 * s) + g, by + int((float)vtx[b][3] / 16 * s) + g, whitec);
! line(offscreen, bx + int((float)vtx[b][4] / 16 * s) + g, by + int((float)vtx[b][5] / 16 * s) + g, bx + int((float)vtx[b][2] / 16 * s) + g, by + int((float)vtx[b][3] / 16 * s) + g, whitec);
! line(offscreen, bx + int((float)vtx[b][0] / 16 * s) + g, by + int((float)vtx[b][1] / 16 * s) + g, bx + int((float)vtx[b][4] / 16 * s) + g, by + int((float)vtx[b][5] / 16 * s) + g, whitec);
d = 0;
***************
*** 2270,2278 ****
if (vtx[b][e] == planeinfo[selplane].polyvtx[selpoly[0]][e]) d++;
}
! if (d == 6) surroundbox(2, lft + 13 + x * w, top + 13 + y * w, lft + 13 + x * w + s, top + 13 + y * w + s);
! if (checkmouse(lft + 13 + x * w, top + 13 + y * w, lft + 13 + x * w + s, top + 13 + y * w + s))
{
! surroundbox(3, lft + 13 + x * w, top + 13 + y * w, lft + 13 + x * w + s, top + 13 + y * w + s);
if (mouse_b & 1)
{
--- 2265,2273 ----
if (vtx[b][e] == planeinfo[selplane].polyvtx[selpoly[0]][e]) d++;
}
! if (d == 6) surroundbox(2, lft + 13 + x * w, top + 13 + y * w, lft + 13 + x * w + int(s), top + 13 + y * w + int(s));
! if (checkmouse(lft + 13 + x * w, top + 13 + y * w, lft + 13 + x * w + int(s), top + 13 + y * w + int(s)))
{
! surroundbox(3, lft + 13 + x * w, top + 13 + y * w, lft + 13 + x * w + int(s), top + 13 + y * w + int(s));
if (mouse_b & 1)
{
***************
*** 2312,2316 ****
for (c = 0; c < nselpoint; c++)
{
! p = selpoint[c][3];
if (p > -1)
{
--- 2307,2311 ----
for (c = 0; c < nselpoint; c++)
{
! p = int(selpoint[c][3]);
if (p > -1)
{
***************
*** 2370,2374 ****
V3D_f v1, v2, v3, vv1, vv2, vv3;
! vispolys = 0;
--- 2365,2369 ----
V3D_f v1, v2, v3, vv1, vv2, vv3;
! vispolys = 0;
***************
*** 2386,2391 ****
if (planeinfo[pointinfo[c].plane].pointinfo[pointinfo[c].point][7] == 0)
{
! fx = pointinfo[c].x;
! fy = pointinfo[c].y;
//rectfill(offscreen, fx-1, fy-1, fx+1, fy+1, greyc);
}
--- 2381,2386 ----
if (planeinfo[pointinfo[c].plane].pointinfo[pointinfo[c].point][7] == 0)
{
! fx = short(pointinfo[c].x);
! fy = short(pointinfo[c].y);
//rectfill(offscreen, fx-1, fy-1, fx+1, fy+1, greyc);
}
***************
*** 2511,2515 ****
if (level > 0)
{
! set_trans_blender(255,255,255,255 * (float(100 - level) / 100));
triangle3d_f(offscreen, POLYTYPE_PTEX_MASK_TRANS, planeinfo[polyinfo[poly].plane].radiosity[polyinfo[poly].poly], &v1, &v2, &v3);
} else {
--- 2506,2510 ----
if (level > 0)
{
! set_trans_blender(255,255,255,int(255 * (float(100 - level) / 100)));
triangle3d_f(offscreen, POLYTYPE_PTEX_MASK_TRANS, planeinfo[polyinfo[poly].plane].radiosity[polyinfo[poly].poly], &v1, &v2, &v3);
} else {
***************
*** 2767,2771 ****
camry = bk_camry;
camrz = bk_camrz;
! scrny = bk_scrny;
gridbase = bk_gridbase;
xzoomratio = bk_xzoomratio;
--- 2762,2766 ----
camry = bk_camry;
camrz = bk_camrz;
! scrny = short(bk_scrny);
gridbase = bk_gridbase;
xzoomratio = bk_xzoomratio;
***************
*** 3031,3037 ****
c = getpixel(planeinfo[plane].radiosity[poly], nx, ny);
! nr = lightr * intense;
! ng = lightg * intense;
! nb = lightb * intense;
nr = nr + getr(c);
ng = ng + getg(c);
--- 3026,3032 ----
c = getpixel(planeinfo[plane].radiosity[poly], nx, ny);
! nr = short(lightr * intense);
! ng = short(lightg * intense);
! nb = short(lightb * intense);
nr = nr + getr(c);
ng = ng + getg(c);
***************
*** 3164,3175 ****
spanb = 255 - ambientb;
! nr = ambientr + spanr * (float)nr / 255;
! ng = ambientg + spang * (float)ng / 255;
! nb = ambientb + spanb * (float)nb / 255;
c = getpixel(textures[planeinfo[i].polyinfo[j][3]], x, y);
! nr = getr(c) * (float)nr / 255;
! ng = getg(c) * (float)ng / 255;
! nb = getb(c) * (float)nb / 255;
if (getr(c) == 255 && getg(c) == 0 && getb(c) == 255)
--- 3159,3170 ----
spanb = 255 - ambientb;
! nr = ambientr + short(spanr * (float)nr / 255);
! ng = ambientg + short(spang * (float)ng / 255);
! nb = ambientb + short(spanb * (float)nb / 255);
c = getpixel(textures[planeinfo[i].polyinfo[j][3]], x, y);
! nr = short(getr(c) * (float)nr / 255);
! ng = short(getg(c) * (float)ng / 255);
! nb = short(getb(c) * (float)nb / 255);
if (getr(c) == 255 && getg(c) == 0 && getb(c) == 255)
|