Update of /cvsroot/qb2c/goengine/src/editor
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19117/editor
Modified Files:
gomapedit.cpp mapedit.cpp mapeditfileinput.cpp
mapeditglobals.cpp mapeditglobals.h mapeditgui.cpp
Log Message:
Committing changes made by syn9 after resolving numerous conflicts throughout
the code.
Index: gomapedit.cpp
===================================================================
RCS file: /cvsroot/qb2c/goengine/src/editor/gomapedit.cpp,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** gomapedit.cpp 20 Jan 2004 18:19:27 -0000 1.13
--- gomapedit.cpp 8 Nov 2004 14:17:35 -0000 1.14
***************
*** 36,40 ****
printf("Initializing game data...\n");
! initialize(0, 800, 600);
hud = FALSE;
--- 36,41 ----
printf("Initializing game data...\n");
! initialize(24, 0, 640, 480);
! //initialize(24, 0, 1024, 768);
hud = FALSE;
***************
*** 50,54 ****
globaltime = time(NULL) + 1;
!
do
{
--- 51,57 ----
globaltime = time(NULL) + 1;
! vdist = viewdist;
!
!
do
{
***************
*** 86,94 ****
!
!
updphysics();
!
if (generating_radiosity)
--- 89,96 ----
!
updphysics();
!
if (generating_radiosity)
***************
*** 99,102 ****
--- 101,105 ----
updscreen();
+ if (FPS < 20) fpsr = 1;
if (fillmode == 0) clear_to_color(offscreen, cgrey);
if (fillmode == 1) clear_to_color(offscreen, 0);
***************
*** 105,109 ****
!
} while (!key[KEY_F12]);
--- 108,113 ----
!
! vsync();
} while (!key[KEY_F12]);
Index: mapeditgui.cpp
===================================================================
RCS file: /cvsroot/qb2c/goengine/src/editor/mapeditgui.cpp,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** mapeditgui.cpp 20 Jan 2004 18:19:27 -0000 1.6
--- mapeditgui.cpp 8 Nov 2004 14:17:35 -0000 1.7
***************
*** 792,796 ****
for (c = 0; c < nselpoly; c++)
{
! planeinfo[selplane].polyinfo[selpoly[c]][8] = trigger;
}
} else {
--- 792,796 ----
for (c = 0; c < nselpoly; c++)
{
! planeinfo[selplane].polyinfo[selpoly[c]][9] = trigger;
}
} else {
***************
*** 980,984 ****
updscreen();
! if (mouse_b & 1 && checkmouse(gleft + length - 8 * 8, gtop + height, gleft + length - 1, gtop - 1 + height + 12))
{
failed = TRUE;
--- 980,984 ----
updscreen();
! if (key[KEY_ESC] || (mouse_b & 1 && checkmouse(gleft + length - 8 * 8, gtop + height, gleft + length - 1, gtop - 1 + height + 12)))
{
failed = TRUE;
***************
*** 1070,1074 ****
if (strlen(rfile) > 0)
{
! load_file(rfile);
} else {
allegro_message("Unable to Process Request");
--- 1070,1076 ----
if (strlen(rfile) > 0)
{
! sprintf(curfile, "%s", rfile);
! load_file(rfile);
!
} else {
allegro_message("Unable to Process Request");
***************
*** 1157,1160 ****
--- 1159,1163 ----
if (strlen(rfile) > 0)
{
+ sprintf(curfile, "%s", rfile);
if (mode == 0) save_file_detailed(rfile);
if (mode == 1) save_file_simple(rfile);
Index: mapeditfileinput.cpp
===================================================================
RCS file: /cvsroot/qb2c/goengine/src/editor/mapeditfileinput.cpp,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** mapeditfileinput.cpp 20 Jan 2004 03:05:27 -0000 1.6
--- mapeditfileinput.cpp 8 Nov 2004 14:17:35 -0000 1.7
***************
*** 27,31 ****
char mapfile[100];
int c = 0;
!
sprintf(mapfile, "data/maps/%s.dtl", rfile);
--- 27,31 ----
char mapfile[100];
int c = 0;
!
sprintf(mapfile, "data/maps/%s.dtl", rfile);
***************
*** 40,45 ****
fclose(fp);
- if (c == 1) load_file_v1(rfile);
}
--- 40,46 ----
fclose(fp);
+ if (c == 1) load_file_v1(rfile);
+ if (c == 2) load_file_v2(rfile);
}
***************
*** 49,54 ****
FILE *fp;
char mapfile[100], tmp[100];
! int c, d, e;
sprintf(mapfile, "data/maps/%s.dtl", rfile);
--- 50,56 ----
FILE *fp;
char mapfile[100], tmp[100];
! int c, d, e, whitec = makecol(192, 192, 192);
+
sprintf(mapfile, "data/maps/%s.dtl", rfile);
***************
*** 64,69 ****
--- 66,92 ----
fprintf(fp, "plane_info\n");
+
+ int lx, ly, rx, ry, w, h;
+
+ h = 16+5;
+ w = 256;
+ lx = xcenter - w / 2;
+ ly = ycenter - h / 2;
+ rx = lx + w - 1;
+ ry = ly + h - 1;
+
+ win (0, lx, ly, rx + 6, ry);
+
+ sprintf(tmp, "Saving...");
+ textout(offscreen, font, tmp, lx + 2, ly + 2, whitec);
+
+ BITMAP *temppcx;
+
+ updscreen();
+ int greenc = makecol(0, 255, 0);
+
for (c = 0; c <= endplane; c++)
{
+ rectfill (screen, lx + 2, ly + 10, lx + 2 + (w - 5) * (float)c / endplane, ly + 18, greenc);
if (planeinfo[c].active) fprintf(fp, "1\n");
if (!planeinfo[c].active) fprintf(fp, "0\n");
***************
*** 96,128 ****
fprintf(fp, "%d\n", planeinfo[c].npolies);
! for (d = 0; d <= planeinfo[c].lastpoint; d++)
! {
! for (e = 0; e < 11; e++)
! {
! fprintf(fp, "%f\n", planeinfo[c].pointinfo[d][e]);
! }
! }
! for (d = 0; d <= planeinfo[c].lastpoly; d++)
! {
! for (e = 0; e < 10; e++)
! {
! fprintf(fp, "%d\n", planeinfo[c].polyinfo[d][e]);
! }
! for (e = 0; e < 6; e++)
{
! fprintf(fp, "%d\n", planeinfo[c].polyvtx[d][e]);
}
! e = 0;
! if (planeinfo[c].radiosity_setup[d] > 0) e = 1;
! fprintf(fp, "%d\n", e);
! if (planeinfo[c].radiosity_setup[d] > 0)
{
! sprintf(tmp, "data/maps/shadowmap/i%s_%d_%d.bmp", rfile, c, d);
! save_bmp(tmp, planeinfo[c].radiosity[d], pal);
}
! }
for (d = 0; d < lastlight; d++)
--- 119,162 ----
fprintf(fp, "%d\n", planeinfo[c].npolies);
! if (planeinfo[c].active) {
! for (d = 0; d <= planeinfo[c].lastpoint; d++)
{
! for (e = 0; e < 11; e++)
! {
! fprintf(fp, "%f\n", planeinfo[c].pointinfo[d][e]);
! }
}
! temppcx = create_system_bitmap((planeinfo[c].lastpoly + 1) * 16, 16);
! clear(temppcx);
! for (d = 0; d <= planeinfo[c].lastpoly; d++)
{
! for (e = 0; e < 10; e++)
! {
! fprintf(fp, "%d\n", planeinfo[c].polyinfo[d][e]);
! }
! for (e = 0; e < 6; e++)
! {
! fprintf(fp, "%d\n", planeinfo[c].polyvtx[d][e]);
! }
!
! e = 0;
! if (planeinfo[c].radiosity_setup[d] > 0) e = 1;
! fprintf(fp, "%d\n", e);
!
! if (planeinfo[c].radiosity_setup[d] > 0)
! {
! blit(planeinfo[c].radiosity[d], temppcx, 0, 0, d * 16, 0, 16, 16);
! }
!
}
! sprintf(tmp, "data/maps/shadowmap/i%s_%d.bmp", rfile, c);
! save_bmp(tmp, temppcx, pal);
!
! destroy_bitmap(temppcx);
!
! }
for (d = 0; d < lastlight; d++)
***************
*** 136,139 ****
--- 170,174 ----
}
+ sprintf(tmp, "data/maps/shadowmap/i%s.bmp", rfile);
fclose(fp);
}
Index: mapedit.cpp
===================================================================
RCS file: /cvsroot/qb2c/goengine/src/editor/mapedit.cpp,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -d -r1.15 -r1.16
*** mapedit.cpp 20 Jan 2004 17:39:23 -0000 1.15
--- mapedit.cpp 8 Nov 2004 14:17:35 -0000 1.16
***************
*** 103,108 ****
{
! short a, b, c, p;
if (key[KEY_G])
{
--- 103,136 ----
{
! short a, b, c, p;
!
! int i, j;
+ if (key[KEY_H])
+ {
+
+ for (i = 0; i <= endplane; i++)
+ {
+ if (planeinfo[i].active)
+ {
+ for (j = 0; j <= planeinfo[i].lastpoly; j++)
+ {
+ if (planeinfo[i].polyinfo[j][6] == 0)
+ {
+ //c = getpixel(planeinfo[i].radiosity[j], x, y);
+ //c = getpixel(textures[planeinfo[i].polyinfo[j][3]], x, y);
+ blit (textures[planeinfo[i].polyinfo[j][3]], planeinfo[i].radiosity[j], 0, 0, 0, 0, 16, 16);
+ }
+ }
+ }
+ }
+
+ }
+
+ if (key[KEY_TAB] && freeze < timer)
+ {
+ hud = !hud;
+ freeze = timer + .005 * fpsr;
+ }
if (key[KEY_G])
{
***************
*** 129,135 ****
gridbase = 0;
stp = 4;
! xzoomratio = float(480 / 2);
! yzoomratio = float(480 / 2);
!
bfc = FALSE;
--- 157,161 ----
gridbase = 0;
stp = 4;
!
bfc = FALSE;
***************
*** 143,147 ****
for (b = 0; b <= planeinfo[a].lastpoly; b++)
{
! if (planeinfo[a].polyinfo[b][6] == 0)
{
--- 169,173 ----
for (b = 0; b <= planeinfo[a].lastpoly; b++)
{
! if (planeinfo[a].polyinfo[b][6] == 0 && planeinfo[a].polyinfo[b][8] == 0)
{
***************
*** 187,191 ****
hlpoint = FALSE;
nselpoint = 0;
! hlplane = FALSE;
}
if (hlpoint)
--- 213,229 ----
hlpoint = FALSE;
nselpoint = 0;
! hlplane = FALSE;
! if (key[KEY_A])
! {
! nselpoly = 0;
! for (c = 0; c <= planeinfo[selplane].lastpoly; c++)
! {
! if (planeinfo[selplane].polyinfo[c][6] < 2)
! {
! selpoly[nselpoly] = c;
! nselpoly++;
! }
! }
! }
}
if (hlpoint)
***************
*** 218,222 ****
if (key[KEY_S])
{
! camrx = camrx - 1;
calcsteps();
setup_scene();
--- 256,260 ----
if (key[KEY_S])
{
! camrx = u(camrx - 2);
calcsteps();
setup_scene();
***************
*** 224,228 ****
if (key[KEY_F])
{
! camrx = camrx + 1;
calcsteps();
setup_scene();
--- 262,278 ----
if (key[KEY_F])
{
! camrx = u(camrx + 2);
! calcsteps();
! setup_scene();
! }
! if (key[KEY_Q])
! {
! camry = u(camry - 5);
! calcsteps();
! setup_scene();
! }
! if (key[KEY_T])
! {
! camry = u(camry + 5);
calcsteps();
setup_scene();
***************
*** 230,237 ****
! if (key[KEY_LEFT]) fightfocus[0] = fightfocus[0] - 1;
! if (key[KEY_RIGHT]) fightfocus[0] = fightfocus[0] + 1;
! if (key[KEY_UP]) fightfocus[2] = fightfocus[2] - 1;
! if (key[KEY_DOWN]) fightfocus[2] = fightfocus[2] + 1;
if (key[KEY_MINUS_PAD] && freeze < timer)
--- 280,314 ----
! float xnew = 0, znew = 0;
!
! if (key[KEY_LEFT])
! {
! xnew += cos(rad * (camry));
! znew += sin(rad * (camry));
!
! }
! if (key[KEY_RIGHT])
! {
! xnew += cos(rad * (camry - 180));
! znew += sin(rad * (camry - 180));
!
! }
!
! if (key[KEY_UP])
! {
! xnew += cos(rad * (camry-90));
! znew += sin(rad * (camry-90));
!
! }
! if (key[KEY_DOWN])
! {
! xnew += cos(rad * (camry+90));
! znew += sin(rad * (camry+90));
!
! }
!
!
! fightfocus[0] = fightfocus[0] - xnew;
! fightfocus[2] = fightfocus[2] + znew;
if (key[KEY_MINUS_PAD] && freeze < timer)
***************
*** 495,499 ****
rotate_plane(selplane);
! }
}
--- 572,578 ----
rotate_plane(selplane);
! }
!
!
}
***************
*** 556,560 ****
float nx, ny, nz, sx, sy, sz, x, y, z;
!
sprintf(fpstext, "%d fps", FPS);
sprintf(vistext, "%d vis polys", vispolys);
--- 635,640 ----
float nx, ny, nz, sx, sy, sz, x, y, z;
!
!
sprintf(fpstext, "%d fps", FPS);
sprintf(vistext, "%d vis polys", vispolys);
***************
*** 667,671 ****
{
ofs = 6+7*8+5+4*8;
! win(0, xres - 192 -140, ofs, xres - 192 - 1, ofs+5+(1+4*nselpoint)*8);
sprintf(tmptxt, "Sel Points");
textout(offscreen, font, tmptxt, xres-192 + 4 -140, ofs+2, whitec);
--- 747,751 ----
{
ofs = 6+7*8+5+4*8;
! win(0, xres - 192 -140, ofs, xres - 192 - 1, ofs+5+(1+5*nselpoint)*8);
sprintf(tmptxt, "Sel Points");
textout(offscreen, font, tmptxt, xres-192 + 4 -140, ofs+2, whitec);
***************
*** 673,681 ****
{
sprintf(tmptxt, "%d:X %f", c,selpoint[c][0]);
! textout(offscreen, font, tmptxt, xres-192 + 4 -140, ofs+2+(1+4*c+0)*8, whitec);
sprintf(tmptxt, " Y %f", selpoint[c][1]);
! textout(offscreen, font, tmptxt, xres-192 + 4 -140, ofs+2+(1+4*c+1)*8, whitec);
sprintf(tmptxt, " Z %f", selpoint[c][2]);
! textout(offscreen, font, tmptxt, xres-192 + 4 -140, ofs+2+(1+4*c+2)*8, whitec);
}
}
--- 753,763 ----
{
sprintf(tmptxt, "%d:X %f", c,selpoint[c][0]);
! textout(offscreen, font, tmptxt, xres-192 + 4 -140, ofs+2+(1+5*c+0)*8, whitec);
sprintf(tmptxt, " Y %f", selpoint[c][1]);
! textout(offscreen, font, tmptxt, xres-192 + 4 -140, ofs+2+(1+5*c+1)*8, whitec);
sprintf(tmptxt, " Z %f", selpoint[c][2]);
! textout(offscreen, font, tmptxt, xres-192 + 4 -140, ofs+2+(1+5*c+2)*8, whitec);
! sprintf(tmptxt, " P %f", selpoint[c][3]);
! textout(offscreen, font, tmptxt, xres-192 + 4 -140, ofs+2+(1+5*c+3)*8, whitec);
}
}
***************
*** 1552,1563 ****
for (a = 0; a <= endplane; a++)
{
! if (editingmode != select_point || (editingmode == select_point && a == selplane))
{
! for (c = 0; c <= planeinfo[a].lastpoint; c++)
!
! 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)
!
{
p = short(planeinfo[a].pointinfo[c][6]);
--- 1634,1641 ----
for (a = 0; a <= endplane; a++)
{
! if (planeinfo[a].active && editingmode != select_point || (editingmode == select_point && planeinfo[a].active && a == selplane))
{
! for (c = 0; c <= planeinfo[a].lastpoint; c++)
{
p = short(planeinfo[a].pointinfo[c][6]);
***************
*** 1570,1578 ****
if (mouse_b & 1 && freeze < timer)
{
p = 0;
if (editingmode == select_point)
{
for (b = 0; b < nselpoint; b++)
! {
if (selpoint[b][3] == -1 && checktolerance(selpoint[b][0], selpoint[b][1], selpoint[b][2], planeinfo[a].pointinfo[c][3] + planeinfo[a].basex, planeinfo[a].pointinfo[c][4] + planeinfo[a].basey, planeinfo[a].pointinfo[c][5] + planeinfo[a].basez))
{
--- 1648,1657 ----
if (mouse_b & 1 && freeze < timer)
{
+
p = 0;
if (editingmode == select_point)
{
for (b = 0; b < nselpoint; b++)
! {
if (selpoint[b][3] == -1 && checktolerance(selpoint[b][0], selpoint[b][1], selpoint[b][2], planeinfo[a].pointinfo[c][3] + planeinfo[a].basex, planeinfo[a].pointinfo[c][4] + planeinfo[a].basey, planeinfo[a].pointinfo[c][5] + planeinfo[a].basez))
{
***************
*** 1585,1607 ****
}
}
! if (p != -1)
{
selpoint[nselpoint][0] = planeinfo[a].pointinfo[c][3] + planeinfo[a].basex;
selpoint[nselpoint][1] = planeinfo[a].pointinfo[c][4] + planeinfo[a].basey;
selpoint[nselpoint][2] = planeinfo[a].pointinfo[c][5] + planeinfo[a].basez;
! selpoint[nselpoint][3] = c;
! nselpoint++;
! clicked = 1;
! freeze = timer + .002 * fpsr;
if (!key[KEY_SPACE] && nselpoint > 1)
{
! selpoint[0][0] = selpoint[nselpoint-1][0];
! selpoint[0][1] = selpoint[nselpoint-1][1];
! selpoint[0][2] = selpoint[nselpoint-1][2];
! selpoint[0][3] = c;
! nselpoint = 1;
}
}
}
--- 1664,1689 ----
}
}
! if (p == 0)
{
selpoint[nselpoint][0] = planeinfo[a].pointinfo[c][3] + planeinfo[a].basex;
selpoint[nselpoint][1] = planeinfo[a].pointinfo[c][4] + planeinfo[a].basey;
selpoint[nselpoint][2] = planeinfo[a].pointinfo[c][5] + planeinfo[a].basez;
+ selpoint[nselpoint][3] = -1;
! if (a == selplane) selpoint[nselpoint][3] = c;
if (!key[KEY_SPACE] && nselpoint > 1)
{
! selpoint[0][0] = selpoint[nselpoint][0];
! selpoint[0][1] = selpoint[nselpoint][1];
! selpoint[0][2] = selpoint[nselpoint][2];
! selpoint[0][3] = selpoint[nselpoint][3];
! nselpoint = 0;
}
+
+ nselpoint++;
+ clicked = 1;
+ freeze = timer + .002 * fpsr;
+
}
}
***************
*** 1651,1660 ****
}
- p = short(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);
-
}
surroundbox(1, farleft, fartop, farright, farbottom);
--- 1733,1736 ----
***************
*** 1691,1695 ****
for (a = 0; a <= planeinfo[selplane].lastpoint; a++)
{
! if (planeinfo[selplane].pointinfo[c][7] == 0 && checktolerance(planeinfo[selplane].pointinfo[a][0], planeinfo[selplane].pointinfo[a][1], planeinfo[selplane].pointinfo[a][2], x, y, z))
{
planeinfo[tselplane].pointinfo[c][7] = 1;
--- 1767,1771 ----
for (a = 0; a <= planeinfo[selplane].lastpoint; a++)
{
! if (planeinfo[selplane].pointinfo[a][7] == 0 && checktolerance(planeinfo[selplane].pointinfo[a][0], planeinfo[selplane].pointinfo[a][1], planeinfo[selplane].pointinfo[a][2], x, y, z))
{
planeinfo[tselplane].pointinfo[c][7] = 1;
***************
*** 1804,1810 ****
c = lights[a][1];
! nx = -lightinfo[c].strength;
ny = 0;
! nz = 0;
sx = nx * prexx + ny * preyx + nz * prezx + pointinfo[p].psx - vdist;
--- 1880,1886 ----
c = lights[a][1];
! nx = -lightinfo[c].strength * cos(rad * (camry));
ny = 0;
! nz = lightinfo[c].strength * sin(rad * (camry));
sx = nx * prexx + ny * preyx + nz * prezx + pointinfo[p].psx - vdist;
***************
*** 1821,1826 ****
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);
}
--- 1897,1902 ----
x = abs(int(pointinfo[p].x) - fx);
! circle (offscreen, pointinfo[p].x, pointinfo[p].y, clearance, orangec);
! circle (offscreen, pointinfo[p].x, pointinfo[p].y, x, makecol(lightinfo[c].lightr, lightinfo[c].lightg, lightinfo[c].lightb));
}
***************
*** 2358,2363 ****
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);
--- 2434,2439 ----
void drawpolys()
{
! int i, poly, p1, p2, p3, t, a, x, y, bluec = makecol(0,0,192), redc = makecol(192,0,0), cgrey = makecol(128,128, 128);
! int greyc = makecol(96, 96, 96), whitec = makecol(192,192,192), greenc = makecol(0,192,0), yellowc = makecol(224, 224, 32), orangec = makecol(244, 196, 32);
short u[3], v[3];
int trans = makecol(255, 0, 255);
***************
*** 2374,2378 ****
short clearance, clicked = 0;
clearance = 2 * xres / 320;
!
for (c = 0; c < pointinfo.size(); c++)
--- 2450,2454 ----
short clearance, clicked = 0;
clearance = 2 * xres / 320;
!
for (c = 0; c < pointinfo.size(); c++)
***************
*** 2382,2388 ****
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);
}
}
--- 2458,2464 ----
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);
}
}
***************
*** 2493,2497 ****
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);
--- 2569,2574 ----
if (hlplane && tselplane == polyinfo[poly].plane) color = bluec;
if (planeinfo[polyinfo[poly].plane].polyinfo[polyinfo[poly].poly][6] == 1) color = greenc;
! if (polyinfo[poly].plane == selplane) color = yellowc;
! if (polyinfo[poly].plane == selplane && planeinfo[selplane].polyinfo[polyinfo[poly].poly][7] == 1) color = orangec;
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);
***************
*** 2527,2533 ****
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);
clear_to_color(texturesb, trans);
--- 2604,2620 ----
if (planeinfo[polyinfo[poly].plane].polyinfo[polyinfo[poly].poly][6] == 0 && planeinfo[polyinfo[poly].plane].polyinfo[polyinfo[poly].poly][8] == 0)
{
! int color;
! clear_to_color(texturesb, trans);
! blit(planeinfo[polyinfo[poly].plane].radiosity[polyinfo[poly].poly], texturesb, 0, 0, 0, 0, 16, 16);
! for (x = 0; x < 16; x++)
! {
! for (y = 0; y < 16; y++)
! {
! color = getpixel(textures[t], x, y);
! if (color == trans) putpixel(texturesb, x, y, trans);
! }
! }
! triangle3d_f(offscreen, POLYTYPE_PTEX_MASK, texturesb, &v1, &v2, &v3);
clear_to_color(texturesb, trans);
***************
*** 2757,2760 ****
--- 2844,2852 ----
char tmp[100];
+ ambientr = lightinfo[0].lightr * .1;
+ ambientg = lightinfo[0].lightg * .1;
+ ambientb = lightinfo[0].lightb * .1;
+
+
if (nlights == 0)
{
***************
*** 2781,2784 ****
--- 2873,2879 ----
}
+ clear_to_color(screen, cgrey);
+
+
for (i = 0; i <= endplane; i++)
{
***************
*** 2796,2799 ****
--- 2891,2906 ----
lightb = lightinfo[p].lightb;
+ lightres = yres;
+
+ xzoomratio = float(lightres / 2.6);
+ yzoomratio = float(lightres / 2.6);
+
+
+ for (i = 0; i < 5; i++)
+ {
+ d3buffer[i] = create_system_bitmap(lightres, lightres);
+ clear_to_color(d3buffer[i], cgrey);
+ }
+
fightfocus[0] = planeinfo[pointinfo[c].plane].pointinfo[pointinfo[c].point][0] + planeinfo[pointinfo[c].plane].basex;
fightfocus[1] = planeinfo[pointinfo[c].plane].pointinfo[pointinfo[c].point][1] + planeinfo[pointinfo[c].plane].basey;
***************
*** 2842,2845 ****
--- 2949,2953 ----
camrz = zr;
+
clear_to_color(offscreen, cgrey);
clear_to_color(d3buffer[0], cgrey);
***************
*** 2860,2864 ****
sy = pointinfo[p1].psy - vdist;
sz = pointinfo[p1].psz - vdist;
!
ax = pointinfo[p2].psx - vdist - sx;
ay = pointinfo[p2].psy - vdist - sy;
--- 2968,2972 ----
sy = pointinfo[p1].psy - vdist;
sz = pointinfo[p1].psz - vdist;
!
ax = pointinfo[p2].psx - vdist - sx;
ay = pointinfo[p2].psy - vdist - sy;
***************
*** 2888,2894 ****
focusstep = 1;
! for (x = 0; x < 600 - focusstep; x+= focusstep)
{
! for (y = 0; y < 600 - focusstep; y+= focusstep)
{
if (getpixel(d3buffer[0], x, y) < cgrey)
--- 2996,3002 ----
focusstep = 1;
! for (x = 0; x < lightres; x++)
{
! for (y = 0; y < lightres; y++)
{
if (getpixel(d3buffer[0], x, y) < cgrey)
***************
*** 2912,2915 ****
--- 3020,3025 ----
zz = getpixel(d3buffer[4], x, y) - vdist;
+ dist = sqrt(xx * xx + yy * yy + zz * zz);
+
v = 1;
***************
*** 2966,2976 ****
sz = pointinfo[p1].psz - vdist;
! ax = pointinfo[p2].psx - vdist - sx + polyinfo[pl].nx * c2 * 4;
! ay = pointinfo[p2].psy - vdist - sy + polyinfo[pl].ny * c2 * 4;
! az = pointinfo[p2].psz - vdist - sz + polyinfo[pl].nz * c2 * 4;
! bx = pointinfo[p3].psx - vdist - sx + polyinfo[pl].nx * c3 * 4;
! by = pointinfo[p3].psy - vdist - sy + polyinfo[pl].ny * c3 * 4;
! bz = pointinfo[p3].psz - vdist - sz + polyinfo[pl].nz * c3 * 4;
--- 3076,3086 ----
sz = pointinfo[p1].psz - vdist;
! ax = pointinfo[p2].psx - vdist - sx + polyinfo[pl].nx * c2 * 6;
! ay = pointinfo[p2].psy - vdist - sy + polyinfo[pl].ny * c2 * 6;
! az = pointinfo[p2].psz - vdist - sz + polyinfo[pl].nz * c2 * 6;
! bx = pointinfo[p3].psx - vdist - sx + polyinfo[pl].nx * c3 * 6;
! by = pointinfo[p3].psy - vdist - sy + polyinfo[pl].ny * c3 * 6;
! bz = pointinfo[p3].psz - vdist - sz + polyinfo[pl].nz * c3 * 6;
***************
*** 3016,3028 ****
if (v < 0) v = 0;
! if (v > 1) v = 1;
!
! dist = sqrt(xx * xx + yy * yy + zz * zz);
!
if (dist < 0) dist = 0;
if (dist > strength) dist = strength;
!
! intense = v * (strength - dist) / strength * sgamma;
!
if (intense > 1) intense = 1;
if (intense < 0) intense = 0;
--- 3126,3138 ----
if (v < 0) v = 0;
! if (v > 1) v = 1;
!
if (dist < 0) dist = 0;
if (dist > strength) dist = strength;
!
!
! intense = v * (strength - dist) / strength;
!
!
if (intense > 1) intense = 1;
if (intense < 0) intense = 0;
***************
*** 3055,3067 ****
! blit(offscreen, screen, 0, 0, 0, 0, SCREEN_W, SCREEN_H);
! //blit(d3buffer[2], screen, 0, 0, 0, 0, SCREEN_W, SCREEN_H);
! clear_to_color(offscreen, cgrey);
! for (i = 0; i < 5; i++)
! {
! clear_to_color(d3buffer[i], cgrey);
! }
}
}
--- 3165,3178 ----
! blit(offscreen, screen, 0, 0, 0, 0, lightres, lightres);
! clear_to_color(offscreen, cgrey);
}
+
+ for (i = 0; i < 5; i++)
+ {
+ destroy_bitmap(d3buffer[i]);
+ }
+
}
***************
*** 3091,3095 ****
old_r = getr(color);
old_g = getg(color);
! old_b = getb(color);
p = 0;
--- 3202,3206 ----
old_r = getr(color);
old_g = getg(color);
! old_b = getb(color);
p = 0;
***************
*** 3138,3144 ****
}
- ambientr = 48;
- ambientg = 0;
- ambientb = 0;
for (i = 0; i <= endplane; i++)
--- 3249,3252 ----
***************
*** 3178,3181 ****
--- 3286,3290 ----
nb = 255;
}
+
putpixel(planeinfo[i].radiosity[j], x, y, makecol(nr, ng, nb));
}
***************
*** 3184,3188 ****
}
! }
}
--- 3293,3298 ----
}
! }
!
}
***************
*** 3232,3240 ****
mapz = 50;
! camz = 126;
! camrx = 54;
hud = TRUE;
!
ret = install_mouse();
--- 3342,3351 ----
mapz = 50;
! camy = 3.5;
! camz = 114;
! camrx = 40;
hud = TRUE;
!
ret = install_mouse();
***************
*** 3356,3365 ****
- for (x = 0; x < 5; x++)
- {
- d3buffer[x] = create_system_bitmap(600, 600);
- }
-
-
texturesb = create_system_bitmap(16,16);
texturesc = create_system_bitmap(16,16);
--- 3467,3470 ----
***************
*** 3368,3372 ****
for (x = 0; x < 16; x++)
{
! c = y * 16 + x;
putpixel(texturesc, x, y, c);
}
--- 3473,3477 ----
for (x = 0; x < 16; x++)
{
! c = y * 16 + x;
putpixel(texturesc, x, y, c);
}
***************
*** 3474,3477 ****
--- 3579,3585 ----
planeinfo[planenum].pointinfo[point][5] = nz;
planeinfo[planenum].pointinfo[point][7] = 0;
+ planeinfo[planenum].pointinfo[point][8] = 0;
+ planeinfo[planenum].pointinfo[point][9] = 0;
+ planeinfo[planenum].pointinfo[point][10] = 0;
if (point > planeinfo[planenum].lastpoint) planeinfo[planenum].lastpoint = point;
***************
*** 3498,3501 ****
--- 3606,3612 ----
planeinfo[planenum].polyvtx[poly][4] = vtx[0][4];
planeinfo[planenum].polyvtx[poly][5] = vtx[0][5];
+ planeinfo[planenum].polyinfo[poly][7] = 0;
+ planeinfo[planenum].polyinfo[poly][8] = 0;
+ planeinfo[planenum].polyinfo[poly][9] = 0;
if (planeinfo[planenum].radiosity_setup[poly] == 2) planeinfo[planenum].radiosity_setup[poly] = 1;
***************
*** 3513,3516 ****
--- 3624,3630 ----
planeinfo[planenum].polyvtx[poly][4] = vtx[1][4];
planeinfo[planenum].polyvtx[poly][5] = vtx[1][5];
+ planeinfo[planenum].polyinfo[poly][7] = 0;
+ planeinfo[planenum].polyinfo[poly][8] = 0;
+ planeinfo[planenum].polyinfo[poly][9] = 0;
if (planeinfo[planenum].radiosity_setup[poly] == 2) planeinfo[planenum].radiosity_setup[poly] = 1;
***************
*** 3570,3573 ****
--- 3684,3688 ----
tpoint.plane = c;
tpoint.point = a;
+ tpoint.active = TRUE;
planeinfo[c].pointinfo[a][6] = pointinfo.size();
***************
*** 3582,3585 ****
--- 3697,3701 ----
lights[nlights][1] = lightnum;
nlights++;
+ if (lightnum > lastlight -1) lastlight = lightnum + 1;
}
***************
*** 3612,3617 ****
planeinfo[c].radiosity[a] = create_system_bitmap(16,16);
}
if (planeinfo[c].radiosity_setup[a] == 1)
! {
planeinfo[c].radiosity_setup[a] = 2;
for (x = 0; x < 16; x++)
--- 3728,3735 ----
planeinfo[c].radiosity[a] = create_system_bitmap(16,16);
}
+
+
if (planeinfo[c].radiosity_setup[a] == 1)
! {
planeinfo[c].radiosity_setup[a] = 2;
for (x = 0; x < 16; x++)
***************
*** 3621,3625 ****
putpixel(planeinfo[c].radiosity[a], x, y, 0);
}
! }
blit(textures[tpoly.tx], planeinfo[c].radiosity[a], 0, 0, 0, 0, 16, 16);
}
--- 3739,3743 ----
putpixel(planeinfo[c].radiosity[a], x, y, 0);
}
! }
blit(textures[tpoly.tx], planeinfo[c].radiosity[a], 0, 0, 0, 0, 16, 16);
}
Index: mapeditglobals.h
===================================================================
RCS file: /cvsroot/qb2c/goengine/src/editor/mapeditglobals.h,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** mapeditglobals.h 20 Jan 2004 17:39:23 -0000 1.7
--- mapeditglobals.h 8 Nov 2004 14:17:35 -0000 1.8
***************
*** 84,89 ****
#define max_planes 200
! #define max_polies 1000
! #define max_points 1000
#define max_lights 200
--- 84,89 ----
#define max_planes 200
! #define max_polies 2200
! #define max_points 2000
#define max_lights 200
***************
*** 100,104 ****
! extern short fillmode;
extern short npcs, walkdir;
--- 100,104 ----
! extern int fillmode;
extern short npcs, walkdir;
Index: mapeditglobals.cpp
===================================================================
RCS file: /cvsroot/qb2c/goengine/src/editor/mapeditglobals.cpp,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** mapeditglobals.cpp 20 Jan 2004 17:39:23 -0000 1.7
--- mapeditglobals.cpp 8 Nov 2004 14:17:35 -0000 1.8
***************
*** 25,29 ****
! short fillmode;
short npcs, walkdir;
--- 25,29 ----
! int fillmode;
short npcs, walkdir;
|