Update of /cvsroot/qb2c/goengine/src/editor
In directory sc8-pr-cvs1:/tmp/cvs-serv16906/src/editor
Modified Files:
mapedit.cpp mapeditglobals.cpp mapeditglobals.h
Log Message:
Getting rid of global 'c' variables, is ugly and causes many warnings.
Index: mapedit.cpp
===================================================================
RCS file: /cvsroot/qb2c/goengine/src/editor/mapedit.cpp,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -d -r1.14 -r1.15
*** mapedit.cpp 20 Jan 2004 17:14:06 -0000 1.14
--- mapedit.cpp 20 Jan 2004 17:39:23 -0000 1.15
***************
*** 2358,2365 ****
void drawpolys()
{
! int i, poly, p1, p2, p3, t, a, c, x, y, bluec = makecol(0,0,192), redc = makecol(192,0,0);
int greyc = makecol(96, 96, 96), whitec = makecol(192,192,192), greenc = makecol(0,192,0), yellowc = makecol(224, 224, 32);
short u[3], v[3];
int trans = makecol(255, 0, 255);
V3D_f v1, v2, v3, vv1, vv2, vv3;
--- 2358,2366 ----
void drawpolys()
{
! int i, poly, p1, p2, p3, t, a, x, y, bluec = makecol(0,0,192), redc = makecol(192,0,0);
int greyc = makecol(96, 96, 96), whitec = makecol(192,192,192), greenc = makecol(0,192,0), yellowc = makecol(224, 224, 32);
short u[3], v[3];
int trans = makecol(255, 0, 255);
+ unsigned int c;
V3D_f v1, v2, v3, vv1, vv2, vv3;
***************
*** 2489,2500 ****
if (fillmode == 0)
{
! c = 0;
! if (hlplane && tselplane == polyinfo[poly].plane) c = bluec;
! if (planeinfo[polyinfo[poly].plane].polyinfo[polyinfo[poly].poly][6] == 1) c = greenc;
! if (planeinfo[polyinfo[poly].plane].polyinfo[polyinfo[poly].poly][7] == 1) c = yellowc;
! if (hlpoly && tselpoly == polyinfo[poly].poly && selplane == polyinfo[poly].plane) c = bluec;
! line(offscreen, int(v1.x), int(v1.y), int(v2.x), int(v2.y), c);
! line(offscreen, int(v3.x), int(v3.y), int(v2.x), int(v2.y), c);
! line(offscreen, int(v1.x), int(v1.y), int(v3.x), int(v3.y), c);
}
--- 2490,2501 ----
if (fillmode == 0)
{
! int color = 0;
! if (hlplane && tselplane == polyinfo[poly].plane) color = bluec;
! if (planeinfo[polyinfo[poly].plane].polyinfo[polyinfo[poly].poly][6] == 1) color = greenc;
! if (planeinfo[polyinfo[poly].plane].polyinfo[polyinfo[poly].poly][7] == 1) color = yellowc;
! if (hlpoly && tselpoly == polyinfo[poly].poly && selplane == polyinfo[poly].plane) color = bluec;
! line(offscreen, int(v1.x), int(v1.y), int(v2.x), int(v2.y), color);
! line(offscreen, int(v3.x), int(v3.y), int(v2.x), int(v2.y), color);
! line(offscreen, int(v1.x), int(v1.y), int(v3.x), int(v3.y), color);
}
***************
*** 2526,2529 ****
--- 2527,2532 ----
if (planeinfo[polyinfo[poly].plane].polyinfo[polyinfo[poly].poly][6] == 0 && planeinfo[polyinfo[poly].plane].polyinfo[polyinfo[poly].poly][8] == 0)
{
+ int color;
+
triangle3d_f(offscreen, POLYTYPE_PTEX_MASK, planeinfo[polyinfo[poly].plane].radiosity[polyinfo[poly].poly], &v1, &v2, &v3);
***************
*** 2534,2539 ****
for (y = 0; y < 16; y++)
{
! c = getpixel(textures[t], x, y);
! if (c == trans) putpixel(texturesb, x, y, trans);
}
}
--- 2537,2542 ----
for (y = 0; y < 16; y++)
{
! color = getpixel(textures[t], x, y);
! if (color == trans) putpixel(texturesb, x, y, trans);
}
}
***************
*** 2546,2551 ****
for (y = 0; y < 16; y++)
{
! c = getpixel(textures[t], x, y);
! if (c != trans) putpixel(texturesb, x, y, poly);
}
}
--- 2549,2554 ----
for (y = 0; y < 16; y++)
{
! color = getpixel(textures[t], x, y);
! if (color != trans) putpixel(texturesb, x, y, poly);
}
}
***************
*** 2584,2589 ****
for (y = 0; y < 16; y++)
{
! c = getpixel(textures[t], x, y);
! if (c == trans) putpixel(texturesb, x, y, trans);
}
}
--- 2587,2592 ----
for (y = 0; y < 16; y++)
{
! color = getpixel(textures[t], x, y);
! if (color == trans) putpixel(texturesb, x, y, trans);
}
}
***************
*** 2616,2621 ****
for (y = 0; y < 16; y++)
{
! c = getpixel(textures[t], x, y);
! if (c == trans) putpixel(texturesb, x, y, trans);
}
}
--- 2619,2624 ----
for (y = 0; y < 16; y++)
{
! color = getpixel(textures[t], x, y);
! if (color == trans) putpixel(texturesb, x, y, trans);
}
}
***************
*** 2648,2653 ****
for (y = 0; y < 16; y++)
{
! c = getpixel(textures[t], x, y);
! if (c == trans) putpixel(texturesb, x, y, trans);
}
}
--- 2651,2656 ----
for (y = 0; y < 16; y++)
{
! color = getpixel(textures[t], x, y);
! if (color == trans) putpixel(texturesb, x, y, trans);
}
}
***************
*** 2748,2752 ****
short ambientr, ambientg, ambientb, spanr, spang, spanb, focusstep, l, a, b;
float dist, intense, strength, xx, yy, zz;
! float v, sx, sy, sz, aa, bb, cc, dd, ee, ff, c, c1, c2, c3;
float ax, ay, az, bx, by, bz, ii, jj, kk, d, d1, d2, normalx, normaly, normalz;
--- 2751,2755 ----
short ambientr, ambientg, ambientb, spanr, spang, spanb, focusstep, l, a, b;
float dist, intense, strength, xx, yy, zz;
! float v, sx, sy, sz, aa, bb, cc, dd, ee, ff, c1, c2, c3;
float ax, ay, az, bx, by, bz, ii, jj, kk, d, d1, d2, normalx, normaly, normalz;
***************
*** 2786,2790 ****
{
p = lights[l][1];
! c = lights[l][0];
strength = lightinfo[p].strength * 1.33 * stp;
--- 2789,2793 ----
{
p = lights[l][1];
! short c = lights[l][0];
strength = lightinfo[p].strength * 1.33 * stp;
***************
*** 3079,3082 ****
--- 3082,3086 ----
{
short old_r, old_g, old_b;
+ int color;
nr = 0;
***************
*** 3084,3091 ****
nb = 0;
! c = getpixel(planeinfo[i].radiosity[j], x, y);
! old_r = getr(c);
! old_g = getg(c);
! old_b = getb(c);
p = 0;
--- 3088,3095 ----
nb = 0;
! color = getpixel(planeinfo[i].radiosity[j], x, y);
! old_r = getr(color);
! old_g = getg(color);
! old_b = getb(color);
p = 0;
***************
*** 3100,3107 ****
{
p++;
! c = getpixel(planeinfo[i].radiosity[j], sx, sy);
! nr += getr(c);
! ng += getg(c);
! nb += getb(c);
}
}
--- 3104,3111 ----
{
p++;
! color = getpixel(planeinfo[i].radiosity[j], int(sx), int(sy));
! nr += getr(color);
! ng += getg(color);
! nb += getb(color);
}
}
***************
*** 3150,3157 ****
for (y = 0; y < 16; y++)
{
! c = getpixel(planeinfo[i].radiosity[j], x, y);
! nr = getr(c);
! ng = getg(c);
! nb = getb(c);
spanr = 255 - ambientr;
--- 3154,3161 ----
for (y = 0; y < 16; y++)
{
! int color = getpixel(planeinfo[i].radiosity[j], x, y);
! nr = getr(color);
! ng = getg(color);
! nb = getb(color);
spanr = 255 - ambientr;
***************
*** 3163,3172 ****
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)
{
nr = 255;
--- 3167,3176 ----
nb = ambientb + short(spanb * (float)nb / 255);
! color = getpixel(textures[planeinfo[i].polyinfo[j][3]], x, y);
! nr = short(getr(color) * (float)nr / 255);
! ng = short(getg(color) * (float)ng / 255);
! nb = short(getb(color) * (float)nb / 255);
! if (getr(color) == 255 && getg(color) == 0 && getb(color) == 255)
{
nr = 255;
***************
*** 3201,3205 ****
generating_radiosity = FALSE;
-
}
--- 3205,3208 ----
Index: mapeditglobals.cpp
===================================================================
RCS file: /cvsroot/qb2c/goengine/src/editor/mapeditglobals.cpp,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** mapeditglobals.cpp 20 Jan 2004 02:48:43 -0000 1.6
--- mapeditglobals.cpp 20 Jan 2004 17:39:23 -0000 1.7
***************
*** 17,22 ****
short pscx, pscy;
! short selplane, nselpoint, selpoly[max_polies], nlights, nselpoly, tselplane, tselpoint, tselpoly, nselpointc, sellight;
float selpoint[max_points][4], selpointc[max_points][4];
//x,y,z, real index
bool hlpoint, hlplane, hlpoly, grid;
--- 17,23 ----
short pscx, pscy;
! short selplane, selpoly[max_polies], tselplane, tselpoint, tselpoly, sellight;
float selpoint[max_points][4], selpointc[max_points][4];
+ unsigned short nselpoint, nselpoly, nlights, nselpointc;
//x,y,z, real index
bool hlpoint, hlplane, hlpoly, grid;
***************
*** 46,48 ****
bool hud;
! char curfile[20];
\ No newline at end of file
--- 47,49 ----
bool hud;
! char curfile[20];
Index: mapeditglobals.h
===================================================================
RCS file: /cvsroot/qb2c/goengine/src/editor/mapeditglobals.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** mapeditglobals.h 20 Jan 2004 02:48:43 -0000 1.6
--- mapeditglobals.h 20 Jan 2004 17:39:23 -0000 1.7
***************
*** 91,96 ****
extern short pscx, pscy;
! extern short selplane, nselpoint, selpoly[max_polies], nlights, nselpoly, tselplane, tselpoint, tselpoly, nselpointc, sellight;
extern float selpoint[max_points][4], selpointc[max_points][4];
//x,y,z, real index
extern bool hlpoint, hlplane, hlpoly, grid;
--- 91,98 ----
extern short pscx, pscy;
! extern short selplane, selpoly[max_polies], tselplane, tselpoint, tselpoly, sellight;
extern float selpoint[max_points][4], selpointc[max_points][4];
+ extern unsigned short nselpoint, nselpoly, nlights, nselpointc;
+
//x,y,z, real index
extern bool hlpoint, hlplane, hlpoly, grid;
|