[Qb2c-cvs] goengine/src/editor mapedit.cpp,1.17,1.18
Brought to you by:
b_lindeijer,
syn9
|
From: Daniel K. <sy...@us...> - 2004-11-08 16:47:48
|
Update of /cvsroot/qb2c/goengine/src/editor In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22075/src/editor Modified Files: mapedit.cpp Log Message: Generate Radiosity Function Fix Index: mapedit.cpp =================================================================== RCS file: /cvsroot/qb2c/goengine/src/editor/mapedit.cpp,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** mapedit.cpp 8 Nov 2004 16:28:27 -0000 1.17 --- mapedit.cpp 8 Nov 2004 16:47:38 -0000 1.18 *************** *** 2919,2929 **** { ! short x, y, i, an, j, pl, po, plane, poly, nx, ny, p, nr, ng, nb, lightr, lightg, lightb, p1, p2, p3; 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; ! int cgrey = makecol(128,128,128); char tmp[100]; --- 2919,2929 ---- { ! short x, y, i, an, j, pl, po, plane, poly, nx, ny, p, or, og, ob, nr, ng, nb, lightr, lightg, lightb, p1, p2, p3; 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; ! int cgrey = makecol(128,128,128), whitec = makecol(192,192,192); char tmp[100]; *************** *** 2941,2945 **** camry = bk_camry; camrz = bk_camrz; ! scrny = short(bk_scrny); gridbase = bk_gridbase; xzoomratio = bk_xzoomratio; --- 2941,2945 ---- camry = bk_camry; camrz = bk_camrz; ! scrny = bk_scrny; gridbase = bk_gridbase; xzoomratio = bk_xzoomratio; *************** *** 2968,2972 **** { p = lights[l][1]; ! short c = lights[l][0]; strength = lightinfo[p].strength * 1.33 * stp; --- 2968,2972 ---- { p = lights[l][1]; ! c = lights[l][0]; strength = lightinfo[p].strength * 1.33 * stp; *************** *** 3029,3032 **** --- 3029,3033 ---- } + camrx = xr; camry = yr; *************** *** 3223,3229 **** 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); --- 3224,3231 ---- 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); *************** *** 3276,3290 **** for (y = 0; y < 16; y++) { - short old_r, old_g, old_b; - int color; - nr = 0; ng = 0; nb = 0; ! color = getpixel(planeinfo[i].radiosity[j], x, y); ! old_r = getr(color); ! old_g = getg(color); ! old_b = getb(color); p = 0; --- 3278,3289 ---- for (y = 0; y < 16; y++) { nr = 0; ng = 0; nb = 0; ! c = getpixel(planeinfo[i].radiosity[j], x, y); ! or = getr(c); ! og = getg(c); ! ob = getb(c); p = 0; *************** *** 3299,3306 **** { p++; ! color = getpixel(planeinfo[i].radiosity[j], int(sx), int(sy)); ! nr += getr(color); ! ng += getg(color); ! nb += getb(color); } } --- 3298,3305 ---- { p++; ! c = getpixel(planeinfo[i].radiosity[j], sx, sy); ! nr += getr(c); ! ng += getg(c); ! nb += getb(c); } } *************** *** 3317,3323 **** if (nb > 255) nb = 255; ! if (nr < old_r) nr = old_r; ! if (ng < old_g) ng = old_g; ! if (nb < old_b) nb = old_b; putpixel(planeinfo[i].radiosity[j], x, y, makecol(nr, ng, nb)); --- 3316,3322 ---- if (nb > 255) nb = 255; ! if (nr < or) nr = or; ! if (ng < og) ng = og; ! if (nb < ob) nb = ob; putpixel(planeinfo[i].radiosity[j], x, y, makecol(nr, ng, nb)); *************** *** 3346,3353 **** 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; --- 3345,3352 ---- 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; *************** *** 3355,3368 **** spanb = 255 - ambientb; ! nr = ambientr + short(spanr * (float)nr / 255); ! ng = ambientg + short(spang * (float)ng / 255); ! 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; --- 3354,3367 ---- 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) { nr = 255; *************** *** 3387,3391 **** camry = bk_camry; camrz = bk_camrz; ! scrny = short(bk_scrny); gridbase = bk_gridbase; xzoomratio = bk_xzoomratio; --- 3386,3390 ---- camry = bk_camry; camrz = bk_camrz; ! scrny = bk_scrny; gridbase = bk_gridbase; xzoomratio = bk_xzoomratio; *************** *** 3399,3402 **** --- 3398,3402 ---- generating_radiosity = FALSE; + } |