qb2c-cvs Mailing List for 3D QB to C
Brought to you by:
b_lindeijer,
syn9
You can subscribe to this list here.
| 2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(63) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2004 |
Jan
(40) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(11) |
Dec
(4) |
|
From: Daniel K. <sy...@us...> - 2004-12-24 23:13:43
|
Update of /cvsroot/qb2c/goengine In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9309 Modified Files: .cvsignore HISTORY Log Message: - now textures are 32x32 pixels instead of 16x16. - fixed light poly bug - added New in system menu, as well as rearranged the options. they are now: New, Save, Load, Import, Preferences - can hide light circles now - now supports multiple texture files. changes have been made to modify/poly/texture Index: .cvsignore =================================================================== RCS file: /cvsroot/qb2c/goengine/.cvsignore,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** .cvsignore 19 Dec 2003 11:47:07 -0000 1.2 --- .cvsignore 24 Dec 2004 23:13:03 -0000 1.3 *************** *** 1,2 **** --- 1,35 ---- goengine gomapedit + cam.dat + data + Debug + game_build + Release + src + .cvsignore + alld40.dll + alleg40.dll + AUTHORS + CVS + COPYING + credits.txt + goengine.dsp + goengine.dsw + goengine.exe + goengine.ilk + goengine.ncb + goengine.opt + goengine.plg + HISTORY + Makefile + mapedit.dsp + mapedit.dsw + mapedit.exe + mapedit.ncb + mapedit.opt + mapedit.plg + MSVCRTD.DLL + shot.bmp + TODO + trigedit.exe + trigger_type.txt \ No newline at end of file Index: HISTORY =================================================================== RCS file: /cvsroot/qb2c/goengine/HISTORY,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** HISTORY 20 Jan 2004 17:14:06 -0000 1.4 --- HISTORY 24 Dec 2004 23:13:03 -0000 1.5 *************** *** 1,2 **** --- 1,19 ---- + 24 DEC 04 + - now textures are 32x32 pixels instead of 16x16. + - fixed light poly bug + - added New in system menu, as well as rearranged the options. they are now: + New, Save, Load, Import, Preferences + - can hide light circles now + - now supports multiple texture files. changes have been made to modify/poly/texture + + 14 NOV 04 + Syn9 + - Can change brightness of polies [selpoly][modify/poly/brightness/+ or -] + - Can reset the textures on individual polies [selpoly/h]. unselect all polies and hit h to reset all textures + - Q/T rotates the view on the Y axis + - no more detailed/simple in save menu, will always save detailed + - can set trigger to 3 for a scrolling tile, will scroll the character from bottom of plane to top + - added new escalator tile + Jan 20 Bjorn: |
|
From: Daniel K. <sy...@us...> - 2004-12-24 23:13:29
|
Update of /cvsroot/qb2c/goengine/src/engine In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9309/src/engine Modified Files: engineglobals.cpp engineglobals.h fileinput.cpp fileinput.h render.cpp Log Message: - now textures are 32x32 pixels instead of 16x16. - fixed light poly bug - added New in system menu, as well as rearranged the options. they are now: New, Save, Load, Import, Preferences - can hide light circles now - now supports multiple texture files. changes have been made to modify/poly/texture Index: engineglobals.h =================================================================== RCS file: /cvsroot/qb2c/goengine/src/engine/engineglobals.h,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** engineglobals.h 8 Nov 2004 16:28:27 -0000 1.7 --- engineglobals.h 24 Dec 2004 23:13:06 -0000 1.8 *************** *** 33,36 **** --- 33,38 ---- #define max_points 2000 #define max_lights 200 + #define max_polies_per_plane 400 + #define max_points_per_plane 400 #include <allegro.h> *************** *** 67,79 **** float basex, basey, basez, xrot, yrot, zrot, endx, endy, endz, height, rbx, rby, rbz; short rows, cols, lastpoint, lastpoly, npoints, npolies; ! float pointinfo[max_points][12]; //base x, y, z, rotated x, y, z, global point index, active, copy point, light > 0 = light # - 1, light on/off, shown ! short polyinfo[max_polies][11]; //p1, p2, p3, tx, [not used], global poly index, active, clipped, trigger, alpha, shown ! short polyvtx[max_polies][6]; //u123,v123 ! BITMAP *radiosity[max_polies]; ! short radiosity_setup[max_polies]; ! bool radiosity_index[max_polies][16][16]; }; --- 69,81 ---- float basex, basey, basez, xrot, yrot, zrot, endx, endy, endz, height, rbx, rby, rbz; short rows, cols, lastpoint, lastpoly, npoints, npolies; ! float pointinfo[max_points_per_plane][12]; //base x, y, z, rotated x, y, z, global point index, active, copy point, light > 0 = light # - 1, light on/off, shown ! short polyinfo[max_polies_per_plane][11]; //p1, p2, p3, tx, [not used], global poly index, active, clipped, trigger, alpha, shown ! short polyvtx[max_polies_per_plane][6]; //u123,v123 ! BITMAP *radiosity[max_polies_per_plane]; ! short radiosity_setup[max_polies_per_plane]; ! bool radiosity_index[max_polies_per_plane][32][32]; }; *************** *** 138,142 **** extern float fightfocus[3], focusofs[3]; ! extern BITMAP *textures[300]; extern BITMAP *sprites[128]; extern BITMAP *offscreen, *temp, *temp2; --- 140,144 ---- extern float fightfocus[3], focusofs[3]; ! extern BITMAP *textures[620]; extern BITMAP *sprites[128]; extern BITMAP *offscreen, *temp, *temp2; Index: fileinput.cpp =================================================================== RCS file: /cvsroot/qb2c/goengine/src/engine/fileinput.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** fileinput.cpp 8 Nov 2004 16:28:27 -0000 1.9 --- fileinput.cpp 24 Dec 2004 23:13:06 -0000 1.10 *************** *** 19,23 **** { FILE *fp; ! int c = 0, d, e, whitec = makecol(192, 192, 192); char tmp[100]; --- 19,23 ---- { FILE *fp; ! int c = 0, d, e, whitec = makecol(192, 192, 192), totalpolies; char tmp[100]; *************** *** 61,64 **** --- 61,66 ---- + totalpolies = 0; + for (c = 0; c <= endplane; c++) { *************** *** 102,105 **** --- 104,109 ---- fscanf(fp, "%hd", &planeinfo[c].npolies); + totalpolies = totalpolies + planeinfo[c].npolies; + if (planeinfo[c].active) { *************** *** 125,128 **** --- 129,133 ---- { fscanf(fp, "%d", &planeinfo[c].polyvtx[d][e]); + if (planeinfo[c].polyvtx[d][e] == 15) planeinfo[c].polyvtx[d][e] = 31; } *************** *** 133,138 **** //temppcx = load_bmp(tmp, pal); ! if (planeinfo[c].radiosity_setup[d] == 0) planeinfo[c].radiosity[d] = create_system_bitmap(16, 16); ! blit (temppcx, planeinfo[c].radiosity[d], d * 16, 0, 0, 0, 16, 16); planeinfo[c].radiosity_setup[d] = 2; --- 138,147 ---- //temppcx = load_bmp(tmp, pal); ! if (planeinfo[c].radiosity_setup[d] == 0) ! { ! planeinfo[c].radiosity[d] = create_system_bitmap(32, 32); ! planeinfo[c].radiosity_setup[d] = 1; ! } ! blit (temppcx, planeinfo[c].radiosity[d], d * 32, 0, 0, 0, 32, 32); planeinfo[c].radiosity_setup[d] = 2; *************** *** 173,176 **** --- 182,186 ---- drawing_mode(DRAW_MODE_SOLID, NULL, 0, 0); + } *************** *** 284,287 **** --- 294,298 ---- { fscanf(fp, "%d", &planeinfo[c].polyvtx[d][e]); + if (planeinfo[c].polyvtx[d][e] == 15) planeinfo[c].polyvtx[d][e] = 31; } *************** *** 295,299 **** if (planeinfo[c].radiosity_setup[d] == 0) { ! planeinfo[c].radiosity[d] = create_system_bitmap(16, 16); planeinfo[c].radiosity_setup[d] = 1; //rectfill (planeinfo[c].radiosity[d], 0, 0, 15, 15, -1); --- 306,310 ---- if (planeinfo[c].radiosity_setup[d] == 0) { ! planeinfo[c].radiosity[d] = create_system_bitmap(32, 32); planeinfo[c].radiosity_setup[d] = 1; //rectfill (planeinfo[c].radiosity[d], 0, 0, 15, 15, -1); *************** *** 350,488 **** } - void load_file_v1_simple(char* rfile) - { - FILE *fp; - char mapfile[100]; - int c = 0, d, e; - char tmp[100]; - - BITMAP *temppcx; - - sprintf(mapfile, "data/maps/%s.smp", rfile); - - fp = fopen(mapfile, "r"); - - fscanf(fp, "%d", &c); - - fscanf(fp, "%s", &tmp); - fscanf(fp, "%d", &endplane); - fscanf(fp, "%d", &lastlight); - - fscanf(fp, "%s", &tmp); - - int lx, ly, rx, ry, w, h; - - h = ycenter / 5; - w = xcenter / 2; - lx = xcenter - w / 2; - ly = ycenter - h / 2; - rx = lx + w - 1; - ry = ly + h - 1; - - win (0, lx, ly, rx + 6, ry); - - updscreen(); - int greenc = makecol(0, 255, 0); - - for (c = 0; c <= endplane; c++) - { - rectfill (screen, lx + 4, ly + 4, lx + 4 + (w - 8) * (float)c / endplane, ly + h - 4, greenc); - fscanf(fp, "%d", &d); - if (d == 1) planeinfo[c].active = TRUE; - if (d == 0) planeinfo[c].active = FALSE; - - fscanf(fp, "%d", &d); - if (d == 1) planeinfo[c].condensed = TRUE; - if (d == 0) planeinfo[c].condensed = FALSE; - - if (planeinfo[c].active) - { - - fscanf(fp, "%f", &planeinfo[c].basex); - fscanf(fp, "%f", &planeinfo[c].basey); - fscanf(fp, "%f", &planeinfo[c].basez); - - fscanf(fp, "%f", &planeinfo[c].xrot); - fscanf(fp, "%f", &planeinfo[c].yrot); - fscanf(fp, "%f", &planeinfo[c].zrot); - - fscanf(fp, "%f", &planeinfo[c].endx); - fscanf(fp, "%f", &planeinfo[c].endy); - fscanf(fp, "%f", &planeinfo[c].endz); - - fscanf(fp, "%f", &planeinfo[c].height); - - fscanf(fp, "%f", &planeinfo[c].rbx); - fscanf(fp, "%f", &planeinfo[c].rby); - fscanf(fp, "%f", &planeinfo[c].rbz); - - fscanf(fp, "%d", &planeinfo[c].rows); - fscanf(fp, "%d", &planeinfo[c].cols); - fscanf(fp, "%d", &planeinfo[c].lastpoint); - fscanf(fp, "%d", &planeinfo[c].lastpoly); - fscanf(fp, "%d", &planeinfo[c].npoints); - fscanf(fp, "%d", &planeinfo[c].npolies); - - for (d = 0; d <= planeinfo[c].lastpoint; d++) - { - fscanf(fp, "%f", &planeinfo[c].pointinfo[d][7]); - if (planeinfo[c].pointinfo[d][7] == 0) - { - for (e = 0; e < 11; e++) - { - fscanf(fp, "%f", &planeinfo[c].pointinfo[d][e]); - } - } - } - - sprintf(tmp, "data/maps/shadowmap/i%s_%d.bmp", rfile, c); - temppcx = load_bmp(tmp, pal); - - for (d = 0; d <= planeinfo[c].lastpoly; d++) - { - fscanf(fp, "%d", &planeinfo[c].polyinfo[d][6]); - if (planeinfo[c].polyinfo[d][6] < 2) - { - for (e = 0; e < 10; e++) - { - fscanf(fp, "%d", &planeinfo[c].polyinfo[d][e]); - } - for (e = 0; e < 6; e++) - { - fscanf(fp, "%d", &planeinfo[c].polyvtx[d][e]); - } - - fscanf(fp, "%d", &e); - if (e == 1) - { - //sprintf(tmp, "data/maps/shadowmap2/i%s_%d_%d.bmp", rfile, c, d); - //temppcx = load_bmp(tmp, pal); - - if (planeinfo[c].radiosity_setup[d] == 0) planeinfo[c].radiosity[d] = create_system_bitmap(16, 16); - blit (temppcx, planeinfo[c].radiosity[d], d * 16, 0, 0, 0, 16, 16); - - planeinfo[c].radiosity_setup[d] = 2; - } - } - } - destroy_bitmap(temppcx); - - } - - for (d = 0; d < lastlight; d++) - { - fscanf(fp, "%f", &lightinfo[d].strength); - fscanf(fp, "%hd", &lightinfo[d].lightr); - fscanf(fp, "%hd", &lightinfo[d].lightg); - fscanf(fp, "%hd", &lightinfo[d].lightb); - } - - } - - fclose(fp); - - updscreen(); - - } - - --- 361,362 ---- Index: render.cpp =================================================================== RCS file: /cvsroot/qb2c/goengine/src/engine/render.cpp,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** render.cpp 8 Nov 2004 16:28:27 -0000 1.17 --- render.cpp 24 Dec 2004 23:13:06 -0000 1.18 *************** *** 330,335 **** exit(1); } ! for (i = 0; i < 300; i++) { ! textures[i] = create_system_bitmap(16, 16); if (!textures[i]) { printf("Error while allocating bitmaps!\n"); --- 330,335 ---- exit(1); } ! for (i = 0; i < 600; i++) { ! textures[i] = create_system_bitmap(32, 32); if (!textures[i]) { printf("Error while allocating bitmaps!\n"); *************** *** 350,354 **** scrny = short(-12 * xres / 320); - } --- 350,353 ---- *************** *** 356,360 **** { remove_keyboard(); ! allegro_exit(); } --- 355,359 ---- { remove_keyboard(); ! allegro_exit(); } Index: engineglobals.cpp =================================================================== RCS file: /cvsroot/qb2c/goengine/src/engine/engineglobals.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** engineglobals.cpp 8 Nov 2004 16:28:27 -0000 1.7 --- engineglobals.cpp 24 Dec 2004 23:13:06 -0000 1.8 *************** *** 70,74 **** float fightfocus[3], focusofs[3]; ! BITMAP *textures[300]; BITMAP *sprites[128]; BITMAP *offscreen, *temp, *temp2; --- 70,74 ---- float fightfocus[3], focusofs[3]; ! BITMAP *textures[620]; BITMAP *sprites[128]; BITMAP *offscreen, *temp, *temp2; Index: fileinput.h =================================================================== RCS file: /cvsroot/qb2c/goengine/src/engine/fileinput.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** fileinput.h 8 Nov 2004 14:17:36 -0000 1.4 --- fileinput.h 24 Dec 2004 23:13:06 -0000 1.5 *************** *** 17,21 **** void load_file_v2(char* rfile); - void load_file_v1_simple(char* rfile); #endif --- 17,20 ---- |
|
From: Daniel K. <sy...@us...> - 2004-12-24 23:13:29
|
Update of /cvsroot/qb2c/goengine/src/game In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9309/src/game Modified Files: game.cpp gameglobals.cpp gameglobals.h goengine.cpp Log Message: - now textures are 32x32 pixels instead of 16x16. - fixed light poly bug - added New in system menu, as well as rearranged the options. they are now: New, Save, Load, Import, Preferences - can hide light circles now - now supports multiple texture files. changes have been made to modify/poly/texture Index: gameglobals.cpp =================================================================== RCS file: /cvsroot/qb2c/goengine/src/game/gameglobals.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** gameglobals.cpp 8 Nov 2004 16:28:27 -0000 1.3 --- gameglobals.cpp 24 Dec 2004 23:13:07 -0000 1.4 *************** *** 21,25 **** short gameflags[10000]; ! int ambientc, nowplaying, joyinfo[10][3]; SAMPLE *bgmusic[3], *attack; --- 21,25 ---- short gameflags[10000]; ! int ambientc, nowplaying, joyinfo[10][3], scrolling_poly; SAMPLE *bgmusic[3], *attack; *************** *** 29,31 **** BITMAP *frames[num_characters][num_animations][4][6]; ! bool automode, view_updated, use_joy, hud; \ No newline at end of file --- 29,31 ---- BITMAP *frames[num_characters][num_animations][4][6]; ! bool automode, view_updated, use_joy, hud, is_scrolling, sliding; \ No newline at end of file Index: goengine.cpp =================================================================== RCS file: /cvsroot/qb2c/goengine/src/game/goengine.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** goengine.cpp 8 Nov 2004 16:28:27 -0000 1.7 --- goengine.cpp 24 Dec 2004 23:13:07 -0000 1.8 *************** *** 42,51 **** load_triggers_v1(); ! load_file_v1("1"); setup_scene(); ! playerx = -4; playery = 0; ! playerz = 2; focusofs[0] = playerx; --- 42,51 ---- load_triggers_v1(); ! load_file_v1("101"); setup_scene(); ! playerx = 1; playery = 0; ! playerz = 3; focusofs[0] = playerx; *************** *** 60,64 **** camy = 3.5; camrx = 30; ! camry = 80; calcsteps(); --- 60,64 ---- camy = 3.5; camrx = 30; ! //camry = 80; calcsteps(); *************** *** 76,81 **** hud = TRUE; ! load_file_camera(); ! do --- 76,80 ---- hud = TRUE; ! load_file_camera(); do Index: game.cpp =================================================================== RCS file: /cvsroot/qb2c/goengine/src/game/game.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** game.cpp 8 Nov 2004 16:28:27 -0000 1.6 --- game.cpp 24 Dec 2004 23:13:07 -0000 1.7 *************** *** 155,159 **** view_updated = FALSE; - for (c = 0; c < 8; c++) --- 155,158 ---- *************** *** 305,308 **** --- 304,365 ---- } + + if (is_scrolling) + { + int plane, poly, pnt[3], a; + + float xyzinfo[3][3], xdif, zdif; + + plane = polyinfo[scrolling_poly].plane; + poly = polyinfo[scrolling_poly].poly; + + + for (c = 0; c < 3; c++) + { + pnt[c] = planeinfo[plane].polyinfo[poly][c]; + + for (a = 0; a < 3; a++) + { + xyzinfo[c][a] = planeinfo[plane].pointinfo[pnt[c]][3 + a]; + } + + } + + sliding = FALSE; + if (planeinfo[plane].polyvtx[poly][0] == 0 && planeinfo[plane].polyvtx[poly][1] == 0) + { + if (ox == 0 && oz == 0) sliding = TRUE; + xdif = (xyzinfo[0][0] - xyzinfo[1][0]); + zdif = (xyzinfo[0][2] - xyzinfo[1][2]); + ox = ox + xdif * .12 * fpsr; + oz = oz + zdif * .12 * fpsr; + } + if (planeinfo[plane].polyvtx[poly][0] == 31 && planeinfo[plane].polyvtx[poly][1] == 31) + { + if (ox == 0 && oz == 0) sliding = TRUE; + xdif = (xyzinfo[1][0] - xyzinfo[0][0]); + zdif = (xyzinfo[1][2] - xyzinfo[0][2]); + ox = ox + xdif * .12 * fpsr; + oz = oz + zdif * .12 * fpsr; + } + if (planeinfo[plane].polyvtx[poly][0] == 31 && planeinfo[plane].polyvtx[poly][1] == 0) + { + if (ox == 0 && oz == 0) sliding = TRUE; + xdif = (xyzinfo[2][0] - xyzinfo[0][0]); + zdif = (xyzinfo[2][2] - xyzinfo[0][2]); + ox = ox + xdif * .12 * fpsr; + oz = oz + zdif * .12 * fpsr; + } + if (planeinfo[plane].polyvtx[poly][0] == 0 && planeinfo[plane].polyvtx[poly][1] == 31) + { + if (ox == 0 && oz == 0) sliding = TRUE; + xdif = (xyzinfo[0][0] - xyzinfo[2][0]); + zdif = (xyzinfo[0][2] - xyzinfo[2][2]); + ox = ox + xdif * .12 * fpsr; + oz = oz + zdif * .12 * fpsr; + } + + } + p = getpixel(surroundbmp, 24 + ox * ofs * 8, 24 + oz * ofs * 8); if (p < whitec) *************** *** 319,323 **** } ! if (ox != 0 || oz != 0) { curframe += 2 * ofs; --- 376,380 ---- } ! if ((ox != 0 || oz != 0) && !sliding) { curframe += 2 * ofs; *************** *** 354,357 **** --- 411,416 ---- //if (key[KEY_S]) save_file_simple("1"); + if (key[KEY_F11]) save_bmp("shot.bmp", screen, pal); + } *************** *** 386,389 **** --- 445,454 ---- int i, c; + win(0, 320, 10, 340 + text_length(font, "is_scrolling ON "), 25); + if (is_scrolling) sprintf(tmp, "is_scrolling ON"); + if (!is_scrolling) sprintf(tmp, "is_scrolling OFF"); + + textout(offscreen, font, tmp, 325, 14, whitec); + //return; win(0, 5, 38 + 16, 20 + text_length(font, "AutoCam ON "), 38+31); *************** *** 434,437 **** --- 499,503 ---- + } *************** *** 453,457 **** ambientb = getb(ambientc); ! for (i = depth; i >= start; i--) { --- 519,523 ---- ambientb = getb(ambientc); ! for (i = depth; i >= start; i--) { *************** *** 471,474 **** --- 537,541 ---- } if (polyinfo[poly].trigger == 2) ycyc = -cycle * 7; + if (polyinfo[poly].trigger == 3) ycyc = cycle * 4; p1 = polyinfo[poly].p1; *************** *** 487,491 **** v1.u = u[0] + xcyc; v1.v = v[0] + ycyc; ! v1.c = ambientc; v2.x = pointinfo[p2].x; --- 554,558 ---- v1.u = u[0] + xcyc; v1.v = v[0] + ycyc; ! v1.c = ambientc; v2.x = pointinfo[p2].x; *************** *** 500,503 **** --- 567,573 ---- v3.u = u[2] + xcyc; v3.v = v[2] + ycyc; + + + visibility = ((pointinfo[p1].scale + pointinfo[p2].scale + pointinfo[p3].scale) / 3 - camz * zm) / vdist; visibility = 1 - sin(1.75 * visibility); *************** *** 515,519 **** //triangle3d_f(offscreen, POLYTYPE_FLAT, NULL, &v1, &v2, &v3); //set_trans_blender(ambientr,ambientg,ambientb,255 * visibility); ! //triangle3d_f(offscreen, POLYTYPE_PTEX_MASK_TRANS, planeinfo[polyinfo[poly].plane].radiosity[polyinfo[poly].poly], &v1, &v2, &v3); triangle3d_f(offscreen, POLYTYPE_PTEX_MASK, planeinfo[polyinfo[poly].plane].radiosity[polyinfo[poly].poly], &v1, &v2, &v3); } --- 585,590 ---- //triangle3d_f(offscreen, POLYTYPE_FLAT, NULL, &v1, &v2, &v3); //set_trans_blender(ambientr,ambientg,ambientb,255 * visibility); ! //triangle3d_f(offscreen, POLYTYPE_PTEX_MASK_TRANS, planeinfo[polyinfo[poly].plane].radiosity[polyinfo[poly].poly], &v1, &v2, &v3); ! triangle3d_f(offscreen, POLYTYPE_PTEX_MASK, planeinfo[polyinfo[poly].plane].radiosity[polyinfo[poly].poly], &v1, &v2, &v3); } *************** *** 549,552 **** --- 620,625 ---- + + } *************** *** 573,576 **** --- 646,651 ---- clear(triggerbmp); + is_scrolling = FALSE; + for (i = depth; i >= start; i--) { *************** *** 647,651 **** { putpixel(surroundbmp, sx, sz, p); ! putpixel(triggerbmp, sx, sz, polyinfo[c].trigger); } } --- 722,737 ---- { putpixel(surroundbmp, sx, sz, p); ! putpixel(triggerbmp, sx, sz, polyinfo[c].trigger); ! ! if (sx == 24 && sz == 24) ! { ! if (polyinfo[c].trigger == 3) ! { ! is_scrolling = TRUE; ! scrolling_poly = c; ! } else { ! is_scrolling = FALSE; ! } ! } } } *************** *** 654,657 **** --- 740,744 ---- } } + } *************** *** 1104,1120 **** { planeinfo[c].radiosity_setup[a] = 1; ! 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++) { ! for (y = 0; y < 16; y++) { putpixel(planeinfo[c].radiosity[a], x, y, 0); } } ! blit(textures[tpoly.tx], planeinfo[c].radiosity[a], 0, 0, 0, 0, 16, 16); } --- 1191,1207 ---- { planeinfo[c].radiosity_setup[a] = 1; ! planeinfo[c].radiosity[a] = create_system_bitmap(32,32); } if (planeinfo[c].radiosity_setup[a] == 1) { planeinfo[c].radiosity_setup[a] = 2; ! for (x = 0; x < 32; x++) { ! for (y = 0; y < 32; y++) { putpixel(planeinfo[c].radiosity[a], x, y, 0); } } ! blit(textures[tpoly.tx], planeinfo[c].radiosity[a], 0, 0, 0, 0, 32, 32); } Index: gameglobals.h =================================================================== RCS file: /cvsroot/qb2c/goengine/src/game/gameglobals.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** gameglobals.h 8 Nov 2004 16:28:27 -0000 1.3 --- gameglobals.h 24 Dec 2004 23:13:07 -0000 1.4 *************** *** 33,37 **** extern short gameflags[10000]; ! extern int ambientc, nowplaying, joyinfo[10][3]; extern SAMPLE *bgmusic[3], *attack; --- 33,37 ---- extern short gameflags[10000]; ! extern int ambientc, nowplaying, joyinfo[10][3], scrolling_poly; extern SAMPLE *bgmusic[3], *attack; *************** *** 41,45 **** extern BITMAP *frames[num_characters][num_animations][4][6]; ! extern bool automode, view_updated, use_joy, hud; #endif --- 41,45 ---- extern BITMAP *frames[num_characters][num_animations][4][6]; ! extern bool automode, view_updated, use_joy, hud, is_scrolling, sliding; #endif |
Update of /cvsroot/qb2c/goengine/src/editor In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9309/src/editor Modified Files: gomapedit.cpp mapedit.cpp mapeditfileinput.cpp mapeditfileinput.h mapeditglobals.cpp mapeditglobals.h mapeditgui.cpp mapeditgui.h Log Message: - now textures are 32x32 pixels instead of 16x16. - fixed light poly bug - added New in system menu, as well as rearranged the options. they are now: New, Save, Load, Import, Preferences - can hide light circles now - now supports multiple texture files. changes have been made to modify/poly/texture Index: mapeditfileinput.h =================================================================== RCS file: /cvsroot/qb2c/goengine/src/editor/mapeditfileinput.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** mapeditfileinput.h 20 Jan 2004 02:48:43 -0000 1.3 --- mapeditfileinput.h 24 Dec 2004 23:13:05 -0000 1.4 *************** *** 16,20 **** void load_file(char* rfile); void save_file_detailed(char* rfile); - void save_file_simple(char* rfile); --- 16,19 ---- Index: gomapedit.cpp =================================================================== RCS file: /cvsroot/qb2c/goengine/src/editor/gomapedit.cpp,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** gomapedit.cpp 8 Nov 2004 14:17:35 -0000 1.14 --- gomapedit.cpp 24 Dec 2004 23:13:04 -0000 1.15 *************** *** 72,77 **** ! if (editingmode == system_save_detailed) gui_system_save(0); ! if (editingmode == system_save_simple) gui_system_save(1); if (editingmode == system_load) gui_system_load(); --- 72,76 ---- ! if (editingmode == system_save) gui_system_save(0); if (editingmode == system_load) gui_system_load(); Index: mapeditgui.cpp =================================================================== RCS file: /cvsroot/qb2c/goengine/src/editor/mapeditgui.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** mapeditgui.cpp 8 Nov 2004 14:17:35 -0000 1.7 --- mapeditgui.cpp 24 Dec 2004 23:13:05 -0000 1.8 *************** *** 136,140 **** sprintf(rrows, "%s", editbox(gleft + 128, gtop + 2 + 12 * 8, gleft + 133 + 8 * 4, gtop + 11 + 12 * 8, 4, rrows)); ! stretch_sprite(offscreen, textures[rettx], gleft + 128, gtop + 2 + 12 * 9 + 4, 32, 32); surroundbox(2, gleft + 128, gtop + 2 + 12 * 9 + 4, gleft + 128 + 31, gtop + 2 + 12 * 9 + 4 + 31); if (checkmouse(gleft + 128, gtop + 2 + 12 * 9 + 4, gleft + 128 + 31, gtop + 2 + 12 * 9 + 4 + 31)) --- 136,142 ---- sprintf(rrows, "%s", editbox(gleft + 128, gtop + 2 + 12 * 8, gleft + 133 + 8 * 4, gtop + 11 + 12 * 8, 4, rrows)); ! //stretch_sprite(offscreen, textures[rettx], gleft + 128, gtop + 2 + 12 * 9 + 4, 32, 32); ! blit(textures[rettx], offscreen, 0, 0, gleft + 128, gtop + 2 + 12 * 9 + 4, 32, 32); ! surroundbox(2, gleft + 128, gtop + 2 + 12 * 9 + 4, gleft + 128 + 31, gtop + 2 + 12 * 9 + 4 + 31); if (checkmouse(gleft + 128, gtop + 2 + 12 * 9 + 4, gleft + 128 + 31, gtop + 2 + 12 * 9 + 4 + 31)) *************** *** 144,148 **** { freeze = timer + .004 * fpsr; ! rettx = gui_select_texture(rettx); } } --- 146,150 ---- { freeze = timer + .004 * fpsr; ! rettx = gui_select_texture(rettx, 0); } } *************** *** 579,583 **** { freeze = timer + .004 * fpsr; ! rettx = gui_select_texture(rettx); } } --- 581,585 ---- { freeze = timer + .004 * fpsr; ! rettx = gui_select_texture(rettx, 0); } } *************** *** 905,909 **** ! int gui_select_texture(int basetx) { --- 907,911 ---- ! int gui_select_texture(int basetx, int txset) { *************** *** 951,956 **** for (x = 0; x < 20; x++) { ! p = y * 20 + x; ! stretch_sprite(offscreen, textures[p], gleft + 10 + x * 32, gtop + 10 + y * 32, 32, 32); } } --- 953,959 ---- for (x = 0; x < 20; x++) { ! p = txset * 300 + y * 20 + x; ! blit (textures[p], offscreen, 0, 0, gleft + 10 + x * 32, gtop + 10 + y * 32, 32, 32); ! //stretch_sprite(offscreen, textures[p], gleft + 10 + x * 32, gtop + 10 + y * 32, 32, 32); } } *************** *** 959,963 **** for (x = 0; x < 20; x++) { ! p = y * 20 + x; if (basetx == p) surroundbox(2, gleft + 10 + x * 32, gtop + 10 + y * 32, gleft + 10 + x * 32 + 31, gtop + 10 + y * 32 + 31); if (checkmouse(gleft + 10 + x * 32, gtop + 10 + y * 32, gleft + 10 + x * 32 + 31, gtop + 10 + y * 32 + 31)) --- 962,966 ---- for (x = 0; x < 20; x++) { ! p = txset * 300 + y * 20 + x; if (basetx == p) surroundbox(2, gleft + 10 + x * 32, gtop + 10 + y * 32, gleft + 10 + x * 32 + 31, gtop + 10 + y * 32 + 31); if (checkmouse(gleft + 10 + x * 32, gtop + 10 + y * 32, gleft + 10 + x * 32 + 31, gtop + 10 + y * 32 + 31)) *************** *** 1160,1165 **** { sprintf(curfile, "%s", rfile); ! if (mode == 0) save_file_detailed(rfile); ! if (mode == 1) save_file_simple(rfile); } else { allegro_message("Unable to Process Request"); --- 1163,1167 ---- { sprintf(curfile, "%s", rfile); ! if (mode == 0) save_file_detailed(rfile); } else { allegro_message("Unable to Process Request"); Index: mapeditfileinput.cpp =================================================================== RCS file: /cvsroot/qb2c/goengine/src/editor/mapeditfileinput.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** mapeditfileinput.cpp 8 Nov 2004 14:17:35 -0000 1.7 --- mapeditfileinput.cpp 24 Dec 2004 23:13:05 -0000 1.8 *************** *** 129,133 **** } ! temppcx = create_system_bitmap((planeinfo[c].lastpoly + 1) * 16, 16); clear(temppcx); --- 129,133 ---- } ! temppcx = create_system_bitmap((planeinfo[c].lastpoly + 1) * 32, 32); clear(temppcx); *************** *** 149,153 **** if (planeinfo[c].radiosity_setup[d] > 0) { ! blit(planeinfo[c].radiosity[d], temppcx, 0, 0, d * 16, 0, 16, 16); } --- 149,153 ---- if (planeinfo[c].radiosity_setup[d] > 0) { ! blit(planeinfo[c].radiosity[d], temppcx, 0, 0, d * 32, 0, 32, 32); } *************** *** 174,193 **** } - void save_file_simple(char* rfile) - { - - FILE *fp; - char mapfile[100]; - - sprintf(mapfile, "data/maps/%s.smp", rfile); - - fp = fopen(mapfile, "w"); - - int version = 1; - - fprintf(fp, "%d\n", version); - - fclose(fp); - } - - --- 174,175 ---- Index: mapedit.cpp =================================================================== RCS file: /cvsroot/qb2c/goengine/src/editor/mapedit.cpp,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** mapedit.cpp 8 Nov 2004 23:32:54 -0000 1.19 --- mapedit.cpp 24 Dec 2004 23:13:05 -0000 1.20 *************** *** 121,125 **** //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); } } --- 121,125 ---- //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, 32, 32); } } *************** *** 129,133 **** for (j = 0; j <= nselpoly; j++) { ! if (planeinfo[selplane].polyinfo[selpoly[j]][6] == 0) blit (textures[planeinfo[selplane].polyinfo[selpoly[j]][3]], planeinfo[selplane].radiosity[selpoly[j]], 0, 0, 0, 0, 16, 16); } } --- 129,133 ---- for (j = 0; j <= nselpoly; j++) { ! if (planeinfo[selplane].polyinfo[selpoly[j]][6] == 0) blit (textures[planeinfo[selplane].polyinfo[selpoly[j]][3]], planeinfo[selplane].radiosity[selpoly[j]], 0, 0, 0, 0, 32, 32); } } *************** *** 135,138 **** --- 135,144 ---- } + if (key[KEY_L] && freeze < timer) + { + lightcircles = !lightcircles; + freeze = timer + .002 * fpsr; + } + if (key[KEY_TAB] && freeze < timer) *************** *** 180,184 **** { ! rectfill(planeinfo[a].radiosity[b], 0, 0, 15, 15, 0); } } --- 186,190 ---- { ! rectfill(planeinfo[a].radiosity[b], 0, 0, 31, 31, 0); } } *************** *** 793,827 **** if (editingmode >= sys && editingmode < 100) { ! if (editingmode == sys || editingmode >= system_save && editingmode < system_load) { if (editingmode == system_save) win(1, 128, 24 + 12 * 0, 255, 35 + 12 * 0); if (editingmode != system_save) win(0, 128, 24 + 12 * 0, 255, 35 + 12 * 0); ! sprintf(tmptxt, "1 Save"); textout(offscreen, font, tmptxt, 132, 24 + 12 * 0 + 2, whitec); } ! if (editingmode == sys || editingmode >= system_load && editingmode < 030) { if (editingmode == system_load) win(1, 128, 24 + 12 * 1, 255, 35 + 12 * 1); if (editingmode != system_load) win(0, 128, 24 + 12 * 1, 255, 35 + 12 * 1); ! sprintf(tmptxt, "2 Load"); textout(offscreen, font, tmptxt, 132, 24 + 12 * 1 + 2, whitec); } ! if (editingmode == sys || editingmode >= system_import && editingmode < 040) { if (editingmode == system_import) win(1, 128, 24 + 12 * 2, 255, 35 + 12 * 2); if (editingmode != system_import) win(0, 128, 24 + 12 * 2, 255, 35 + 12 * 2); ! sprintf(tmptxt, "3 Import"); textout(offscreen, font, tmptxt, 132, 24 + 12 * 2 + 2, whitec); } ! if (editingmode == sys || editingmode >= system_preferences && editingmode < 050) { if (editingmode == system_preferences) win(1, 128, 24 + 12 * 3, 255, 35 + 12 * 3); if (editingmode != system_preferences) win(0, 128, 24 + 12 * 3, 255, 35 + 12 * 3); ! sprintf(tmptxt, "4 Preferences"); textout(offscreen, font, tmptxt, 132, 24 + 12 * 3 + 2, whitec); } if (editingmode == sys && freeze < timer) --- 799,842 ---- if (editingmode >= sys && editingmode < 100) { ! if (editingmode == sys || editingmode >= system_new && editingmode < system_save) { if (editingmode == system_save) win(1, 128, 24 + 12 * 0, 255, 35 + 12 * 0); if (editingmode != system_save) win(0, 128, 24 + 12 * 0, 255, 35 + 12 * 0); ! sprintf(tmptxt, "1 New"); textout(offscreen, font, tmptxt, 132, 24 + 12 * 0 + 2, whitec); } ! if (editingmode == sys || editingmode >= system_save && editingmode < system_load) { if (editingmode == system_load) win(1, 128, 24 + 12 * 1, 255, 35 + 12 * 1); if (editingmode != system_load) win(0, 128, 24 + 12 * 1, 255, 35 + 12 * 1); ! sprintf(tmptxt, "2 Save"); textout(offscreen, font, tmptxt, 132, 24 + 12 * 1 + 2, whitec); } ! if (editingmode == sys || editingmode >= system_load && editingmode < system_import) { if (editingmode == system_import) win(1, 128, 24 + 12 * 2, 255, 35 + 12 * 2); if (editingmode != system_import) win(0, 128, 24 + 12 * 2, 255, 35 + 12 * 2); ! sprintf(tmptxt, "3 Load"); textout(offscreen, font, tmptxt, 132, 24 + 12 * 2 + 2, whitec); } ! if (editingmode == sys || editingmode >= system_import && editingmode < system_preferences) { if (editingmode == system_preferences) win(1, 128, 24 + 12 * 3, 255, 35 + 12 * 3); if (editingmode != system_preferences) win(0, 128, 24 + 12 * 3, 255, 35 + 12 * 3); ! sprintf(tmptxt, "4 Import"); textout(offscreen, font, tmptxt, 132, 24 + 12 * 3 + 2, whitec); } + + if (editingmode == sys || editingmode >= system_preferences && editingmode < 060) + { + if (editingmode == system_import) win(1, 128, 24 + 12 * 4, 255, 35 + 12 * 4); + if (editingmode != system_import) win(0, 128, 24 + 12 * 4, 255, 35 + 12 * 4); + sprintf(tmptxt, "5 Preferences"); + textout(offscreen, font, tmptxt, 132, 24 + 12 * 4 + 2, whitec); + } + if (editingmode == sys && freeze < timer) *************** *** 829,875 **** if ((mouse_b & 1 && checkmouse(128, 24 + 12 * 0, 255, 35 + 12 * 0)) || key[KEY_1]) { ! editingmode = system_save; freeze = timer + .002 * fpsr; } ! if ((mouse_b & 1 && checkmouse(128, 24 + 12 * 1, 255, 35 + 12 * 1)) || key[KEY_2]) editingmode = system_load; ! if ((mouse_b & 1 && checkmouse(128, 24 + 12 * 2, 255, 35 + 12 * 2)) || key[KEY_3]) { ! editingmode = system_import; freeze = timer + .002 * fpsr; } ! if ((mouse_b & 1 && checkmouse(128, 24 + 12 * 3, 255, 35 + 12 * 3)) || key[KEY_4]) editingmode = system_preferences; ! } ! ! if (editingmode == system_save) ! { ! win(0, 256, 24 + 12 * 0, 383, 35 + 12 * 0); ! sprintf(tmptxt, "1 Detailed"); ! textout(offscreen, font, tmptxt, 260, 24 + 12 * 0 + 2, whitec); ! ! win(0, 256, 24 + 12 * 1, 383, 35 + 12 * 1); ! sprintf(tmptxt, "2 Simple"); ! textout(offscreen, font, tmptxt, 260, 24 + 12 * 1 + 2, whitec); ! ! if (freeze < timer) { ! if ((mouse_b & 1 && checkmouse(256, 24 + 12 * 0, 383, 35 + 12 * 0)) || key[KEY_1]) editingmode = system_save_detailed; ! if ((mouse_b & 1 && checkmouse(256, 24 + 12 * 1, 383, 35 + 12 * 1)) || key[KEY_2]) editingmode = system_save_simple; } } ! if (editingmode == system_import) { - win(0, 256, 24 + 12 * 2, 383, 35 + 12 * 2); - sprintf(tmptxt, "1 Simple"); - textout(offscreen, font, tmptxt, 260, 24 + 12 * 2 + 2, whitec); - win(0, 256, 24 + 12 * 3, 383, 35 + 12 * 3); sprintf(tmptxt, "2 ASE"); ! textout(offscreen, font, tmptxt, 260, 24 + 12 * 3 + 2, whitec); if (freeze < timer) { ! if ((mouse_b & 1 && checkmouse(256, 24 + 12 * 2, 383, 35 + 12 * 2)) || key[KEY_1]) editingmode = system_save_detailed; ! if ((mouse_b & 1 && checkmouse(256, 24 + 12 * 3, 383, 35 + 12 * 3)) || key[KEY_2]) editingmode = system_save_simple; } } --- 844,889 ---- if ((mouse_b & 1 && checkmouse(128, 24 + 12 * 0, 255, 35 + 12 * 0)) || key[KEY_1]) { ! editingmode = 0; ! nlights = 0; ! endplane = 0; ! ! for (a = 0; a <= max_planes; a++) ! { ! planeinfo[a].active = FALSE; ! planeinfo[a].npoints = 0; ! planeinfo[a].npolies = 0; ! planeinfo[a].condensed = FALSE; ! } ! setup_scene(); freeze = timer + .002 * fpsr; } ! if ((mouse_b & 1 && checkmouse(128, 24 + 12 * 1, 255, 35 + 12 * 1)) || key[KEY_2]) { ! editingmode = system_save; freeze = timer + .002 * fpsr; } ! if ((mouse_b & 1 && checkmouse(128, 24 + 12 * 2, 255, 35 + 12 * 2)) || key[KEY_3]) editingmode = system_load; ! if ((mouse_b & 1 && checkmouse(128, 24 + 12 * 3, 255, 35 + 12 * 3)) || key[KEY_4]) { ! editingmode = system_import; ! freeze = timer + .002 * fpsr; } + if ((mouse_b & 1 && checkmouse(128, 24 + 12 * 4, 255, 35 + 12 * 4)) || key[KEY_5]) editingmode = system_preferences; } ! if (editingmode == system_import && freeze < timer) { win(0, 256, 24 + 12 * 3, 383, 35 + 12 * 3); + sprintf(tmptxt, "1 DTL"); + textout(offscreen, font, tmptxt, 260, 24 + 12 * 3 + 2, whitec); + + win(0, 256, 24 + 12 * 4, 383, 35 + 12 * 4); sprintf(tmptxt, "2 ASE"); ! textout(offscreen, font, tmptxt, 260, 24 + 12 * 4 + 2, whitec); if (freeze < timer) { ! //if ((mouse_b & 1 && checkmouse(256, 24 + 12 * 2, 383, 35 + 12 * 2)) || key[KEY_1]) editingmode = system_save_detailed; ! //if ((mouse_b & 1 && checkmouse(256, 24 + 12 * 3, 383, 35 + 12 * 3)) || key[KEY_2]) editingmode = system_save_simple; } } *************** *** 1277,1285 **** } ! if (editingmode == modify_poly) { win(0, 256, 24 + 12 * 10, 383, 35 + 12 * 10); sprintf(tmptxt, "2 Texture"); textout(offscreen, font, tmptxt, 260, 24 + 12 * 10 + 2, whitec); } --- 1291,1326 ---- } ! if (editingmode == modify_poly || editingmode == modify_poly_texture) { win(0, 256, 24 + 12 * 10, 383, 35 + 12 * 10); sprintf(tmptxt, "2 Texture"); textout(offscreen, font, tmptxt, 260, 24 + 12 * 10 + 2, whitec); + + if (editingmode == modify_poly_texture) + { + win(0, 384, 24 + 12 * 10, 511, 35 + 12 * 10); + sprintf(tmptxt, "1 tx0.pcx"); + textout(offscreen, font, tmptxt, 388, 24 + 12 * 10 + 2, whitec); + + win(0, 384, 24 + 12 * 11, 511, 35 + 12 * 11); + sprintf(tmptxt, "2 tx1.pcx"); + textout(offscreen, font, tmptxt, 388, 24 + 12 * 11 + 2, whitec); + + if (freeze < timer) + { + if ((mouse_b & 1 && checkmouse(384, 24 + 12 * 10, 511, 35 + 12 * 10)) || key[KEY_1]) + { + hlpoly = FALSE; + editingmode = modify_poly_texture_select1; + freeze = timer + .002 * fpsr; + } + if ((mouse_b & 1 && checkmouse(384, 24 + 12 * 11, 511, 35 + 12 * 11)) || key[KEY_2]) + { + hlpoly = FALSE; + editingmode = modify_poly_texture_select2; + freeze = timer + .002 * fpsr; + } + } + } } *************** *** 1403,1408 **** } if ((mouse_b & 1 && checkmouse(256, 24 + 12 * 10, 383, 35 + 12 * 10)) || key[KEY_2]) ! { ! hlpoly = FALSE; editingmode = modify_poly_texture; freeze = timer + .002 * fpsr; --- 1444,1448 ---- } if ((mouse_b & 1 && checkmouse(256, 24 + 12 * 10, 383, 35 + 12 * 10)) || key[KEY_2]) ! { editingmode = modify_poly_texture; freeze = timer + .002 * fpsr; *************** *** 1448,1451 **** --- 1488,1492 ---- if (editingmode >= modify_point && editingmode < modify_light && (nselpoint > 0 || nselpointc > 0)) { + if (editingmode == modify_point || editingmode >= modify_point_by_input && editingmode < modify_point_rotate) { *************** *** 1841,1845 **** { p = c + basepoint; ! if (p > 999) p = 999; spanx = planeinfo[tselplane].basex - planeinfo[selplane].basex; spany = planeinfo[tselplane].basey - planeinfo[selplane].basey; --- 1882,1886 ---- { p = c + basepoint; ! if (p > max_points_per_plane-1) p = max_points_per_plane -1; spanx = planeinfo[tselplane].basex - planeinfo[selplane].basex; spany = planeinfo[tselplane].basey - planeinfo[selplane].basey; *************** *** 1878,1882 **** { p = c + basepoly; ! if (p > 999) p = 999; p1 = planeinfo[tselplane].polyinfo[c][0] + basepoint; p2 = planeinfo[tselplane].polyinfo[c][1] + basepoint; --- 1919,1923 ---- { p = c + basepoly; ! if (p > max_polies_per_plane - 1) p = max_polies_per_plane - 1; p1 = planeinfo[tselplane].polyinfo[c][0] + basepoint; p2 = planeinfo[tselplane].polyinfo[c][1] + basepoint; *************** *** 1902,1905 **** --- 1943,1953 ---- if (p > planeinfo[selplane].lastpoly) planeinfo[selplane].lastpoly = p; + + if (planeinfo[selplane].radiosity_setup[p] == 0) + { + planeinfo[selplane].radiosity[p] = create_system_bitmap(32, 32); + planeinfo[selplane].radiosity_setup[p] = 1; + } + blit(planeinfo[tselplane].radiosity[c], planeinfo[selplane].radiosity[p], 0, 0, 0, 0, 32, 32); } } *************** *** 1982,1986 **** 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)); } --- 2030,2034 ---- circle (offscreen, pointinfo[p].x, pointinfo[p].y, clearance, orangec); ! if (lightcircles) circle (offscreen, pointinfo[p].x, pointinfo[p].y, x, makecol(lightinfo[c].lightr, lightinfo[c].lightg, lightinfo[c].lightb)); } *************** *** 2047,2051 **** planeinfo[newplane].condensed = TRUE; planeinfo[newplane].lastpoint = 0; ! planeinfo[newplane].lastpoly = 0; planeinfo[newplane].basex = selpoint[0][0]; planeinfo[newplane].basey = selpoint[0][1]; --- 2095,2099 ---- planeinfo[newplane].condensed = TRUE; planeinfo[newplane].lastpoint = 0; ! planeinfo[newplane].lastpoly = -1; planeinfo[newplane].basex = selpoint[0][0]; planeinfo[newplane].basey = selpoint[0][1]; *************** *** 2060,2069 **** planeinfo[newplane].yrot = 0; planeinfo[newplane].zrot = 0; ! planeinfo[newplane].pointinfo[0][9] = lastlight + 1; ! lightinfo[lastlight].strength = 6; lightinfo[lastlight].lightr = 255; lightinfo[lastlight].lightg = 255; ! lightinfo[lastlight].lightb = 224; if (newplane > endplane) endplane = newplane; --- 2108,2122 ---- planeinfo[newplane].yrot = 0; planeinfo[newplane].zrot = 0; ! lightinfo[lastlight].strength = 6; lightinfo[lastlight].lightr = 255; lightinfo[lastlight].lightg = 255; ! lightinfo[lastlight].lightb = 224; ! ! for (int pointcc = 0; pointcc < 12; pointcc++) ! { ! planeinfo[newplane].pointinfo[0][pointcc] = 0; ! } ! planeinfo[newplane].pointinfo[0][9] = lastlight + 1; if (newplane > endplane) endplane = newplane; *************** *** 2339,2353 **** ! if (editingmode == modify_poly_texture && freeze < timer) { short rettx; freeze = timer + .004 * fpsr; ! rettx = gui_select_texture(planeinfo[selplane].polyinfo[selpoly[0]][3]); for (c = 0; c < nselpoly; c++) { planeinfo[selplane].polyinfo[selpoly[c]][3] = rettx; ! blit(textures[rettx], planeinfo[selplane].radiosity[selpoly[c]], 0, 0, 0, 0, 16, 16); } --- 2392,2407 ---- ! if ((editingmode == modify_poly_texture_select1 || editingmode == modify_poly_texture_select2) && freeze < timer) { short rettx; freeze = timer + .004 * fpsr; ! if (editingmode == modify_poly_texture_select1) rettx = gui_select_texture(planeinfo[selplane].polyinfo[selpoly[0]][3], 0); ! if (editingmode == modify_poly_texture_select2) rettx = gui_select_texture(planeinfo[selplane].polyinfo[selpoly[0]][3], 1); for (c = 0; c < nselpoly; c++) { planeinfo[selplane].polyinfo[selpoly[c]][3] = rettx; ! blit(textures[rettx], planeinfo[selplane].radiosity[selpoly[c]], 0, 0, 0, 0, 32, 32); } *************** *** 2416,2422 **** 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; --- 2470,2476 ---- stretch_sprite(offscreen, textures[p], bx, by, int(s), int(s)); ! line(offscreen, bx + int((float)vtx[b][0] / 32 * s) + g, by + int((float)vtx[b][1] / 32 * s) + g, bx + int((float)vtx[b][2] / 32 * s) + g, by + int((float)vtx[b][3] / 32 * s) + g, whitec); ! line(offscreen, bx + int((float)vtx[b][4] / 32 * s) + g, by + int((float)vtx[b][5] / 32 * s) + g, bx + int((float)vtx[b][2] / 32 * s) + g, by + int((float)vtx[b][3] / 32 * s) + g, whitec); ! line(offscreen, bx + int((float)vtx[b][0] / 32 * s) + g, by + int((float)vtx[b][1] / 32 * s) + g, bx + int((float)vtx[b][4] / 32 * s) + g, by + int((float)vtx[b][5] / 32 * s) + g, whitec); d = 0; *************** *** 2691,2698 **** 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); --- 2745,2752 ---- clear_to_color(texturesb, trans); ! blit(planeinfo[polyinfo[poly].plane].radiosity[polyinfo[poly].poly], texturesb, 0, 0, 0, 0, 32, 32); ! for (x = 0; x < 32; x++) { ! for (y = 0; y < 32; y++) { color = getpixel(textures[t], x, y); *************** *** 2700,2710 **** } } ! triangle3d_f(offscreen, POLYTYPE_PTEX_MASK, texturesb, &v1, &v2, &v3); clear_to_color(texturesb, trans); ! blit(texturesc, 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); --- 2754,2764 ---- } } ! triangle3d_f(offscreen, POLYTYPE_PTEX_MASK, texturesb, &v1, &v2, &v3); clear_to_color(texturesb, trans); ! blit(texturesc, texturesb, 0, 0, 0, 0, 32, 32); ! for (x = 0; x < 32; x++) { ! for (y = 0; y < 32; y++) { color = getpixel(textures[t], x, y); *************** *** 2716,2722 **** clear_to_color(texturesb, trans); ! for (x = 0; x < 16; x++) { ! for (y = 0; y < 16; y++) { color = getpixel(textures[t], x, y); --- 2770,2776 ---- clear_to_color(texturesb, trans); ! for (x = 0; x < 32; x++) { ! for (y = 0; y < 32; y++) { color = getpixel(textures[t], x, y); *************** *** 2744,2749 **** vv3.y = v[2]; triangle3d_f(texturesb, POLYTYPE_GRGB, texturesb, &vv1, &vv2, &vv3); ! vv1.x = 15 - u[0]; ! vv1.y = 15 - v[0]; vv2.x = u[2]; vv2.y = v[2]; --- 2798,2803 ---- vv3.y = v[2]; triangle3d_f(texturesb, POLYTYPE_GRGB, texturesb, &vv1, &vv2, &vv3); ! vv1.x = 31 - u[0]; ! vv1.y = 31 - v[0]; vv2.x = u[2]; vv2.y = v[2]; *************** *** 2754,2760 **** triangle3d_f(texturesb, POLYTYPE_GRGB, texturesb, &vv1, &vv2, &vv3); ! for (x = 0; x < 16; x++) { ! for (y = 0; y < 16; y++) { color = getpixel(textures[t], x, y); --- 2808,2814 ---- triangle3d_f(texturesb, POLYTYPE_GRGB, texturesb, &vv1, &vv2, &vv3); ! for (x = 0; x < 32; x++) { ! for (y = 0; y < 32; y++) { color = getpixel(textures[t], x, y); *************** *** 2777,2782 **** vv3.y = v[2]; triangle3d_f(texturesb, POLYTYPE_GRGB, texturesb, &vv1, &vv2, &vv3); ! vv1.x = 15 - u[0]; ! vv1.y = 15 - v[0]; vv2.x = u[2]; vv2.y = v[2]; --- 2831,2836 ---- vv3.y = v[2]; triangle3d_f(texturesb, POLYTYPE_GRGB, texturesb, &vv1, &vv2, &vv3); ! vv1.x = 31 - u[0]; ! vv1.y = 31 - v[0]; vv2.x = u[2]; vv2.y = v[2]; *************** *** 2786,2792 **** vv3.c = (short)pointinfo[p2].psy; triangle3d_f(texturesb, POLYTYPE_GRGB, texturesb, &vv1, &vv2, &vv3); ! for (x = 0; x < 16; x++) { ! for (y = 0; y < 16; y++) { color = getpixel(textures[t], x, y); --- 2840,2846 ---- vv3.c = (short)pointinfo[p2].psy; triangle3d_f(texturesb, POLYTYPE_GRGB, texturesb, &vv1, &vv2, &vv3); ! for (x = 0; x < 32; x++) { ! for (y = 0; y < 32; y++) { color = getpixel(textures[t], x, y); *************** *** 2809,2814 **** vv3.y = v[2]; triangle3d_f(texturesb, POLYTYPE_GRGB, texturesb, &vv1, &vv2, &vv3); ! vv1.x = 15 - u[0]; ! vv1.y = 15 - v[0]; vv2.x = u[2]; vv2.y = v[2]; --- 2863,2868 ---- vv3.y = v[2]; triangle3d_f(texturesb, POLYTYPE_GRGB, texturesb, &vv1, &vv2, &vv3); ! vv1.x = 31 - u[0]; ! vv1.y = 31 - v[0]; vv2.x = u[2]; vv2.y = v[2]; *************** *** 2818,2824 **** vv3.c = (short)pointinfo[p2].psz; triangle3d_f(texturesb, POLYTYPE_GRGB, texturesb, &vv1, &vv2, &vv3); ! for (x = 0; x < 16; x++) { ! for (y = 0; y < 16; y++) { color = getpixel(textures[t], x, y); --- 2872,2878 ---- vv3.c = (short)pointinfo[p2].psz; triangle3d_f(texturesb, POLYTYPE_GRGB, texturesb, &vv1, &vv2, &vv3); ! for (x = 0; x < 32; x++) { ! for (y = 0; y < 32; y++) { color = getpixel(textures[t], x, y); *************** *** 3005,3012 **** if (planeinfo[a].polyinfo[b][6] == 0) { ! ! for (x = 0; x < 16; x++) { ! for (y = 0; y < 16; y++) { planeinfo[a].radiosity_index[b][x][y] = FALSE; --- 3059,3066 ---- if (planeinfo[a].polyinfo[b][6] == 0) { ! ! for (x = 0; x < 32; x++) { ! for (y = 0; y < 32; y++) { planeinfo[a].radiosity_index[b][x][y] = FALSE; *************** *** 3095,3100 **** poly = polyinfo[pl].poly; ! ny = short(po / 16); ! nx = po - short(po / 16) * 16; if (!planeinfo[plane].radiosity_index[poly][nx][ny]) --- 3149,3154 ---- poly = polyinfo[pl].poly; ! ny = int(po / 32); ! nx = po - int(po / 32) * 32; if (!planeinfo[plane].radiosity_index[poly][nx][ny]) *************** *** 3121,3131 **** sx = nx; sy = ny; ! sx = nx + float(planeinfo[plane].polyvtx[poly][2] - planeinfo[plane].polyvtx[poly][0]) / 15; ! sy = ny + float(planeinfo[plane].polyvtx[poly][3] - planeinfo[plane].polyvtx[poly][1]) / 15; if (sx < 0) sx = 0; ! if (sx > 15) sx = 15; if (sy < 0) sy = 0; ! if (sy > 15) sy = 15; --- 3175,3185 ---- sx = nx; sy = ny; ! sx = nx + float(planeinfo[plane].polyvtx[poly][2] - planeinfo[plane].polyvtx[poly][0]) / 31; ! sy = ny + float(planeinfo[plane].polyvtx[poly][3] - planeinfo[plane].polyvtx[poly][1]) / 31; if (sx < 0) sx = 0; ! if (sx > 31) sx = 31; if (sy < 0) sy = 0; ! if (sy > 31) sy = 31; *************** *** 3140,3150 **** sx = nx; sy = ny; ! sx = nx + float(planeinfo[plane].polyvtx[poly][4] - planeinfo[plane].polyvtx[poly][0]) / 15; ! sy = ny + float(planeinfo[plane].polyvtx[poly][5] - planeinfo[plane].polyvtx[poly][1]) / 15; if (sx < 0) sx = 0; ! if (sx > 15) sx = 15; if (sy < 0) sy = 0; ! if (sy > 15) sy = 15; --- 3194,3204 ---- sx = nx; sy = ny; ! sx = nx + float(planeinfo[plane].polyvtx[poly][4] - planeinfo[plane].polyvtx[poly][0]) / 31; ! sy = ny + float(planeinfo[plane].polyvtx[poly][5] - planeinfo[plane].polyvtx[poly][1]) / 31; if (sx < 0) sx = 0; ! if (sx > 31) sx = 31; if (sy < 0) sy = 0; ! if (sy > 31) sy = 31; *************** *** 3276,3282 **** if (planeinfo[i].polyinfo[j][6] == 0) { ! for (x = 0; x < 16; x++) { ! for (y = 0; y < 16; y++) { short old_r, old_g, old_b; --- 3330,3336 ---- if (planeinfo[i].polyinfo[j][6] == 0) { ! for (x = 0; x < 32; x++) { ! for (y = 0; y < 32; y++) { short old_r, old_g, old_b; *************** *** 3300,3304 **** sy = y + yy; ! if (sx > -1 && sx < 16 && sy > -1 && sy < 16) { p++; --- 3354,3358 ---- sy = y + yy; ! if (sx > -1 && sx < 32 && sy > -1 && sy < 32) { p++; *************** *** 3347,3353 **** if (planeinfo[i].polyinfo[j][6] == 0) { ! for (x = 0; x < 16; x++) { ! for (y = 0; y < 16; y++) { c0 = getpixel(planeinfo[i].radiosity[j], x, y); --- 3401,3407 ---- if (planeinfo[i].polyinfo[j][6] == 0) { ! for (x = 0; x < 32; x++) { ! for (y = 0; y < 32; y++) { c0 = getpixel(planeinfo[i].radiosity[j], x, y); *************** *** 3437,3440 **** --- 3491,3495 ---- hud = TRUE; + lightcircles = TRUE; ret = install_mouse(); *************** *** 3458,3462 **** char textemp[100]; ! temppcx = create_system_bitmap(320, 240); sprintf(textemp, "data/textureset/tx0.pcx"); temppcx = load_pcx(textemp, pal); --- 3513,3517 ---- char textemp[100]; ! temppcx = create_system_bitmap(640, 480); sprintf(textemp, "data/textureset/tx0.pcx"); temppcx = load_pcx(textemp, pal); *************** *** 3472,3486 **** { i = y * 20 + x; ! blit(temppcx, textures[i], x * 16, y * 16, 0, 0, 16, 16); } } xx = 1; yy = 1; i = 0; ! sx = 15 / (float)xx; ! sy = 15 / (float)yy; for (y = 0; y < yy; y++) --- 3527,3554 ---- { i = y * 20 + x; ! blit(temppcx, textures[i], x * 32, y * 32, 0, 0, 32, 32); } } + sprintf(textemp, "data/textureset/tx1.pcx"); + temppcx = load_pcx(textemp, pal); + + i = 0; + for (y = 0; y < 15; y++) + { + for (x = 0; x < 20; x++) + { + i = 300 + y * 20 + x; + blit(temppcx, textures[i], x * 32, y * 32, 0, 0, 32, 32); + } + } + xx = 1; yy = 1; i = 0; ! sx = 31 / (float)xx; ! sy = 31 / (float)yy; for (y = 0; y < yy; y++) *************** *** 3548,3552 **** for (x = 0; x < max_planes; x++) { ! for (y = 0; y < max_polies; y++) { planeinfo[x].radiosity_setup[y] = 0; --- 3616,3620 ---- for (x = 0; x < max_planes; x++) { ! for (y = 0; y < max_polies_per_plane; y++) { planeinfo[x].radiosity_setup[y] = 0; *************** *** 3557,3567 **** ! texturesb = create_system_bitmap(16,16); ! texturesc = create_system_bitmap(16,16); ! for (y = 0; y < 16; y++) { ! for (x = 0; x < 16; x++) { ! c = y * 16 + x; putpixel(texturesc, x, y, c); } --- 3625,3635 ---- ! texturesb = create_system_bitmap(32,32); ! texturesc = create_system_bitmap(32,32); ! for (y = 0; y < 32; y++) { ! for (x = 0; x < 32; x++) { ! c = y * 32 + x; putpixel(texturesc, x, y, c); } *************** *** 3816,3820 **** { planeinfo[c].radiosity_setup[a] = 1; ! planeinfo[c].radiosity[a] = create_system_bitmap(16,16); } --- 3884,3888 ---- { planeinfo[c].radiosity_setup[a] = 1; ! planeinfo[c].radiosity[a] = create_system_bitmap(32,32); } *************** *** 3823,3834 **** { planeinfo[c].radiosity_setup[a] = 2; ! for (x = 0; x < 16; x++) { ! for (y = 0; y < 16; y++) { putpixel(planeinfo[c].radiosity[a], x, y, 0); } } ! blit(textures[tpoly.tx], planeinfo[c].radiosity[a], 0, 0, 0, 0, 16, 16); } --- 3891,3902 ---- { planeinfo[c].radiosity_setup[a] = 2; ! for (x = 0; x < 32; x++) { ! for (y = 0; y < 32; y++) { putpixel(planeinfo[c].radiosity[a], x, y, 0); } } ! blit(textures[tpoly.tx], planeinfo[c].radiosity[a], 0, 0, 0, 0, 32, 32); } Index: mapeditglobals.h =================================================================== RCS file: /cvsroot/qb2c/goengine/src/editor/mapeditglobals.h,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** mapeditglobals.h 8 Nov 2004 16:28:27 -0000 1.9 --- mapeditglobals.h 24 Dec 2004 23:13:05 -0000 1.10 *************** *** 18,29 **** #define sys 001 ! #define system_save 010 ! #define system_save_detailed 011 ! #define system_save_simple 012 ! #define system_load 020 ! #define system_import 030 ! #define system_import_simple 031 ! #define system_import_ase 032 ! #define system_preferences 040 #define addplane 100 --- 18,28 ---- #define sys 001 ! #define system_new 010 ! #define system_save 020 ! #define system_load 030 ! #define system_import 040 ! #define system_import_simple 041 ! #define system_import_ase 042 ! #define system_preferences 050 #define addplane 100 *************** *** 56,59 **** --- 55,60 ---- #define modify_poly_reset_vertii 821 #define modify_poly_texture 822 + #define modify_poly_texture_select1 8221 + #define modify_poly_texture_select2 8222 #define modify_poly_uvmap 823 #define modify_poly_hidden 824 *************** *** 88,96 **** #define max_points 2000 #define max_lights 200 extern float playerx, playery, playerz, pratio; 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; --- 89,99 ---- #define max_points 2000 #define max_lights 200 + #define max_polies_per_plane 400 + #define max_points_per_plane 400 extern float playerx, playery, playerz, pratio; extern short pscx, pscy; ! extern short selplane, selpoly[max_polies_per_plane], tselplane, tselpoint, tselpoly, sellight; extern float selpoint[max_points][4], selpointc[max_points][4]; extern unsigned short nselpoint, nselpoly, nlights, nselpointc; *************** *** 122,126 **** extern char curfile[20]; ! extern bool hud; #endif --- 125,129 ---- extern char curfile[20]; ! extern bool hud, lightcircles; #endif Index: mapeditgui.h =================================================================== RCS file: /cvsroot/qb2c/goengine/src/editor/mapeditgui.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** mapeditgui.h 20 Jan 2004 18:19:27 -0000 1.5 --- mapeditgui.h 24 Dec 2004 23:13:05 -0000 1.6 *************** *** 25,29 **** void gui_modify_point_by_input(); ! int gui_select_texture(int basetx); void gui_system_load(); --- 25,29 ---- void gui_modify_point_by_input(); ! int gui_select_texture(int basetx, int txset); void gui_system_load(); Index: mapeditglobals.cpp =================================================================== RCS file: /cvsroot/qb2c/goengine/src/editor/mapeditglobals.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** mapeditglobals.cpp 8 Nov 2004 14:17:35 -0000 1.8 --- mapeditglobals.cpp 24 Dec 2004 23:13:05 -0000 1.9 *************** *** 17,21 **** 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; --- 17,21 ---- short pscx, pscy; ! short selplane, selpoly[max_polies_per_plane], tselplane, tselpoint, tselpoly, sellight; float selpoint[max_points][4], selpointc[max_points][4]; unsigned short nselpoint, nselpoly, nlights, nselpointc; *************** *** 45,49 **** bool bk_bfc; ! bool hud; char curfile[20]; --- 45,49 ---- bool bk_bfc; ! bool hud, lightcircles; char curfile[20]; |
|
From: Daniel K. <sy...@us...> - 2004-11-09 05:00:33
|
Update of /cvsroot/qb2c/goengine/data In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6519/data Removed Files: joypad.dat mouse.pcx Log Message: removing joypad.dat and mouse.pcx --- joypad.dat DELETED --- --- mouse.pcx DELETED --- |
|
From: Daniel K. <sy...@us...> - 2004-11-08 23:33:05
|
Update of /cvsroot/qb2c/goengine/src/editor In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30702/src/editor Modified Files: mapedit.cpp Log Message: updated generate radiosity function Index: mapedit.cpp =================================================================== RCS file: /cvsroot/qb2c/goengine/src/editor/mapedit.cpp,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** mapedit.cpp 8 Nov 2004 16:47:38 -0000 1.18 --- mapedit.cpp 8 Nov 2004 23:32:54 -0000 1.19 *************** *** 2919,2926 **** { ! 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; --- 2919,2928 ---- { ! 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; + short c; + int c0; 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; *************** *** 3110,3117 **** ! c = getpixel(textures[planeinfo[plane].polyinfo[poly][3]], (short)nx, (short)ny); ! nr = getr(c); ! ng = getg(c); ! nb = getb(c); //c1 = sin(1.57 * float(nr + ng + nb) / 768) * 256; c1 = float(nr + ng + nb) / 768; --- 3112,3119 ---- ! c0 = getpixel(textures[planeinfo[plane].polyinfo[poly][3]], (short)nx, (short)ny); ! nr = getr(c0); ! ng = getg(c0); ! nb = getb(c0); //c1 = sin(1.57 * float(nr + ng + nb) / 768) * 256; c1 = float(nr + ng + nb) / 768; *************** *** 3128,3135 **** ! c = getpixel(textures[planeinfo[plane].polyinfo[poly][3]], (short)sx, (short)sy); ! nr = getr(c); ! ng = getg(c); ! nb = getb(c); c2 = float(nr + ng + nb) / 768 - c1; --- 3130,3137 ---- ! c0 = getpixel(textures[planeinfo[plane].polyinfo[poly][3]], (short)sx, (short)sy); ! nr = getr(c0); ! ng = getg(c0); ! nb = getb(c0); c2 = float(nr + ng + nb) / 768 - c1; *************** *** 3147,3154 **** ! c = getpixel(textures[planeinfo[plane].polyinfo[poly][3]], (short)sx, (short)sy); ! nr = getr(c); ! ng = getg(c); ! nb = getb(c); c3 = float(nr + ng + nb) / 768 - c1; --- 3149,3156 ---- ! c0 = getpixel(textures[planeinfo[plane].polyinfo[poly][3]], (short)sx, (short)sy); ! nr = getr(c0); ! ng = getg(c0); ! nb = getb(c0); c3 = float(nr + ng + nb) / 768 - c1; *************** *** 3223,3234 **** if (intense < 0) intense = 0; ! 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); ! nb = nb + getb(c); --- 3225,3236 ---- if (intense < 0) intense = 0; ! c0 = getpixel(planeinfo[plane].radiosity[poly], nx, ny); nr = lightr * intense; ng = lightg * intense; nb = lightb * intense; ! nr = nr + getr(c0); ! ng = ng + getg(c0); ! nb = nb + getb(c0); *************** *** 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; --- 3280,3294 ---- 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; *************** *** 3298,3305 **** { p++; ! c = getpixel(planeinfo[i].radiosity[j], sx, sy); ! nr += getr(c); ! ng += getg(c); ! nb += getb(c); } } --- 3303,3310 ---- { p++; ! color = getpixel(planeinfo[i].radiosity[j], int(sx), int(sy)); ! nr += getr(color); ! ng += getg(color); ! nb += getb(color); } } *************** *** 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)); --- 3321,3327 ---- 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)); *************** *** 3324,3327 **** --- 3329,3333 ---- } + } } *************** *** 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; --- 3351,3358 ---- for (y = 0; y < 16; y++) { ! c0 = getpixel(planeinfo[i].radiosity[j], x, y); ! nr = getr(c0); ! ng = getg(c0); ! nb = getb(c0); spanr = 255 - ambientr; *************** *** 3358,3367 **** 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; --- 3364,3373 ---- nb = ambientb + spanb * (float)nb / 255; ! c0 = getpixel(textures[planeinfo[i].polyinfo[j][3]], x, y); ! nr = getr(c0) * (float)nr / 255; ! ng = getg(c0) * (float)ng / 255; ! nb = getb(c0) * (float)nb / 255; ! if (getr(c0) == 255 && getg(c0) == 0 && getb(c0) == 255) { nr = 255; |
|
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; + } |
|
From: Daniel K. <sy...@us...> - 2004-11-08 16:28:38
|
Update of /cvsroot/qb2c/goengine/src/engine In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18293/src/engine Modified Files: engineglobals.cpp engineglobals.h fileinput.cpp render.cpp Log Message: Engine/Editor Updates added - door opening animation - brightness control for polies in editor - 'h' key can only affect selected polies in editor - camera hotspots / camera auto angling Index: fileinput.cpp =================================================================== RCS file: /cvsroot/qb2c/goengine/src/engine/fileinput.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** fileinput.cpp 8 Nov 2004 14:17:36 -0000 1.8 --- fileinput.cpp 8 Nov 2004 16:28:27 -0000 1.9 *************** *** 25,31 **** BITMAP *temppcx; ! sprintf(mapfile, "data/maps/%s.dtl", rfile); ! fp = fopen(mapfile, "r"); fscanf(fp, "%d", &c); --- 25,32 ---- BITMAP *temppcx; ! sprintf(mapfile, "%s", rfile); ! sprintf(tmp, "data/maps/%s.dtl", mapfile); ! fp = fopen(tmp, "r"); fscanf(fp, "%d", &c); *************** *** 48,52 **** //win (0, lx, ly, rx + 6, ry); ! updscreen(); int bluec = makecol(64, 255, 64); --- 49,53 ---- //win (0, lx, ly, rx + 6, ry); ! //updscreen(); int bluec = makecol(64, 255, 64); *************** *** 57,70 **** //drawing_mode(DRAW_MODE_TRANS, NULL, 0, 0); ! win (0, lx-4, ly, rx + 10, ry + 20); for (c = 0; c <= endplane; c++) { ! sprintf(tmp, "Loading..."); textout(offscreen, font, tmp, lx + 2, ly + 2, whitec); rect (offscreen, lx, ly + 16, lx + w , ly + h + 16, whitec); rectfill (offscreen, lx + 2, ly + 16 + 2, lx + (w - 4) * (float)c / endplane, ly + h + 16 - 2, bluec); ! updscreen(); fscanf(fp, "%d", &d); --- 58,71 ---- //drawing_mode(DRAW_MODE_TRANS, NULL, 0, 0); ! //win (0, lx-4, ly, rx + 10, ry + 20); for (c = 0; c <= endplane; c++) { ! /*sprintf(tmp, "Loading..."); textout(offscreen, font, tmp, lx + 2, ly + 2, whitec); rect (offscreen, lx, ly + 16, lx + w , ly + h + 16, whitec); rectfill (offscreen, lx + 2, ly + 16 + 2, lx + (w - 4) * (float)c / endplane, ly + h + 16 - 2, bluec); ! updscreen();*/ fscanf(fp, "%d", &d); *************** *** 154,158 **** fclose(fp); ! updscreen(); /*int a; --- 155,159 ---- fclose(fp); ! //updscreen(); /*int a; Index: render.cpp =================================================================== RCS file: /cvsroot/qb2c/goengine/src/engine/render.cpp,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** render.cpp 8 Nov 2004 14:17:36 -0000 1.16 --- render.cpp 8 Nov 2004 16:28:27 -0000 1.17 *************** *** 1,26 **** ! /* ! Generation Olympia Engine - C++ Port ! Project Home: http://www.sourceforge.net/projects/qb2c/ ! ! This program is free software; you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2 of the License, or ! (at your option) any later version. ! ! $Id$ ! */ ! ! #include <math.h> ! ! #include "engineglobals.h" #include "render.h" #include "fileinput.h" ! ! ! void calcpoints() ! { ! short sleft, sright, sup, sdown; ! float nsx, nsy, nsz, sx, sy, sz; ! float psx, psy, psz, wsx, wsy, wsz, d, xx, yy, zz; unsigned int i; --- 1,26 ---- ! /* ! Generation Olympia Engine - C++ Port ! Project Home: http://www.sourceforge.net/projects/qb2c/ ! ! This program is free software; you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2 of the License, or ! (at your option) any later version. ! ! $Id$ ! */ ! ! #include <math.h> ! ! #include "engineglobals.h" #include "render.h" #include "fileinput.h" ! ! ! void calcpoints() ! { ! short sleft, sright, sup, sdown; ! float nsx, nsy, nsz, sx, sy, sz; ! float psx, psy, psz, wsx, wsy, wsz, d, xx, yy, zz; unsigned int i; *************** *** 36,43 **** scy = scrny; ! sleft = -xc; ! sright = xr + xc; sup = -yc; ! sdown = yr + yc; npoints = 0; --- 36,43 ---- scy = scrny; ! sleft = -xr * 2; ! sright = xr * 3; sup = -yc; ! sdown = yr * 5; npoints = 0; *************** *** 63,71 **** psy = nsx * prexy + nsy * preyy + nsz * prezy; psz = nsx * prexz + nsy * preyz + nsz * prezz; ! ! for (i = 0; i != pointinfo.size(); i++) { if (!pointinfo[i].active) continue; ! wsx = 0; wsy = 0; --- 63,71 ---- psy = nsx * prexy + nsy * preyy + nsz * prezy; psz = nsx * prexz + nsy * preyz + nsz * prezz; ! ! for (i = 0; i != pointinfo.size(); i++) { if (!pointinfo[i].active) continue; ! wsx = 0; wsy = 0; *************** *** 103,109 **** ! nsx = pointinfo[i].nsx; ! nsy = pointinfo[i].nsy; ! nsz = pointinfo[i].nsz; sx = nsx + wsx + psx - camx; --- 103,109 ---- ! nsx = pointinfo[i].nsx; ! nsy = pointinfo[i].nsy; ! nsz = pointinfo[i].nsz; sx = nsx + wsx + psx - camx; *************** *** 116,125 **** pointinfo[i].psy = sy + vdist; pointinfo[i].psz = sz + vdist; ! ! pointinfo[i].flag = 1; ! ! if (sz == 0) sz = -.1; ! ! if (sz > -.5 && !generating_radiosity) continue; if (sz > -.5 && generating_radiosity) continue; --- 116,125 ---- pointinfo[i].psy = sy + vdist; pointinfo[i].psz = sz + vdist; ! ! pointinfo[i].flag = 1; ! ! if (sz == 0) sz = -.1; ! ! //if (sz > -.5 && !generating_radiosity) continue; if (sz > -.5 && generating_radiosity) continue; *************** *** 129,158 **** if (!generating_radiosity) { ! if (pointinfo[i].x < sleft || pointinfo[i].x > sright) continue; if (pointinfo[i].y < sup || pointinfo[i].y > sdown) continue; } ! ! pointinfo[i].scale = -sz * 75; ! pointinfo[i].flag = 0; ! npoints++; ! } ! } ! ! ! ! ! void calcsteps() ! { ! // Rel's performance addition to the QB engine (which seems to be unnecessary given ! // this post (http://forum.qbasicnews.com/viewtopic.php?p=46965#46965) by syn9) ! //Rotmatrix(camrx, camry, camrz); ! float stpc = stp; //if (generating_radiosity) stp = 2 * stp; ! rotpnt(-stp, 0, 0, 0, camry, 0, &prexx, &prexy, &prexz); ! rotpnt( 0, stp, 0, 0, camry, 0, &preyx, &preyy, &preyz); rotpnt( 0, 0, stp, 0, camry, 0, &prezx, &prezy, &prezz); --- 129,158 ---- if (!generating_radiosity) { ! if (pointinfo[i].x < sleft || pointinfo[i].x > sright) continue; if (pointinfo[i].y < sup || pointinfo[i].y > sdown) continue; } ! ! pointinfo[i].scale = -sz * 75; ! pointinfo[i].flag = 0; ! npoints++; ! } ! } ! ! ! ! ! void calcsteps() ! { ! // Rel's performance addition to the QB engine (which seems to be unnecessary given ! // this post (http://forum.qbasicnews.com/viewtopic.php?p=46965#46965) by syn9) ! //Rotmatrix(camrx, camry, camrz); ! float stpc = stp; //if (generating_radiosity) stp = 2 * stp; ! rotpnt(-stp, 0, 0, 0, camry, 0, &prexx, &prexy, &prexz); ! rotpnt( 0, stp, 0, 0, camry, 0, &preyx, &preyy, &preyz); rotpnt( 0, 0, stp, 0, camry, 0, &prezx, &prezy, &prezz); *************** *** 161,198 **** rotpnt(prezx, prezy, prezz, camrx, 0, 0, &prezx, &prezy, &prezz); ! stp = stpc; ! } ! ! ! ! ! // Update the fading state of the screen if necessary ! void fade() ! { ! if (current_fade_level != target_fade_level) ! { ! if (current_fade_level > target_fade_level) ! { ! // Fade out ! current_fade_level -= fade_speed; ! if (current_fade_level < target_fade_level) ! current_fade_level = target_fade_level; ! } ! else if (current_fade_level < target_fade_level) ! { ! // Fade in ! current_fade_level += fade_speed; ! if (current_fade_level > target_fade_level) ! current_fade_level = target_fade_level; ! } ! } ! ! if (current_fade_level < 1.0 && current_fade_level >= 0.0) ! { ! set_trans_blender(0,0,0, 255 - int(current_fade_level * 255)); ! drawing_mode(DRAW_MODE_TRANS, NULL, 0, 0); ! rectfill(offscreen, 0, 0, SCREEN_W, SCREEN_H, 0); ! drawing_mode(DRAW_MODE_SOLID, NULL, 0, 0); ! } } --- 161,198 ---- rotpnt(prezx, prezy, prezz, camrx, 0, 0, &prezx, &prezy, &prezz); ! stp = stpc; ! } ! ! ! ! ! // Update the fading state of the screen if necessary ! void fade() ! { ! if (current_fade_level != target_fade_level) ! { ! if (current_fade_level > target_fade_level) ! { ! // Fade out ! current_fade_level -= fade_speed; ! if (current_fade_level < target_fade_level) ! current_fade_level = target_fade_level; ! } ! else if (current_fade_level < target_fade_level) ! { ! // Fade in ! current_fade_level += fade_speed; ! if (current_fade_level > target_fade_level) ! current_fade_level = target_fade_level; ! } ! } ! ! if (current_fade_level < 1.0 && current_fade_level >= 0.0) ! { ! set_trans_blender(0,0,0, 255 - int(current_fade_level * 255)); ! drawing_mode(DRAW_MODE_TRANS, NULL, 0, 0); ! rectfill(offscreen, 0, 0, SCREEN_W, SCREEN_H, 0); ! drawing_mode(DRAW_MODE_SOLID, NULL, 0, 0); ! } } *************** *** 257,261 **** return (d - scrny); ! } void initialize(short bits, short mode, short xsize, short ysize) --- 257,261 ---- return (d - scrny); ! } void initialize(short bits, short mode, short xsize, short ysize) *************** *** 271,279 **** int gfx_mode; ! if (mode == 0) { ! gfx_mode = GFX_AUTODETECT_WINDOWED; ! } else { ! gfx_mode = GFX_AUTODETECT_FULLSCREEN; ! } xcenter = xres / 2; --- 271,279 ---- int gfx_mode; ! if (mode == 0) { ! gfx_mode = GFX_AUTODETECT_WINDOWED; ! } else { ! gfx_mode = GFX_AUTODETECT_FULLSCREEN; ! } xcenter = xres / 2; *************** *** 349,354 **** camrz = 0; - sgamma = 1; - scrny = short(-12 * xres / 320); --- 349,352 ---- *************** *** 361,396 **** } ! ! // Rel's performance additions to the QB engine ! void Rotmatrix(float AngleX, float AngleY, float AngleZ) ! { ! float rAnglex, rAngley, rAnglez, cx, cy, cz, sx, sy, sz; ! ! rAnglex = AngleX * rad; ! rAngley = AngleY * rad; ! rAnglez = AngleZ * rad; ! ! //Precalculate the SIN and COS of each angle ! cx = cos(rAnglex); ! sx = sin(rAnglex); ! cy = cos(rAngley); ! sy = sin(rAngley); ! cz = cos(rAnglez); ! sz = sin(rAnglez); ! ! //Transformation matrix formula ! ! tx1 = cy * cz; ! tx2 = cy * sz; ! tx3 = -sy; ! ty1 = cx * -sz + sx * sy * cz; ! ty2 = cx * cz + sx * sy * sz; ! ty3 = sx * cy; ! tz1 = -sx * -sz + cx * sy * cz; ! tz2 = -sx * cz + cz * sy * sz; ! tz3 = cx * cy; ! } ! ! void rotpnt(float px, float py, float pz, float xr, float yr, float zr, float* newx, float* newy, float* newz) { --- 359,394 ---- } ! ! // Rel's performance additions to the QB engine ! void Rotmatrix(float AngleX, float AngleY, float AngleZ) ! { ! float rAnglex, rAngley, rAnglez, cx, cy, cz, sx, sy, sz; ! ! rAnglex = AngleX * rad; ! rAngley = AngleY * rad; ! rAnglez = AngleZ * rad; ! ! //Precalculate the SIN and COS of each angle ! cx = cos(rAnglex); ! sx = sin(rAnglex); ! cy = cos(rAngley); ! sy = sin(rAngley); ! cz = cos(rAnglez); ! sz = sin(rAnglez); ! ! //Transformation matrix formula ! ! tx1 = cy * cz; ! tx2 = cy * sz; ! tx3 = -sy; ! ty1 = cx * -sz + sx * sy * cz; ! ty2 = cx * cz + sx * sy * sz; ! ty3 = sx * cy; ! tz1 = -sx * -sz + cx * sy * cz; ! tz2 = -sx * cz + cz * sy * sz; ! tz3 = cx * cy; ! } ! ! void rotpnt(float px, float py, float pz, float xr, float yr, float zr, float* newx, float* newy, float* newz) { *************** *** 411,458 **** ry3 = ry2; ! *newx = rx3; ! *newy = ry3; ! *newz = rz3; ! } ! ! void sortpolys() ! { ! int i = 0, p1, p2, p3; ! float nsx, nsy, nsz, psx, psy, psz; ! short x1, y1, x2, y2, x3, y3; ! float znormal; ! ! nsx = -focusofs[0]; ! nsy = -focusofs[1]; ! nsz = -focusofs[2]; ! ! psx = nsx * prexx + nsy * preyx + nsz * prezx; ! psy = nsx * prexy + nsy * preyy + nsz * prezy; ! psz = nsx * prexz + nsy * preyz + nsz * prezz; ! ! ! for(std::vector<poly_t>::const_iterator itr = polyinfo.begin(); itr != polyinfo.end(); ++itr, ++i) ! { ! bool b = pointinfo[ itr->p1].flag | pointinfo[ itr->p2].flag | pointinfo[ itr->p3].flag; ! ! if(!b) ! { ! p1 = polyinfo[i].p1; ! p2 = polyinfo[i].p2; p3 = polyinfo[i].p3; ! ! if (bfc) { ! x1 = short(pointinfo[p1].x); ! y1 = short(pointinfo[p1].y); ! x2 = short(pointinfo[p2].x); ! y2 = short(pointinfo[p2].y); ! x3 = short(pointinfo[p3].x); ! y3 = short(pointinfo[p3].y); ! znormal = (x2 - x1) * (y1 - y3) - (y2 - y1) * (x1 - x3); if (znormal < 0) continue; ! } if (generating_radiosity && (pointinfo[p1].sz > 0 && pointinfo[p2].sz > 0 && pointinfo[p3].sz > 0)) continue; --- 409,456 ---- ry3 = ry2; ! *newx = rx3; ! *newy = ry3; ! *newz = rz3; ! } ! ! void sortpolys() ! { ! int i = 0, p1, p2, p3; ! float nsx, nsy, nsz, psx, psy, psz; ! short x1, y1, x2, y2, x3, y3; ! float znormal; ! ! nsx = -focusofs[0]; ! nsy = -focusofs[1]; ! nsz = -focusofs[2]; ! ! psx = nsx * prexx + nsy * preyx + nsz * prezx; ! psy = nsx * prexy + nsy * preyy + nsz * prezy; ! psz = nsx * prexz + nsy * preyz + nsz * prezz; ! ! ! for(std::vector<poly_t>::const_iterator itr = polyinfo.begin(); itr != polyinfo.end(); ++itr, ++i) ! { ! bool b = pointinfo[ itr->p1].flag | pointinfo[ itr->p2].flag | pointinfo[ itr->p3].flag; ! ! if(!b) ! { ! p1 = polyinfo[i].p1; ! p2 = polyinfo[i].p2; p3 = polyinfo[i].p3; ! ! if (bfc) { ! x1 = short(pointinfo[p1].x); ! y1 = short(pointinfo[p1].y); ! x2 = short(pointinfo[p2].x); ! y2 = short(pointinfo[p2].y); ! x3 = short(pointinfo[p3].x); ! y3 = short(pointinfo[p3].y); ! znormal = (x2 - x1) * (y1 - y3) - (y2 - y1) * (x1 - x3); if (znormal < 0) continue; ! } if (generating_radiosity && (pointinfo[p1].sz > 0 && pointinfo[p2].sz > 0 && pointinfo[p3].sz > 0)) continue; *************** *** 462,488 **** if (generating_radiosity && (pointinfo[p1].y > yres && pointinfo[p2].y > yres && pointinfo[p3].y > yres)) continue; ! ! int ind = (int)(pointinfo[ itr->p1].scale + pointinfo[ itr->p2].scale + pointinfo[ itr->p3].scale) / 3; ! ! for(;;) ! { ! if (ind > vdist || ind < 0) ! break; ! ! if (dbuffer[ind] > 0) ! ind = ind + 1; ! if (dbuffer[ind] == 0) ! { ! dbuffer[ind] = i + 100; ! ! if (ind < start) ! start = ind; ! if (ind > depth) ! depth = ind; ! break; ! } ! } ! } ! } } --- 460,486 ---- if (generating_radiosity && (pointinfo[p1].y > yres && pointinfo[p2].y > yres && pointinfo[p3].y > yres)) continue; ! ! int ind = (int)(pointinfo[ itr->p1].scale + pointinfo[ itr->p2].scale + pointinfo[ itr->p3].scale) / 3; ! ! for(;;) ! { ! if (ind > vdist || ind < 0) ! break; ! ! if (dbuffer[ind] > 0) ! ind = ind + 1; ! if (dbuffer[ind] == 0) ! { ! dbuffer[ind] = i + 100; ! ! if (ind < start) ! start = ind; ! if (ind > depth) ! depth = ind; ! break; ! } ! } ! } ! } } *************** *** 499,503 **** return(d); } ! void updscreen() { --- 497,501 ---- return(d); } ! void updscreen() { *************** *** 516,520 **** blit(offscreen, screen, 0, 0, 0, 0, SCREEN_W, SCREEN_H); show_mouse(NULL); ! } short valid(short x, short y) --- 514,518 ---- blit(offscreen, screen, 0, 0, 0, 0, SCREEN_W, SCREEN_H); show_mouse(NULL); ! } short valid(short x, short y) *************** *** 529,536 **** else return(0); ! } ! ! void win(short l, short x1, short y1, short x2, short y2) ! { int mgreyc, lgreyc; --- 527,534 ---- else return(0); ! } ! ! void win(short l, short x1, short y1, short x2, short y2) ! { int mgreyc, lgreyc; *************** *** 564,569 **** } } ! ! } --- 562,567 ---- } } ! ! } Index: engineglobals.cpp =================================================================== RCS file: /cvsroot/qb2c/goengine/src/engine/engineglobals.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** engineglobals.cpp 8 Nov 2004 14:17:36 -0000 1.6 --- engineglobals.cpp 8 Nov 2004 16:28:27 -0000 1.7 *************** *** 1,80 **** ! /* ! Generation Olympia Engine - C++ Port ! Project Home: http://www.sourceforge.net/projects/qb2c/ ! ! This program is free software; you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2 of the License, or ! (at your option) any later version. ! ! $Id$ ! */ ! ! #include "engineglobals.h" ! ! ! std::vector<point_t> pointinfo; ! std::vector<poly_t> polyinfo; ! plane_t planeinfo[max_planes]; light_t lightinfo[max_lights]; short lights[max_lights][2]; int vdist, zm; ! char textureset[100], mapfile[100]; ! ! float camx, camy, camz, sgamma; short scrny; ! int lightres; ! ! float tx1, tx2, tx3; ! float ty1, ty2, ty3; ! float tz1, tz2, tz3; ! float stp; ! ! float rx0, rx1, rx2, rx3; ! float ry0, ry1, ry2, ry3; float rz0, rz1, rz2, rz3; float prexx, preyx, prezx; float prexy, preyy, prezy; ! float prexz, preyz, prezz; ! ! float camrx, camry, camrz; ! ! float basescrny; ! ! short bvsync = 1; ! ! short start, depth; ! ! short dbuffer[viewdist+1]; ! bool bfc, sound; ! short trigger[100]; short FPS = 0, fp, mapx, mapz, vispolys, npolies, npoints, refreshrate, nplanes, endplane, lastlight; ! double globaltime, timer, freeze; ! short nvtx; ! short vtx[256][6]; ! float fpsr, ripplex, ripplez, rippleamp, ripplefalloff, ripplewash; ! ! float current_fade_level = 1.0; // 0.0 = black; 1.0 = normal; ! float target_fade_level = 1.0; // the fade level we want to fade to ! float fade_speed = 0.04; // change per frame (should become per second) ! ! float fightfocus[3], focusofs[3]; ! ! BITMAP *textures[300]; ! BITMAP *sprites[128]; ! BITMAP *offscreen, *temp, *temp2; ! ! PALETTE pal; ! COLOR_MAP trans_table; ! ! int xres, xcenter, yres, ycenter, wideheight; ! float xzoomratio, yzoomratio; ! bool generating_radiosity, view_updated, use_joy; --- 1,82 ---- ! /* ! Generation Olympia Engine - C++ Port ! Project Home: http://www.sourceforge.net/projects/qb2c/ ! ! This program is free software; you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2 of the License, or ! (at your option) any later version. ! ! $Id$ ! */ ! ! #include "engineglobals.h" ! ! ! std::vector<point_t> pointinfo; ! std::vector<poly_t> polyinfo; ! plane_t planeinfo[max_planes]; light_t lightinfo[max_lights]; + plane_t camera[9]; + short lights[max_lights][2]; int vdist, zm; ! char textureset[100], mapfile[100]; ! ! float camx, camy, camz; short scrny; ! int lightres; ! ! float tx1, tx2, tx3; ! float ty1, ty2, ty3; ! float tz1, tz2, tz3; ! float stp; ! ! float rx0, rx1, rx2, rx3; ! float ry0, ry1, ry2, ry3; float rz0, rz1, rz2, rz3; float prexx, preyx, prezx; float prexy, preyy, prezy; ! float prexz, preyz, prezz; ! ! float camrx, camry, camrz; ! ! float basescrny; ! ! short bvsync = 1; ! ! short start, depth; ! ! short dbuffer[viewdist+1]; ! bool bfc, sound; ! short trigger[100]; short FPS = 0, fp, mapx, mapz, vispolys, npolies, npoints, refreshrate, nplanes, endplane, lastlight; ! double globaltime, timer, freeze; ! short nvtx; ! short vtx[256][6]; ! float fpsr, ripplex, ripplez, rippleamp, ripplefalloff, ripplewash; ! float current_fade_level = 1.0; // 0.0 = black; 1.0 = normal; ! float target_fade_level = 1.0; // the fade level we want to fade to ! float fade_speed = 0.04; // change per frame (should become per second) ! ! float fightfocus[3], focusofs[3]; ! ! BITMAP *textures[300]; ! BITMAP *sprites[128]; ! BITMAP *offscreen, *temp, *temp2; ! ! PALETTE pal; ! COLOR_MAP trans_table; ! ! int xres, xcenter, yres, ycenter, wideheight; ! float xzoomratio, yzoomratio; ! ! bool generating_radiosity; Index: engineglobals.h =================================================================== RCS file: /cvsroot/qb2c/goengine/src/engine/engineglobals.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** engineglobals.h 8 Nov 2004 14:17:36 -0000 1.6 --- engineglobals.h 8 Nov 2004 16:28:27 -0000 1.7 *************** *** 1,24 **** ! /* ! Generation Olympia Engine - C++ Port ! Project Home: http://www.sourceforge.net/projects/qb2c/ ! ! This program is free software; you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2 of the License, or ! (at your option) any later version. ! ! $Id$ ! */ ! ! #ifndef INCLUDED_ENGINEGLOBALS_HEADER ! #define INCLUDED_ENGINEGLOBALS_HEADER ! ! // The size of this file is exponentionaly propotional to the need of ! // refactoring ! ! ! #define pi 3.141592 ! #define rad pi / 180 ! #define viewdist 22999 #define yes 1 --- 1,24 ---- ! /* ! Generation Olympia Engine - C++ Port ! Project Home: http://www.sourceforge.net/projects/qb2c/ ! ! This program is free software; you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2 of the License, or ! (at your option) any later version. ! ! $Id$ ! */ ! ! #ifndef INCLUDED_ENGINEGLOBALS_HEADER ! #define INCLUDED_ENGINEGLOBALS_HEADER ! ! // The size of this file is exponentionaly propotional to the need of ! // refactoring ! ! ! #define pi 3.141592 ! #define rad pi / 180 ! #define viewdist 22999 #define yes 1 *************** *** 28,32 **** #define left 2 #define right 3 ! #define max_planes 200 #define max_polies 2200 --- 28,32 ---- #define left 2 #define right 3 ! #define max_planes 200 #define max_polies 2200 *************** *** 34,62 **** #define max_lights 200 ! #include <allegro.h> ! #include <vector> ! ! struct point_t ! { float nsx, nsy, nsz; float sz; ! float psx, psy, psz; float x, y; ! float xx, yy, zz, ybase; ! float scale;//guessing bool flag; bool active; ! int plane, point, water; ! }; ! ! struct poly_t ! { ! int p1, p2, p3; int tx; ! short u[3], v[3]; float nx, ny, nz; ! int plane, poly, clipped, trigger; ! }; ! extern std::vector<point_t> pointinfo; extern std::vector<poly_t> polyinfo; --- 34,62 ---- #define max_lights 200 ! #include <allegro.h> ! #include <vector> ! ! struct point_t ! { float nsx, nsy, nsz; float sz; ! float psx, psy, psz; float x, y; ! float xx, yy, zz, ybase; ! float scale;//guessing bool flag; bool active; ! int plane, point, water; ! }; ! ! struct poly_t ! { ! int p1, p2, p3; int tx; ! short u[3], v[3]; float nx, ny, nz; ! int plane, poly, clipped, trigger; ! }; ! extern std::vector<point_t> pointinfo; extern std::vector<poly_t> polyinfo; *************** *** 89,92 **** --- 89,94 ---- extern light_t lightinfo[max_lights]; + extern plane_t camera[9]; + extern short lights[max_lights][2]; extern int vdist, zm; *************** *** 94,98 **** extern char textureset[100], mapfile[100]; ! extern float camx, camy, camz, sgamma; extern short scrny; extern int lightres; --- 96,100 ---- extern char textureset[100], mapfile[100]; ! extern float camx, camy, camz; extern short scrny; extern int lightres; *************** *** 146,150 **** extern float xzoomratio, yzoomratio; ! extern bool generating_radiosity, view_updated, use_joy; ! ! #endif --- 148,152 ---- extern float xzoomratio, yzoomratio; ! extern bool generating_radiosity; ! ! #endif |
|
From: Daniel K. <sy...@us...> - 2004-11-08 16:28:38
|
Update of /cvsroot/qb2c/goengine/src/game In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18293/src/game Modified Files: game.cpp game.h gamefileinput.cpp gamefileinput.h gameglobals.cpp gameglobals.h goengine.cpp Log Message: Engine/Editor Updates added - door opening animation - brightness control for polies in editor - 'h' key can only affect selected polies in editor - camera hotspots / camera auto angling Index: goengine.cpp =================================================================== RCS file: /cvsroot/qb2c/goengine/src/game/goengine.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** goengine.cpp 8 Nov 2004 14:17:36 -0000 1.6 --- goengine.cpp 8 Nov 2004 16:28:27 -0000 1.7 *************** *** 1,25 **** ! /* ! Generation Olympia Engine - C++ Port ! Project Home: http://www.sourceforge.net/projects/qb2c/ ! ! This program is free software; you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2 of the License, or ! (at your option) any later version. ! ! $Id$ ! */ ! #include "../engine/engineglobals.h" #include "../engine/render.h" ! #include "../engine/fileinput.h" #include "gamefileinput.h" #include "gameglobals.h" #include "game.h" ! ! #include <stdio.h> ! #include <stdlib.h> ! #include <string.h> --- 1,25 ---- ! /* ! Generation Olympia Engine - C++ Port ! Project Home: http://www.sourceforge.net/projects/qb2c/ ! ! This program is free software; you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2 of the License, or ! (at your option) any later version. ! ! $Id$ ! */ ! #include "../engine/engineglobals.h" #include "../engine/render.h" ! #include "../engine/fileinput.h" #include "gamefileinput.h" #include "gameglobals.h" #include "game.h" ! ! #include <stdio.h> ! #include <stdlib.h> ! #include <string.h> *************** *** 59,63 **** camz = 66; camy = 3.5; ! camrx = 40; camry = 80; --- 59,63 ---- camz = 66; camy = 3.5; ! camrx = 30; camry = 80; *************** *** 72,75 **** --- 72,82 ---- view_updated = FALSE; zm = 40; + + automode = TRUE; + hud = TRUE; + + load_file_camera(); + + do { *************** *** 86,96 **** checkkbd(); ! ! drawpolys(); drawhud(); process_trigger(); updphysics(); if (!view_updated) updscreen(); --- 93,104 ---- checkkbd(); ! drawpolys(); drawhud(); + checkcam(); process_trigger(); updphysics(); + updcam(); if (!view_updated) updscreen(); *************** *** 99,110 **** clear_to_color(offscreen, 0); ! cycle = cycle + ripplewash * fpsr; ! ! while (cycle > 16) { cycle = cycle - 16; } ! ! ! planeinfo[50].zrot = u(planeinfo[50].zrot + 4 * 4 * fpsr); ! ! rotate_plane(50); } while (!key[KEY_F12] && !key[KEY_ESC]); --- 107,112 ---- clear_to_color(offscreen, 0); ! calcsteps(); ! setup_scene(); } while (!key[KEY_F12] && !key[KEY_ESC]); Index: gamefileinput.h =================================================================== RCS file: /cvsroot/qb2c/goengine/src/game/gamefileinput.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** gamefileinput.h 8 Nov 2004 14:17:36 -0000 1.3 --- gamefileinput.h 8 Nov 2004 16:28:27 -0000 1.4 *************** *** 20,23 **** --- 20,26 ---- void load_file_joypad(); void save_file_joypad(); + void save_file_camera(); + void load_file_camera(); + Index: game.cpp =================================================================== RCS file: /cvsroot/qb2c/goengine/src/game/game.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** game.cpp 8 Nov 2004 14:17:36 -0000 1.5 --- game.cpp 8 Nov 2004 16:28:27 -0000 1.6 *************** *** 1,22 **** ! /* ! Generation Olympia Engine - C++ Port ! Project Home: http://www.sourceforge.net/projects/qb2c/ ! ! This program is free software; you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2 of the License, or ! (at your option) any later version. ! ! $Id$ ! */ ! #include "../engine/fileinput.h" #include "../engine/engineglobals.h" ! #include "../engine/render.h" #include "gamefileinput.h" #include "gameglobals.h" ! #include "game.h" ! #include <math.h> --- 1,22 ---- ! /* ! Generation Olympia Engine - C++ Port ! Project Home: http://www.sourceforge.net/projects/qb2c/ ! ! This program is free software; you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2 of the License, or ! (at your option) any later version. ! ! $Id$ ! */ ! #include "../engine/fileinput.h" #include "../engine/engineglobals.h" ! #include "../engine/render.h" #include "gamefileinput.h" #include "gameglobals.h" ! #include "game.h" ! #include <math.h> *************** *** 78,84 **** } ! ! void checkkbd() ! { float ofs; --- 78,142 ---- } ! ! void checkcam() ! { ! float nsx, nsy, nsz, psx, psy, psz; ! int scx, scy, i; ! ! int whitec = makecol(255, 255, 255); ! ! for (i = 0; i < 9; i++) ! { ! if (camera[i].active) ! { ! nsx = camera[i].basex - focusofs[0]; ! nsy = camera[i].basey - focusofs[1]; ! nsz = camera[i].basez - focusofs[2]; ! ! psx = nsx * prexx + nsy * preyx + nsz * prezx - camx; ! psy = nsx * prexy + nsy * preyy + nsz * prezy - camy; ! psz = nsx * prexz + nsy * preyz + nsz * prezz - camz; ! ! scx = short(xcenter + psx / psz * xzoomratio); ! scy = short(ycenter + psy / psz * yzoomratio - scrny); ! ! circle(offscreen, scx, scy, camera[i].endx, whitec); ! } ! } ! ! if (key[KEY_1] && freeze < timer) setcam(0); ! if (key[KEY_2] && freeze < timer) setcam(1); ! if (key[KEY_3] && freeze < timer) setcam(2); ! if (key[KEY_4] && freeze < timer) setcam(3); ! if (key[KEY_5] && freeze < timer) setcam(4); ! if (key[KEY_6] && freeze < timer) setcam(5); ! if (key[KEY_7] && freeze < timer) setcam(6); ! if (key[KEY_8] && freeze < timer) setcam(7); ! if (key[KEY_9] && freeze < timer) setcam(8); ! ! ! if (key[KEY_TAB] && freeze < timer) ! { ! freeze = timer + .001 * fpsr; ! automode = !automode; ! } ! if (key[KEY_A] && freeze < timer) ! { ! freeze = timer + .001 * fpsr; ! save_file_camera(); ! } ! if (key[KEY_Z] && freeze < timer) ! { ! freeze = timer + .001 * fpsr; ! load_file_camera(); ! } ! ! ! ! } ! ! ! void checkkbd() ! { float ofs; *************** *** 130,134 **** ! if (key[KEY_F1]) gui_setkeys(); if (key[KEY_S] && freeze < timer) --- 188,197 ---- ! if (key[KEY_TILDE] && freeze < timer) ! { ! hud = !hud; ! freeze = timer + .001 * fpsr; ! } ! if (key[KEY_F1]) gui_setkeys(); if (key[KEY_S] && freeze < timer) *************** *** 291,295 **** //if (key[KEY_S]) save_file_simple("1"); ! } --- 354,358 ---- //if (key[KEY_S]) save_file_simple("1"); ! } *************** *** 318,328 **** //rectfill (offscreen, 0, yres - wideheight, xres - 1, yres - 1, 0); ! char tmp[100]; ! sprintf(tmp, "%f", pratio); ! ! textout(offscreen, font, tmp, 320, 10, whitec); //return; ! char fpstext[100]; char vistext[100]; --- 381,416 ---- //rectfill (offscreen, 0, yres - wideheight, xres - 1, yres - 1, 0); ! if (!hud) return; + char tmp[100]; + int i, c; + //return; ! win(0, 5, 38 + 16, 20 + text_length(font, "AutoCam ON "), 38+31); ! if (automode) textout(offscreen, font, "AutoCam ON", 10, 38+16+5, whitec); ! if (!automode) ! { ! textout(offscreen, font, "AutoCam OFF", 10, 38+16+5, whitec); ! c = 1; ! for (i = 0; i < 9; i++) ! { ! if (camera[i].active) c++; ! } ! win(0, 5, 38 + 32, 20 + text_length(font, "Active Cams"), 38+32 + 16 * c); ! textout(offscreen, font, "Active Cams", 10, 38 + 32 + 5, whitec); ! ! c = 0; ! for (i = 0; i < 9; i++) ! { ! if (camera[i].active) ! { ! c++; ! sprintf(tmp, " %d", i); ! textout(offscreen, font, tmp, 10, 38 + 32 + 5 + c * 16, whitec); ! } ! } ! ! } ! char fpstext[100]; char vistext[100]; *************** *** 332,336 **** sprintf(vistext, "%d/%d vis polys", vispolys, npolies); ! win(0, 5, 5, 11 + MAX(text_length(font, fpstext), text_length(font, vistext)), 37 + 16); text_mode(-1); --- 420,424 ---- sprintf(vistext, "%d/%d vis polys", vispolys, npolies); ! win(0, 5, 5, 20 + MAX(text_length(font, fpstext), text_length(font, vistext)), 37 + 16); text_mode(-1); *************** *** 345,350 **** textout(offscreen, font, tmp, 10, 34, whitec); } ! void drawpolys() --- 433,439 ---- textout(offscreen, font, tmp, 10, 34, whitec); + } ! void drawpolys() *************** *** 463,467 **** ! void drawsprite(short spritenum) { --- 552,556 ---- ! void drawsprite(short spritenum) { *************** *** 819,822 **** --- 908,912 ---- int p; char tmp[100]; + float sx; p = getpixel(triggerbmp, 24, 24); *************** *** 824,842 **** if (p > 999) { ! sprintf(tmp, "%d", (short)triggerinfo[p][0]); ! load_file_v1(tmp); ! setup_scene(); ! playerx = triggerinfo[p][1]; ! playery = triggerinfo[p][2]; ! playerz = triggerinfo[p][3]; ! focusofs[0] = playerx; ! focusofs[1] = playery; ! focusofs[2] = playerz; ! fightfocus[0] = playerx; ! fightfocus[1] = playery; ! fightfocus[2] = playerz; } } --- 914,967 ---- if (p > 999) { ! if (triggerinfo[p][4] == 1) ! { ! //focusofs[0] = focusofs[0] + (fightfocus[0] - focusofs[0]) * .09 * fpsr; ! sx = planeinfo[(short)triggerinfo[p][5]].yrot; ! sx = sx + (-80 - sx) * .05 * fpsr; ! ! planeinfo[(short)triggerinfo[p][5]].yrot = sx; ! ! //planeinfo[(short)triggerinfo[p][5]].yrot = planeinfo[(short)triggerinfo[p][5]].yrot u(planeinfo[(short)triggerinfo[p][5]].yrot - 275) ! rotate_plane((short)triggerinfo[p][5]); ! ! if (sx > -85 && sx < -75) ! { ! sprintf(tmp, "%d", (short)triggerinfo[p][0]); ! load_file_v1(tmp); ! setup_scene(); ! load_file_camera(); ! ! playerx = triggerinfo[p][1]; ! playery = triggerinfo[p][2]; ! playerz = triggerinfo[p][3]; ! focusofs[0] = playerx; ! focusofs[1] = playery; ! focusofs[2] = playerz; ! fightfocus[0] = playerx; ! fightfocus[1] = playery; ! fightfocus[2] = playerz; ! } ! ! } else { ! sprintf(tmp, "%d", (short)triggerinfo[p][0]); ! load_file_v1(tmp); ! setup_scene(); ! load_file_camera(); ! ! playerx = triggerinfo[p][1]; ! playery = triggerinfo[p][2]; ! playerz = triggerinfo[p][3]; ! ! focusofs[0] = playerx; ! focusofs[1] = playery; ! focusofs[2] = playerz; ! ! fightfocus[0] = playerx; ! fightfocus[1] = playery; ! fightfocus[2] = playerz; ! } } } *************** *** 861,868 **** } ! calcsteps(); ! setup_scene(); } void setup_scene() { --- 986,1004 ---- } ! } + void setcam(int camnum) + { + freeze = timer + .001 * fpsr; + camera[camnum].active = !camera[camnum].active; + camera[camnum].basex = playerx; + camera[camnum].basey = playery; + camera[camnum].basez = playerz; + camera[camnum].xrot = camrx; + camera[camnum].yrot = camry; + camera[camnum].zrot = camrz; } + + void setup_scene() { *************** *** 994,1004 **** } ! ! ! void updphysics() ! { ! focusofs[0] = focusofs[0] + (fightfocus[0] - focusofs[0]) * .09 * fpsr; ! focusofs[1] = focusofs[1] + (fightfocus[1] - focusofs[1]) * .09 * fpsr; focusofs[2] = focusofs[2] + (fightfocus[2] - focusofs[2]) * .09 * fpsr; ! } --- 1130,1207 ---- } ! ! void updcam() ! { ! int c = 0, i; ! float d, mx = 0, my = 0, mz = 0, sx, sy, sz; ! ! if (automode) ! { ! for (i = 0; i < 9; i++) ! { ! if (camera[i].active) ! { ! c++; ! sx = playerx - camera[i].basex; ! sy = playery - camera[i].basey; ! sz = playerz - camera[i].basez; ! d = sqrt(sx * sx + sy * sy + sz * sz); ! ! d = d * d; ! if (d < 1) d = 1; ! ! ! mx += camera[i].xrot; ! my += camera[i].yrot; ! mz += camera[i].zrot; ! ! d = 1 / d; ! if (d < .1) d = 0; ! camera[i].endx = d; ! ! ! } ! } ! ! ! ! mx /= c; ! my /= c; ! mz /= c; ! ! float ax, ay, az; ! ! for (i = 0; i < 9; i++) ! { ! if (camera[i].active) ! { ! ax = camera[i].xrot; ! ay = camera[i].yrot; ! az = camera[i].zrot; ! ! ax = (camrx - ax) * camera[i].endx; ! ay = (camry - ay) * camera[i].endx; ! az = (camrz - az) * camera[i].endx; ! camrx = u(camrx - ax); ! camry = u(camry - ay); ! camrz = u(camrz - az); ! } ! } ! } ! } ! ! ! void updphysics() ! { ! focusofs[0] = focusofs[0] + (fightfocus[0] - focusofs[0]) * .09 * fpsr; ! focusofs[1] = focusofs[1] + (fightfocus[1] - focusofs[1]) * .09 * fpsr; focusofs[2] = focusofs[2] + (fightfocus[2] - focusofs[2]) * .09 * fpsr; ! ! cycle = cycle + ripplewash * fpsr; ! while (cycle > 16) { cycle = cycle - 16; } ! ! planeinfo[50].zrot = u(planeinfo[50].zrot + 4 * 4 * fpsr); ! rotate_plane(50); ! ! } Index: gameglobals.cpp =================================================================== RCS file: /cvsroot/qb2c/goengine/src/game/gameglobals.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** gameglobals.cpp 8 Nov 2004 14:17:36 -0000 1.2 --- gameglobals.cpp 8 Nov 2004 16:28:27 -0000 1.3 *************** *** 1,22 **** ! /* ! Generation Olympia Engine - C++ Port ! Project Home: http://www.sourceforge.net/projects/qb2c/ ! ! This program is free software; you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2 of the License, or ! (at your option) any later version. ! ! $Id$ ! */ ! ! #include "gameglobals.h" ! ! float playerx, playery, playerz, pratio; ! short pscx, pscy; ! ! short npcs, walkdir, curstatus; ! float curframe, triggerinfo[10000][9], cycle; ! short gameflags[10000]; --- 1,22 ---- ! /* ! Generation Olympia Engine - C++ Port ! Project Home: http://www.sourceforge.net/projects/qb2c/ ! ! This program is free software; you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2 of the License, or ! (at your option) any later version. ! ! $Id$ ! */ ! ! #include "gameglobals.h" ! ! float playerx, playery, playerz, pratio; ! short pscx, pscy; ! ! short npcs, walkdir, curstatus; ! float curframe, triggerinfo[10000][9], cycle; ! short gameflags[10000]; *************** *** 27,30 **** BITMAP *surroundbmp, *surroundcbmp, *triggerbmp; ! BITMAP *frames[num_characters][num_animations][4][6]; ! --- 27,31 ---- BITMAP *surroundbmp, *surroundcbmp, *triggerbmp; ! BITMAP *frames[num_characters][num_animations][4][6]; ! ! bool automode, view_updated, use_joy, hud; \ No newline at end of file Index: gameglobals.h =================================================================== RCS file: /cvsroot/qb2c/goengine/src/game/gameglobals.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** gameglobals.h 8 Nov 2004 14:17:36 -0000 1.2 --- gameglobals.h 8 Nov 2004 16:28:27 -0000 1.3 *************** *** 1,19 **** ! /* ! Generation Olympia Engine - C++ Port ! Project Home: http://www.sourceforge.net/projects/qb2c/ ! ! This program is free software; you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2 of the License, or ! (at your option) any later version. ! ! $Id$ ! */ ! ! #ifndef INCLUDED_GAMEGLOBALS_HEADER ! #define INCLUDED_GAMEGLOBALS_HEADER ! ! // The size of this file is exponentionaly propotional to the need of ! // refactoring #include <allegro.h> --- 1,19 ---- ! /* ! Generation Olympia Engine - C++ Port ! Project Home: http://www.sourceforge.net/projects/qb2c/ ! ! This program is free software; you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2 of the License, or ! (at your option) any later version. ! ! $Id$ ! */ ! ! #ifndef INCLUDED_GAMEGLOBALS_HEADER ! #define INCLUDED_GAMEGLOBALS_HEADER ! ! // The size of this file is exponentionaly propotional to the need of ! // refactoring #include <allegro.h> *************** *** 23,28 **** #define status_standing 0 #define status_walking 1 ! #define status_attacking 0 ! extern float playerx, playery, playerz, pratio; extern short pscx, pscy; --- 23,28 ---- #define status_standing 0 #define status_walking 1 ! #define status_attacking 0 ! extern float playerx, playery, playerz, pratio; extern short pscx, pscy; *************** *** 39,43 **** extern BITMAP *surroundbmp, *surroundcbmp, *triggerbmp; ! extern BITMAP *frames[num_characters][num_animations][4][6]; ! ! #endif --- 39,45 ---- extern BITMAP *surroundbmp, *surroundcbmp, *triggerbmp; ! extern BITMAP *frames[num_characters][num_animations][4][6]; ! ! extern bool automode, view_updated, use_joy, hud; ! ! #endif Index: game.h =================================================================== RCS file: /cvsroot/qb2c/goengine/src/game/game.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** game.h 8 Nov 2004 14:17:36 -0000 1.3 --- game.h 8 Nov 2004 16:28:27 -0000 1.4 *************** *** 1,19 **** ! /* ! Generation Olympia Engine - C++ Port ! Project Home: http://www.sourceforge.net/projects/qb2c/ ! ! This program is free software; you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2 of the License, or ! (at your option) any later version. ! ! $Id$ ! */ ! ! #ifndef INCLUDED_GAME_HEADER ! #define INCLUDED_GAME_HEADER ! void calcsprites(); void checkkbd(); void cleanup_scene(); --- 1,20 ---- ! /* ! Generation Olympia Engine - C++ Port ! Project Home: http://www.sourceforge.net/projects/qb2c/ ! ! This program is free software; you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2 of the License, or ! (at your option) any later version. ! ! $Id$ ! */ ! ! #ifndef INCLUDED_GAME_HEADER ! #define INCLUDED_GAME_HEADER ! void calcsprites(); + void checkcam(); void checkkbd(); void cleanup_scene(); *************** *** 26,32 **** void process_trigger(); void rotate_plane(int planenum); ! void setup_scene(); ! void updphysics(); ! ! ! #endif --- 27,35 ---- void process_trigger(); void rotate_plane(int planenum); ! void setcam(int camnum); ! void setup_scene(); ! void updcam(); ! void updphysics(); ! ! ! #endif Index: gamefileinput.cpp =================================================================== RCS file: /cvsroot/qb2c/goengine/src/game/gamefileinput.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** gamefileinput.cpp 8 Nov 2004 14:17:36 -0000 1.3 --- gamefileinput.cpp 8 Nov 2004 16:28:27 -0000 1.4 *************** *** 348,349 **** --- 348,420 ---- + void save_file_camera() + { + + FILE *fp; + + char tmp[100]; + sprintf(tmp, "data/maps/%s.cam", mapfile); + + fp = fopen(tmp, "w"); + + + int a; + + for (a = 0; a < 9; a++) + { + fprintf(fp, "%d\n", camera[a].active); + fprintf(fp, "%f\n", camera[a].basex); + fprintf(fp, "%f\n", camera[a].basey); + fprintf(fp, "%f\n", camera[a].basez); + fprintf(fp, "%f\n", camera[a].xrot); + fprintf(fp, "%f\n", camera[a].yrot); + fprintf(fp, "%f\n", camera[a].zrot); + } + + + fclose(fp); + } + + void load_file_camera() + { + FILE *fp; + int a; + + //fp = fopen("cam.dat", "r"); + + + char tmp[100]; + sprintf(tmp, "data/maps/%s.cam", mapfile); + + if (!exists(tmp)) + { + fp = fopen(tmp, "w"); + for (a = 0; a < 9; a++) + { + fprintf(fp, "0\n"); + fprintf(fp, "0\n"); + fprintf(fp, "0\n"); + fprintf(fp, "0\n"); + fprintf(fp, "0\n"); + fprintf(fp, "0\n"); + fprintf(fp, "0\n"); + } + fclose(fp); + } + fp = fopen(tmp, "r"); + + + for (a = 0; a < 9; a++) + { + fscanf(fp, "%d", &camera[a].active); + fscanf(fp, "%f", &camera[a].basex); + fscanf(fp, "%f", &camera[a].basey); + fscanf(fp, "%f", &camera[a].basez); + fscanf(fp, "%f", &camera[a].xrot); + fscanf(fp, "%f", &camera[a].yrot); + fscanf(fp, "%f", &camera[a].zrot); + } + fclose(fp); + + } + |
|
From: Daniel K. <sy...@us...> - 2004-11-08 16:28:36
|
Update of /cvsroot/qb2c/goengine/data In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18293/data Modified Files: .cvsignore Log Message: Engine/Editor Updates added - door opening animation - brightness control for polies in editor - 'h' key can only affect selected polies in editor - camera hotspots / camera auto angling Index: .cvsignore =================================================================== RCS file: /cvsroot/qb2c/goengine/data/.cvsignore,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** .cvsignore 22 Dec 2003 19:35:02 -0000 1.1 --- .cvsignore 8 Nov 2004 16:28:26 -0000 1.2 *************** *** 3,4 **** --- 3,8 ---- maps textureset + mouse.pcx + joypad.dat + mouse.bmp + triggers.dat \ No newline at end of file |
|
From: Daniel K. <sy...@us...> - 2004-11-08 16:28:36
|
Update of /cvsroot/qb2c/goengine/src/editor In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18293/src/editor Modified Files: mapedit.cpp mapeditglobals.h Log Message: Engine/Editor Updates added - door opening animation - brightness control for polies in editor - 'h' key can only affect selected polies in editor - camera hotspots / camera auto angling Index: mapedit.cpp =================================================================== RCS file: /cvsroot/qb2c/goengine/src/editor/mapedit.cpp,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** mapedit.cpp 8 Nov 2004 14:17:35 -0000 1.16 --- mapedit.cpp 8 Nov 2004 16:28:27 -0000 1.17 *************** *** 1,22 **** ! /* ! Generation Olympia Engine - C++ Port ! Project Home: http://www.sourceforge.net/projects/qb2c/ ! ! This program is free software; you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2 of the License, or ! (at your option) any later version. ! ! $Id$ ! */ ! ! #include <math.h> ! #include "../engine/fileinput.h" #include "../engine/engineglobals.h" ! #include "../engine/render.h" #include "mapeditfileinput.h" ! #include "mapeditgui.h" #include "mapeditglobals.h" #include "mapedit.h" --- 1,22 ---- ! /* ! Generation Olympia Engine - C++ Port ! Project Home: http://www.sourceforge.net/projects/qb2c/ ! ! This program is free software; you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2 of the License, or ! (at your option) any later version. ! ! $Id$ ! */ ! ! #include <math.h> ! #include "../engine/fileinput.h" #include "../engine/engineglobals.h" ! #include "../engine/render.h" #include "mapeditfileinput.h" ! #include "mapeditgui.h" #include "mapeditglobals.h" #include "mapedit.h" *************** *** 99,130 **** } ! ! void checkkbd() { 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) --- 99,138 ---- } ! ! void checkkbd() { short a, b, c, p; ! int i, j; if (key[KEY_H]) { ! if (nselpoly == 0) { ! 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); ! } } } } + } else { + for (j = 0; j <= nselpoly; j++) + { + if (planeinfo[selplane].polyinfo[selpoly[j]][6] == 0) blit (textures[planeinfo[selplane].polyinfo[selpoly[j]][3]], planeinfo[selplane].radiosity[selpoly[j]], 0, 0, 0, 0, 16, 16); + } } } + if (key[KEY_TAB] && freeze < timer) *************** *** 181,185 **** } ! if (key[KEY_F5] && freeze < timer) --- 189,193 ---- } ! if (key[KEY_F5] && freeze < timer) *************** *** 574,578 **** } ! } --- 582,586 ---- } ! } *************** *** 633,636 **** --- 641,645 ---- int ofs, c, b, i, a, p; int newplane; + int nr, ng, nb; float nx, ny, nz, sx, sy, sz, x, y, z; *************** *** 1306,1317 **** } ! if (editingmode == modify_poly || editingmode >= modify_poly_trigger && editingmode < 830) { ! if (editingmode == modify_poly_trigger) win(1, 256, 24 + 12 * 15, 423, 35 + 12 * 15); ! if (editingmode != modify_poly_trigger) win(0, 256, 24 + 12 * 15, 423, 35 + 12 * 15); sprintf(tmptxt, "7 Trigger"); textout(offscreen, font, tmptxt, 260, 24 + 12 * 15 + 2, whitec); } if (editingmode == modify_poly && freeze < timer) { --- 1315,1396 ---- } ! if (editingmode == modify_poly || editingmode >= modify_poly_trigger && editingmode < modify_poly_brightness) { ! if (editingmode == modify_poly_trigger) win(1, 256, 24 + 12 * 15, 383, 35 + 12 * 15); ! if (editingmode != modify_poly_trigger) win(0, 256, 24 + 12 * 15, 383, 35 + 12 * 15); sprintf(tmptxt, "7 Trigger"); textout(offscreen, font, tmptxt, 260, 24 + 12 * 15 + 2, whitec); } + if (editingmode == modify_poly || editingmode >= modify_poly_brightness && editingmode < 830) + { + if (editingmode == modify_poly_trigger) win(1, 256, 24 + 12 * 16, 383, 35 + 12 * 16); + if (editingmode != modify_poly_trigger) win(0, 256, 24 + 12 * 16, 383, 35 + 12 * 16); + sprintf(tmptxt, "8 Brightness"); + textout(offscreen, font, tmptxt, 260, 24 + 12 * 16 + 2, whitec); + + if (editingmode == modify_poly_brightness) + { + win(0, 384, 24 + 12 * 16, 511, 35 + 12 * 16); + sprintf(tmptxt, "+ Brighter"); + textout(offscreen, font, tmptxt, 388, 24 + 12 * 16 + 2, whitec); + + win(0, 384, 24 + 12 * 17, 511, 35 + 12 * 17); + sprintf(tmptxt, "- Darker"); + textout(offscreen, font, tmptxt, 388, 24 + 12 * 17 + 2, whitec); + + if (freeze < timer) + { + if ((mouse_b & 1 && checkmouse(384, 24 + 12 * 16, 511, 35 + 12 * 16)) || key[KEY_PLUS_PAD]) + { + for (i = 0; i < nselpoly; i++) + { + for (nx = 0; nx < 16; nx++) + { + for (ny = 0; ny < 16; ny++) + { + c = getpixel(planeinfo[selplane].radiosity[selpoly[i]], nx, ny); + nr = getr(c) * 1.1; + ng = getg(c) * 1.1; + nb = getb(c) * 1.1; + + if (nr > 255) nr = 255; + if (ng > 255) ng = 255; + if (nb > 255) nb = 255; + + putpixel(planeinfo[selplane].radiosity[selpoly[i]], nx, ny, makecol(nr, ng, nb)); + } + } + //planeinfo[selplane].polyinfo[selpoly[c]][6]; + } + freeze = timer + .002 * fpsr; + } + if ((mouse_b & 1 && checkmouse(384, 24 + 12 * 17, 511, 35 + 12 * 17)) || key[KEY_MINUS_PAD]) + { + for (i = 0; i < nselpoly; i++) + { + for (nx = 0; nx < 16; nx++) + { + for (ny = 0; ny < 16; ny++) + { + c = getpixel(planeinfo[selplane].radiosity[selpoly[i]], nx, ny); + nr = getr(c) * .9; + ng = getg(c) * .9; + nb = getb(c) * .9; + + if (nr < 0) nr = 0; + if (ng < 0) ng = 0; + if (nb < 0) nb = 0; + + putpixel(planeinfo[selplane].radiosity[selpoly[i]], nx, ny, makecol(nr, ng, nb)); + } + } + } + freeze = timer + .002 * fpsr; + } + } + } + } + if (editingmode == modify_poly && freeze < timer) { *************** *** 1358,1362 **** freeze = timer + .002 * fpsr; } ! if ((mouse_b & 1 && checkmouse(256, 24 + 12 * 15, 423, 35 + 12 * 15)) || key[KEY_7]) editingmode = modify_poly_trigger; } } --- 1437,1446 ---- freeze = timer + .002 * fpsr; } ! if ((mouse_b & 1 && checkmouse(256, 24 + 12 * 15, 383, 35 + 12 * 15)) || key[KEY_7]) editingmode = modify_poly_trigger; ! if ((mouse_b & 1 && checkmouse(256, 24 + 12 * 16, 383, 35 + 12 * 16)) || key[KEY_8]) ! { ! editingmode = modify_poly_brightness; ! freeze = timer + .002 * fpsr; ! } } } *************** *** 1636,1641 **** 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]); --- 1720,1725 ---- 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]); *************** *** 1723,1727 **** for (c = 0; c <= planeinfo[tselplane].lastpoint; c++) { ! if (planeinfo[tselplane].pointinfo[c][7] == 0) { --- 1807,1811 ---- for (c = 0; c <= planeinfo[tselplane].lastpoint; c++) { ! if (planeinfo[tselplane].pointinfo[c][7] == 0) { *************** *** 1732,1736 **** if (pointinfo[p].y > farbottom && pointinfo[p].y < yres) farbottom = short(pointinfo[p].y); } ! } surroundbox(1, farleft, fartop, farright, farbottom); --- 1816,1820 ---- if (pointinfo[p].y > farbottom && pointinfo[p].y < yres) farbottom = short(pointinfo[p].y); } ! } surroundbox(1, farleft, fartop, farright, farbottom); *************** *** 1913,1923 **** 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; --- 1997,2007 ---- 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; *************** *** 2430,2434 **** } ! void drawpolys() --- 2514,2518 ---- } ! void drawpolys() *************** *** 2438,2442 **** short u[3], v[3]; int trans = makecol(255, 0, 255); ! unsigned int c; V3D_f v1, v2, v3, vv1, vv2, vv3; --- 2522,2526 ---- short u[3], v[3]; int trans = makecol(255, 0, 255); ! unsigned int c; V3D_f v1, v2, v3, vv1, vv2, vv3; *************** *** 2604,2609 **** 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); --- 2688,2693 ---- 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); *************** *** 2822,2826 **** } ! void drawsprite(short spritenum) { --- 2906,2910 ---- } ! void drawsprite(short spritenum) { *************** *** 2841,2845 **** 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]; --- 2925,2929 ---- 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]; *************** *** 2935,2947 **** for (an = 0; an < 6; an++) { ! float xr = 0.0f, zr = 0.0f, yr = 0.0f; ! ! switch (an) { ! case 1: xr = 90.0f; break; ! case 2: xr = 180.0f; break; ! case 3: xr = 270.0f; break; ! case 4: yr = 90.0f; break; ! case 5: yr = 270.0f; break; ! } camrx = xr; --- 3019,3031 ---- for (an = 0; an < 6; an++) { ! float xr = 0.0f, zr = 0.0f, yr = 0.0f; ! ! switch (an) { ! case 1: xr = 90.0f; break; ! case 2: xr = 180.0f; break; ! case 3: xr = 270.0f; break; ! case 4: yr = 90.0f; break; ! case 5: yr = 270.0f; break; ! } camrx = xr; *************** *** 3192,3198 **** for (y = 0; y < 16; y++) { ! short old_r, old_g, old_b; ! int color; ! nr = 0; ng = 0; --- 3276,3282 ---- for (y = 0; y < 16; y++) { ! short old_r, old_g, old_b; ! int color; ! nr = 0; ng = 0; *************** *** 3657,3661 **** float nsx, nsy, nsz; ! int a, c, x , y, lightnum; point_t tpoint; --- 3741,3745 ---- float nsx, nsy, nsz; ! int a, c, x , y, lightnum; point_t tpoint; *************** *** 3707,3713 **** if (planeinfo[c].polyinfo[a][6] < 2) { ! tpoly.p1 = int(planeinfo[c].pointinfo[planeinfo[c].polyinfo[a][0]][6]); ! tpoly.p2 = int(planeinfo[c].pointinfo[planeinfo[c].polyinfo[a][1]][6]); ! tpoly.p3 = int(planeinfo[c].pointinfo[planeinfo[c].polyinfo[a][2]][6]); tpoly.tx = planeinfo[c].polyinfo[a][3]; tpoly.u[0] = planeinfo[c].polyvtx[a][0]; --- 3791,3797 ---- if (planeinfo[c].polyinfo[a][6] < 2) { ! tpoly.p1 = int(planeinfo[c].pointinfo[planeinfo[c].polyinfo[a][0]][6]); ! tpoly.p2 = int(planeinfo[c].pointinfo[planeinfo[c].polyinfo[a][1]][6]); ! tpoly.p3 = int(planeinfo[c].pointinfo[planeinfo[c].polyinfo[a][2]][6]); tpoly.tx = planeinfo[c].polyinfo[a][3]; tpoly.u[0] = planeinfo[c].polyvtx[a][0]; *************** *** 3780,3791 **** line (offscreen, farleft - clearance, farbottom + clearance, farleft - clearance, farbottom + clearance - qy, whitec); line (offscreen, farleft - clearance, farbottom + clearance, farleft - clearance + qx, farbottom + clearance, whitec); ! } ! ! void updphysics() { ! focusofs[0] = focusofs[0] + (fightfocus[0] - focusofs[0]) * .08 * fpsr; ! focusofs[1] = focusofs[1] + (fightfocus[1] - focusofs[1]) * .08 * fpsr; focusofs[2] = focusofs[2] + (fightfocus[2] - focusofs[2]) * .08 * fpsr; ! } --- 3864,3875 ---- line (offscreen, farleft - clearance, farbottom + clearance, farleft - clearance, farbottom + clearance - qy, whitec); line (offscreen, farleft - clearance, farbottom + clearance, farleft - clearance + qx, farbottom + clearance, whitec); ! } ! ! void updphysics() { ! focusofs[0] = focusofs[0] + (fightfocus[0] - focusofs[0]) * .08 * fpsr; ! focusofs[1] = focusofs[1] + (fightfocus[1] - focusofs[1]) * .08 * fpsr; focusofs[2] = focusofs[2] + (fightfocus[2] - focusofs[2]) * .08 * fpsr; ! } Index: mapeditglobals.h =================================================================== RCS file: /cvsroot/qb2c/goengine/src/editor/mapeditglobals.h,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** mapeditglobals.h 8 Nov 2004 14:17:35 -0000 1.8 --- mapeditglobals.h 8 Nov 2004 16:28:27 -0000 1.9 *************** *** 1,19 **** ! /* ! Generation Olympia Engine - C++ Port ! Project Home: http://www.sourceforge.net/projects/qb2c/ ! ! This program is free software; you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2 of the License, or ! (at your option) any later version. ! ! $Id$ ! */ ! ! #ifndef INCLUDED_MAPEDITGLOBALS_HEADER ! #define INCLUDED_MAPEDITGLOBALS_HEADER ! ! // The size of this file is exponentionaly propotional to the need of ! // refactoring #define sys 001 --- 1,19 ---- ! /* ! Generation Olympia Engine - C++ Port ! Project Home: http://www.sourceforge.net/projects/qb2c/ ! ! This program is free software; you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2 of the License, or ! (at your option) any later version. ! ! $Id$ ! */ ! ! #ifndef INCLUDED_MAPEDITGLOBALS_HEADER ! #define INCLUDED_MAPEDITGLOBALS_HEADER ! ! // The size of this file is exponentionaly propotional to the need of ! // refactoring #define sys 001 *************** *** 61,64 **** --- 61,65 ---- #define modify_poly_transperant 826 #define modify_poly_trigger 827 + #define modify_poly_brightness 828 *************** *** 87,91 **** #define max_points 2000 #define max_lights 200 ! extern float playerx, playery, playerz, pratio; extern short pscx, pscy; --- 88,92 ---- #define max_points 2000 #define max_lights 200 ! extern float playerx, playery, playerz, pratio; extern short pscx, pscy; *************** *** 93,98 **** 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; --- 94,99 ---- 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; *************** *** 109,113 **** extern short gameflags[10000]; ! extern short editingmode; extern BITMAP *screenbuffer; --- 110,114 ---- extern short gameflags[10000]; ! extern short editingmode; extern BITMAP *screenbuffer; *************** *** 122,125 **** extern bool hud; ! ! #endif --- 123,126 ---- extern bool hud; ! ! #endif |
|
From: Bjørn L. <b_l...@us...> - 2004-11-08 14:17:49
|
Update of /cvsroot/qb2c/goengine/src/game In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19117/game Modified Files: game.cpp game.h gamefileinput.cpp gamefileinput.h gameglobals.cpp gameglobals.h goengine.cpp Log Message: Committing changes made by syn9 after resolving numerous conflicts throughout the code. Index: goengine.cpp =================================================================== RCS file: /cvsroot/qb2c/goengine/src/game/goengine.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** goengine.cpp 20 Jan 2004 18:19:27 -0000 1.5 --- goengine.cpp 8 Nov 2004 14:17:36 -0000 1.6 *************** *** 33,41 **** printf("Initializing game data...\n"); ! initialize(0, 800, 600); ! gameinit(); load_file_v1("1"); calcsteps(); --- 33,64 ---- printf("Initializing game data...\n"); ! initialize(24, 0, 640, 480); ! gameinit(); + updscreen(); + + calcsteps(); + load_triggers_v1(); + load_file_v1("1"); + setup_scene(); + + playerx = -4; + playery = 0; + playerz = 2; + + focusofs[0] = playerx; + focusofs[1] = playery; + focusofs[2] = playerz; + + fightfocus[0] = playerx; + fightfocus[1] = playery; + fightfocus[2] = playerz; + + camz = 66; + camy = 3.5; + camrx = 40; + camry = 80; calcsteps(); *************** *** 44,73 **** printf("Game data initialized, starting main loop...\n"); ! globaltime = time(NULL) + 1; ! ! ! calcsteps(); do { ! poll_keyboard(); ! poll_mouse(); ! ! start = vdist; ! depth = 0; calcpoints(); sortpolys(); drawpolys(); drawhud(); ! checkkbd(); ! updphysics(); ! updscreen(); ! clear(offscreen); ! } while (!key[KEY_F12]); deinit(); --- 67,112 ---- printf("Game data initialized, starting main loop...\n"); ! updphysics(); + vdist = viewdist; + view_updated = FALSE; + zm = 40; do { + poll_keyboard(); + if (use_joy) poll_joystick(); ! start = vdist; ! depth = 0; calcpoints(); + calcsprites(); + sortpolys(); + + checkkbd(); + + drawpolys(); drawhud(); ! ! process_trigger(); ! updphysics(); + if (!view_updated) updscreen(); + + //clear_to_color(offscreen, ambientc); + clear_to_color(offscreen, 0); ! cycle = cycle + ripplewash * fpsr; ! while (cycle > 16) { cycle = cycle - 16; } ! ! ! planeinfo[50].zrot = u(planeinfo[50].zrot + 4 * 4 * fpsr); ! ! rotate_plane(50); ! ! } while (!key[KEY_F12] && !key[KEY_ESC]); deinit(); Index: gamefileinput.h =================================================================== RCS file: /cvsroot/qb2c/goengine/src/game/gamefileinput.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** gamefileinput.h 4 Jan 2004 13:39:02 -0000 1.2 --- gamefileinput.h 8 Nov 2004 14:17:36 -0000 1.3 *************** *** 14,17 **** --- 14,24 ---- #define INCLUDED_GAMEFILEINPUT_HEADER + void load_triggers_v1(); + + void save_file_detailed(char* rfile); + void save_file_simple(char* rfile); + void load_file_joypad(); + void save_file_joypad(); + #endif Index: game.cpp =================================================================== RCS file: /cvsroot/qb2c/goengine/src/game/game.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** game.cpp 20 Jan 2004 18:19:27 -0000 1.4 --- game.cpp 8 Nov 2004 14:17:36 -0000 1.5 *************** *** 19,39 **** #include "game.h" ! ! void applyrot() ! { ! unsigned int i; ! float nsx, nsy, nsz; ! ! for (i = 0; i < pointinfo.size(); i++) ! { [...1042 lines suppressed...] polyinfo.push_back(tpoly); planeinfo[c].npolies++; + npolies++; } } *************** *** 321,326 **** { ! focusofs[0] = focusofs[0] + (fightfocus[0] - focusofs[0]) * .08 * fpsr; ! focusofs[1] = focusofs[1] + (fightfocus[1] - focusofs[1]) * .08 * fpsr; ! focusofs[2] = focusofs[2] + (fightfocus[2] - focusofs[2]) * .08 * fpsr; } --- 999,1004 ---- { ! focusofs[0] = focusofs[0] + (fightfocus[0] - focusofs[0]) * .09 * fpsr; ! focusofs[1] = focusofs[1] + (fightfocus[1] - focusofs[1]) * .09 * fpsr; ! focusofs[2] = focusofs[2] + (fightfocus[2] - focusofs[2]) * .09 * fpsr; } Index: gameglobals.cpp =================================================================== RCS file: /cvsroot/qb2c/goengine/src/game/gameglobals.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** gameglobals.cpp 29 Dec 2003 03:31:08 -0000 1.1 --- gameglobals.cpp 8 Nov 2004 14:17:36 -0000 1.2 *************** *** 16,22 **** short pscx, pscy; ! short npcs, walkdir; ! float curframe; ! short gameflags[10000]; --- 16,30 ---- short pscx, pscy; ! short npcs, walkdir, curstatus; ! float curframe, triggerinfo[10000][9], cycle; ! short gameflags[10000]; ! ! int ambientc, nowplaying, joyinfo[10][3]; ! ! SAMPLE *bgmusic[3], *attack; ! ! BITMAP *surroundbmp, *surroundcbmp, *triggerbmp; ! ! BITMAP *frames[num_characters][num_animations][4][6]; Index: gameglobals.h =================================================================== RCS file: /cvsroot/qb2c/goengine/src/game/gameglobals.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** gameglobals.h 29 Dec 2003 03:31:08 -0000 1.1 --- gameglobals.h 8 Nov 2004 14:17:36 -0000 1.2 *************** *** 16,28 **** // The size of this file is exponentionaly propotional to the need of // refactoring ! extern float playerx, playery, playerz, pratio; extern short pscx, pscy; ! extern short npcs, walkdir; ! extern float curframe; ! extern short gameflags[10000]; #endif --- 16,43 ---- // The size of this file is exponentionaly propotional to the need of // refactoring ! ! #include <allegro.h> ! ! #define num_characters 16 ! #define num_animations 4 ! #define status_standing 0 ! #define status_walking 1 ! #define status_attacking 0 extern float playerx, playery, playerz, pratio; extern short pscx, pscy; ! extern short npcs, walkdir, curstatus; ! extern float curframe, triggerinfo[10000][9], cycle; ! extern short gameflags[10000]; ! ! extern int ambientc, nowplaying, joyinfo[10][3]; ! ! extern SAMPLE *bgmusic[3], *attack; ! ! extern BITMAP *surroundbmp, *surroundcbmp, *triggerbmp; ! ! extern BITMAP *frames[num_characters][num_animations][4][6]; #endif Index: game.h =================================================================== RCS file: /cvsroot/qb2c/goengine/src/game/game.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** game.h 20 Jan 2004 02:48:43 -0000 1.2 --- game.h 8 Nov 2004 14:17:36 -0000 1.3 *************** *** 15,25 **** - void applyrot(); - void checkkbd(); void calcsprites(); void drawhud(); void drawpolys(); void drawsprite(short spritenum); void gameinit(); void setup_scene(); void updphysics(); --- 15,29 ---- void calcsprites(); + void checkkbd(); + void cleanup_scene(); void drawhud(); void drawpolys(); void drawsprite(short spritenum); + void fill_surround(); void gameinit(); + void gui_setkeys(); + void process_trigger(); + void rotate_plane(int planenum); void setup_scene(); void updphysics(); Index: gamefileinput.cpp =================================================================== RCS file: /cvsroot/qb2c/goengine/src/game/gamefileinput.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** gamefileinput.cpp 4 Jan 2004 13:39:02 -0000 1.2 --- gamefileinput.cpp 8 Nov 2004 14:17:36 -0000 1.3 *************** *** 20,21 **** --- 20,349 ---- #include "game.h" + + void load_triggers_v1() + { + FILE *fp; + char mapfile[100]; + int c = 0, d; + + + sprintf(mapfile, "data/triggers.dat"); + + fp = fopen(mapfile, "r"); + + for (c = 0; c < 10000; c++) + { + for (d = 0; d < 9; d++) + { + fscanf(fp, "%f", &triggerinfo[c][d]); + } + } + + fclose(fp); + + } + void save_file_detailed(char* rfile) + { + + FILE *fp; + char mapfile[100], tmp[100]; + int c, d, e; + + sprintf(mapfile, "data/maps/%s.dtl", rfile); + + fp = fopen(mapfile, "w"); + + int version = 1; + + fprintf(fp, "%d\n", version); + + fprintf(fp, "endplane\n"); + fprintf(fp, "%d\n", endplane); + fprintf(fp, "%d\n", lastlight); + + fprintf(fp, "plane_info\n"); + + int lx, ly, rx, ry, w, h; + + h = ycenter / 5; + w = xcenter / 2; + lx = xcenter - w / 2; + ly = ycenter - h / 2; + rx = lx + w - 1; + ry = ly + h - 1; + + BITMAP *temppcx; + + win (0, lx, ly, rx + 6, ry); + + updscreen(); + int greenc = makecol(0, 255, 0); + + for (c = 0; c <= endplane; c++) + { + rectfill (screen, lx + 4, ly + 4, lx + 4 + (w - 8) * (float)c / endplane, ly + h - 4, greenc); + if (planeinfo[c].active) fprintf(fp, "1\n"); + if (!planeinfo[c].active) fprintf(fp, "0\n"); + if (planeinfo[c].condensed) fprintf(fp, "1\n"); + if (!planeinfo[c].condensed) fprintf(fp, "0\n"); + + fprintf(fp, "%f\n", planeinfo[c].basex); + fprintf(fp, "%f\n", planeinfo[c].basey); + fprintf(fp, "%f\n", planeinfo[c].basez); + + fprintf(fp, "%f\n", planeinfo[c].xrot); + fprintf(fp, "%f\n", planeinfo[c].yrot); + fprintf(fp, "%f\n", planeinfo[c].zrot); + + fprintf(fp, "%f\n", planeinfo[c].endx); + fprintf(fp, "%f\n", planeinfo[c].endy); + fprintf(fp, "%f\n", planeinfo[c].endz); + + fprintf(fp, "%f\n", planeinfo[c].height); + + fprintf(fp, "%f\n", planeinfo[c].rbx); + fprintf(fp, "%f\n", planeinfo[c].rby); + fprintf(fp, "%f\n", planeinfo[c].rbz); + + fprintf(fp, "%d\n", planeinfo[c].rows); + fprintf(fp, "%d\n", planeinfo[c].cols); + fprintf(fp, "%d\n", planeinfo[c].lastpoint); + fprintf(fp, "%d\n", planeinfo[c].lastpoly); + fprintf(fp, "%d\n", planeinfo[c].npoints); + 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_%d.bmp", rfile, c, d); + //save_bmp(tmp, planeinfo[c].radiosity[d], pal); + } + } + 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++) + { + fprintf(fp, "%f\n", lightinfo[d].strength); + fprintf(fp, "%d\n", lightinfo[d].lightr); + fprintf(fp, "%d\n", lightinfo[d].lightg); + fprintf(fp, "%d\n", lightinfo[d].lightb); + } + + } + + fclose(fp); + } + + void save_file_simple(char* rfile) + { + + FILE *fp; + char mapfile[100], tmp[100]; + int c, d, e; + + sprintf(mapfile, "data/maps/%s.smp", rfile); + + fp = fopen(mapfile, "w"); + + int version = 1; + + fprintf(fp, "%d\n", version); + + fprintf(fp, "endplane\n"); + fprintf(fp, "%d\n", endplane); + fprintf(fp, "%d\n", lastlight); + + fprintf(fp, "plane_info\n"); + + int lx, ly, rx, ry, w, h; + + h = ycenter / 5; + w = xcenter / 2; + lx = xcenter - w / 2; + ly = ycenter - h / 2; + rx = lx + w - 1; + ry = ly + h - 1; + + BITMAP *temppcx; + + win (0, lx, ly, rx + 6, ry); + + updscreen(); + int greenc = makecol(0, 255, 0); + + for (c = 0; c <= endplane; c++) + { + rectfill (screen, lx + 4, ly + 4, lx + 4 + (w - 8) * (float)c / endplane, ly + h - 4, greenc); + if (planeinfo[c].active) fprintf(fp, "1\n"); + if (!planeinfo[c].active) fprintf(fp, "0\n"); + if (planeinfo[c].condensed) fprintf(fp, "1\n"); + if (!planeinfo[c].condensed) fprintf(fp, "0\n"); + + if (planeinfo[c].active) + { + fprintf(fp, "%f\n", planeinfo[c].basex); + fprintf(fp, "%f\n", planeinfo[c].basey); + fprintf(fp, "%f\n", planeinfo[c].basez); + + fprintf(fp, "%f\n", planeinfo[c].xrot); + fprintf(fp, "%f\n", planeinfo[c].yrot); + fprintf(fp, "%f\n", planeinfo[c].zrot); + + fprintf(fp, "%f\n", planeinfo[c].endx); + fprintf(fp, "%f\n", planeinfo[c].endy); + fprintf(fp, "%f\n", planeinfo[c].endz); + + fprintf(fp, "%f\n", planeinfo[c].height); + + fprintf(fp, "%f\n", planeinfo[c].rbx); + fprintf(fp, "%f\n", planeinfo[c].rby); + fprintf(fp, "%f\n", planeinfo[c].rbz); + + fprintf(fp, "%d\n", planeinfo[c].rows); + fprintf(fp, "%d\n", planeinfo[c].cols); + fprintf(fp, "%d\n", planeinfo[c].lastpoint); + fprintf(fp, "%d\n", planeinfo[c].lastpoly); + fprintf(fp, "%d\n", planeinfo[c].npoints); + fprintf(fp, "%d\n", planeinfo[c].npolies); + + + for (d = 0; d <= planeinfo[c].lastpoint; d++) + { + fprintf(fp, "%f\n", planeinfo[c].pointinfo[d][7]); + + if (planeinfo[c].pointinfo[d][7] == 0) + { + 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++) + { + fprintf(fp, "%d\n", planeinfo[c].polyinfo[d][6]); + if (planeinfo[c].polyinfo[d][6] < 2) + { + 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++) + { + fprintf(fp, "%f\n", lightinfo[d].strength); + fprintf(fp, "%d\n", lightinfo[d].lightr); + fprintf(fp, "%d\n", lightinfo[d].lightg); + fprintf(fp, "%d\n", lightinfo[d].lightb); + } + + } + + fclose(fp); + } + + + + + void load_file_joypad() + { + FILE *fp; + int a, b; + + fp = fopen("data/joypad.dat", "r"); + + for (a = 0; a < 10; a++) + { + for (b = 0; b < 3; b++) + { + fscanf(fp, "%d", &joyinfo[a][b]); + } + } + fclose(fp); + + } + + void save_file_joypad() + { + + FILE *fp; + + fp = fopen("data/joypad.dat", "w"); + + int a, b; + + for (a = 0; a < 10; a++) + { + for (b = 0; b < 3; b++) + { + fprintf(fp, "%d\n", joyinfo[a][b]); + } + } + + + fclose(fp); + } + + |
|
From: Bjørn L. <b_l...@us...> - 2004-11-08 14:17:49
|
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; |
|
From: Bjørn L. <b_l...@us...> - 2004-11-08 14:17:49
|
Update of /cvsroot/qb2c/goengine/src/engine In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19117/engine Modified Files: engineglobals.cpp engineglobals.h fileinput.cpp fileinput.h render.cpp render.h Log Message: Committing changes made by syn9 after resolving numerous conflicts throughout the code. Index: render.cpp =================================================================== RCS file: /cvsroot/qb2c/goengine/src/engine/render.cpp,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** render.cpp 20 Jan 2004 18:19:27 -0000 1.15 --- render.cpp 8 Nov 2004 14:17:36 -0000 1.16 *************** *** 22,26 **** short sleft, sright, sup, sdown; float nsx, nsy, nsz, sx, sy, sz; ! float psx, psy, psz; unsigned int i; --- 22,26 ---- short sleft, sright, sup, sdown; float nsx, nsy, nsz, sx, sy, sz; ! float psx, psy, psz, wsx, wsy, wsz, d, xx, yy, zz; unsigned int i; *************** *** 36,50 **** scy = scrny; ! sleft = -xc / 2; ! sright = xr + xc / 2; ! sup = -yc / 5; ! sdown = yr + yc / 2; if (generating_radiosity) { ! xc = 300; ! yc = 300; ! xr = 600; ! yr = 600; sleft = -xc * 2; --- 36,52 ---- scy = scrny; ! sleft = -xc; ! sright = xr + xc; ! sup = -yc; ! sdown = yr + yc; ! ! npoints = 0; if (generating_radiosity) { ! xc = lightres / 2; ! yc = lightres / 2; ! xr = lightres; ! yr = lightres; sleft = -xc * 2; *************** *** 61,74 **** psy = nsx * prexy + nsy * preyy + nsz * prezy; psz = nsx * prexz + nsy * preyz + nsz * prezz; ! for (i = 0; i != pointinfo.size(); i++) ! { nsx = pointinfo[i].nsx; nsy = pointinfo[i].nsy; nsz = pointinfo[i].nsz; ! sx = nsx + psx - camx; ! sy = nsy + psy - camy; ! sz = nsz + psz - camz; pointinfo[i].sz = sz; --- 63,113 ---- psy = nsx * prexy + nsy * preyy + nsz * prezy; psz = nsx * prexz + nsy * preyz + nsz * prezz; ! for (i = 0; i != pointinfo.size(); i++) ! { ! if (!pointinfo[i].active) continue; ! ! wsx = 0; ! wsy = 0; ! wsz = 0; ! if (pointinfo[i].water == 1) ! { ! xx = pointinfo[i].xx - ripplex; ! zz = pointinfo[i].zz - ripplez; ! ! d = sqrt(xx * xx + zz * zz); ! nsx = 0; ! nsy = sin(rad * fp / FPS * 720 + d / 4 * 360) * rippleamp * (1 - d / ripplefalloff); ! nsz = 0; ! ! wsx = nsx * prexx + nsy * preyx + nsz * prezx; ! wsy = nsx * prexy + nsy * preyy + nsz * prezy; ! wsz = nsx * prexz + nsy * preyz + nsz * prezz; ! ! pointinfo[i].yy = pointinfo[i].ybase + nsy; ! } ! if (pointinfo[i].water == 2) ! { ! yy = pointinfo[i].yy; ! ! nsx = cos(rad * fp / FPS * 720 + yy / 4 * 360) * rippleamp * .5; ! nsy = 0; ! nsz = sin(rad * fp / FPS * 720 + yy / 4 * 360) * rippleamp * .5; ! ! wsx = nsx * prexx + nsy * preyx + nsz * prezx; ! wsy = nsx * prexy + nsy * preyy + nsz * prezy; ! wsz = nsx * prexz + nsy * preyz + nsz * prezz; ! ! pointinfo[i].yy = pointinfo[i].ybase + nsy; ! } ! ! nsx = pointinfo[i].nsx; nsy = pointinfo[i].nsy; nsz = pointinfo[i].nsz; ! sx = nsx + wsx + psx - camx; ! sy = nsy + wsy + psy - camy; ! sz = nsz + wsz + psz - camz; pointinfo[i].sz = sz; *************** *** 82,98 **** if (sz == 0) sz = -.1; ! if (sz > -10 && !generating_radiosity) continue; ! if (sz > 0 && generating_radiosity) continue; ! ! pointinfo[i].x = xc + sx / sz * xzr; pointinfo[i].y = yc + sy / sz * yzr - scy; ! ! if (pointinfo[i].x < sleft || pointinfo[i].x > sright) continue; ! if (pointinfo[i].y < sup || pointinfo[i].y > sdown) continue; ! pointinfo[i].scale = -sz * 75; ! pointinfo[i].flag = 0; } } --- 121,141 ---- if (sz == 0) sz = -.1; ! if (sz > -.5 && !generating_radiosity) continue; ! if (sz > -.5 && generating_radiosity) continue; ! ! pointinfo[i].x = xc + sx / sz * xzr; pointinfo[i].y = yc + sy / sz * yzr - scy; ! ! if (!generating_radiosity) ! { ! if (pointinfo[i].x < sleft || pointinfo[i].x > sright) continue; ! if (pointinfo[i].y < sup || pointinfo[i].y > sdown) continue; ! } pointinfo[i].scale = -sz * 75; ! pointinfo[i].flag = 0; ! ! npoints++; } } *************** *** 110,116 **** //if (generating_radiosity) stp = 2 * stp; ! rotpnt(-stp, 0, 0, camrx, camry, camrz, &prexx, &prexy, &prexz); ! rotpnt(0, stp, 0, camrx, camry, camrz, &preyx, &preyy, &preyz); ! rotpnt(0, 0, stp, camrx, camry, camrz, &prezx, &prezy, &prezz); stp = stpc; --- 153,163 ---- //if (generating_radiosity) stp = 2 * stp; ! rotpnt(-stp, 0, 0, 0, camry, 0, &prexx, &prexy, &prexz); ! rotpnt( 0, stp, 0, 0, camry, 0, &preyx, &preyy, &preyz); ! rotpnt( 0, 0, stp, 0, camry, 0, &prezx, &prezy, &prezz); ! ! rotpnt(prexx, prexy, prexz, camrx, 0, 0, &prexx, &prexy, &prexz); ! rotpnt(preyx, preyy, preyz, camrx, 0, 0, &preyx, &preyy, &preyz); ! rotpnt(prezx, prezy, prezz, camrx, 0, 0, &prezx, &prezy, &prezz); stp = stpc; *************** *** 212,216 **** } ! void initialize(short mode, short xsize, short ysize) { short i; --- 259,263 ---- } ! void initialize(short bits, short mode, short xsize, short ysize) { short i; *************** *** 236,240 **** yzoomratio = xres / 1.6; ! stp = 8; printf("Initalizing Allegro...\n"); --- 283,287 ---- yzoomratio = xres / 1.6; ! stp = 7; printf("Initalizing Allegro...\n"); *************** *** 245,262 **** printf("Setting graphics mode...\n"); ! set_color_depth(24); if(set_gfx_mode(gfx_mode, xres, yres, 0, 0) != 0) { ! set_color_depth(32); if(set_gfx_mode(gfx_mode, xres, yres, 0, 0) != 0) { ! set_color_depth(16); if(set_gfx_mode(gfx_mode, xres, yres, 0, 0) != 0) { ! set_color_depth(15); if(set_gfx_mode(gfx_mode, xres, yres, 0, 0) != 0) { ! allegro_message("Can't init graphics window!"); ! exit(1); } } --- 292,313 ---- printf("Setting graphics mode...\n"); ! set_color_depth(bits); if(set_gfx_mode(gfx_mode, xres, yres, 0, 0) != 0) { ! set_color_depth(16); if(set_gfx_mode(gfx_mode, xres, yres, 0, 0) != 0) { ! set_color_depth(24); if(set_gfx_mode(gfx_mode, xres, yres, 0, 0) != 0) { ! set_color_depth(32); if(set_gfx_mode(gfx_mode, xres, yres, 0, 0) != 0) { ! set_color_depth(15); ! if(set_gfx_mode(gfx_mode, xres, yres, 0, 0) != 0) ! { ! allegro_message("Can't init graphics window!"); ! exit(1); ! } } } *************** *** 287,302 **** } - //temppcx = load_pcx("data/textureset/player.pcx", pal); - //if (!temppcx) { printf("Error loading data/textureset/player.pcx!\n"); exit(1); } - //blit(temppcx, temp2, 0, 96, 0, 0, 31, 31); - textout(screen, font, "Initializing", 0, 0, 7); camx = 0; ! camy = -11; ! camz = 54; ! camrx = 36; camry = 0; camrz = 0; --- 338,349 ---- } textout(screen, font, "Initializing", 0, 0, 7); camx = 0; ! camy = -4.5; ! camz = 60; ! camrx = 30; camry = 0; camrz = 0; *************** *** 304,310 **** sgamma = 1; ! scrny = short(-52 * xres / 320); ! } ! void deinit() { --- 351,358 ---- sgamma = 1; ! scrny = short(-12 * xres / 320); ! ! } ! void deinit() { *************** *** 392,396 **** p1 = polyinfo[i].p1; p2 = polyinfo[i].p2; ! p3 = polyinfo[i].p3; if (bfc) --- 440,445 ---- p1 = polyinfo[i].p1; p2 = polyinfo[i].p2; ! p3 = polyinfo[i].p3; ! if (bfc) *************** *** 462,466 **** fpsr = 60.0f / FPS; } ! timer = timer + .001; show_mouse(offscreen); --- 511,515 ---- fpsr = 60.0f / FPS; } ! timer = timer + .001 * fpsr; show_mouse(offscreen); Index: engineglobals.cpp =================================================================== RCS file: /cvsroot/qb2c/goengine/src/engine/engineglobals.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** engineglobals.cpp 20 Jan 2004 11:23:34 -0000 1.5 --- engineglobals.cpp 8 Nov 2004 14:17:36 -0000 1.6 *************** *** 22,29 **** short lights[max_lights][2]; ! char textureset[100]; float camx, camy, camz, sgamma; ! short scrny; float tx1, tx2, tx3; --- 22,32 ---- short lights[max_lights][2]; ! int vdist, zm; ! ! char textureset[100], mapfile[100]; float camx, camy, camz, sgamma; ! short scrny; ! int lightres; float tx1, tx2, tx3; *************** *** 48,61 **** short start, depth; ! short dbuffer[vdist+1]; ! bool bfc; short trigger[100]; ! short FPS = 0, fp, mapx, mapz, vispolys, refreshrate, nplanes, endplane, lastlight; double globaltime, timer, freeze; short nvtx; short vtx[256][6]; ! float fpsr; float current_fade_level = 1.0; // 0.0 = black; 1.0 = normal; --- 51,64 ---- short start, depth; ! short dbuffer[viewdist+1]; ! bool bfc, sound; short trigger[100]; ! short FPS = 0, fp, mapx, mapz, vispolys, npolies, npoints, refreshrate, nplanes, endplane, lastlight; double globaltime, timer, freeze; short nvtx; short vtx[256][6]; ! float fpsr, ripplex, ripplez, rippleamp, ripplefalloff, ripplewash; float current_fade_level = 1.0; // 0.0 = black; 1.0 = normal; *************** *** 72,77 **** COLOR_MAP trans_table; ! int xres, xcenter, yres, ycenter; float xzoomratio, yzoomratio; ! bool generating_radiosity; --- 75,80 ---- COLOR_MAP trans_table; ! int xres, xcenter, yres, ycenter, wideheight; float xzoomratio, yzoomratio; ! bool generating_radiosity, view_updated, use_joy; Index: render.h =================================================================== RCS file: /cvsroot/qb2c/goengine/src/engine/render.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** render.h 20 Jan 2004 02:48:43 -0000 1.6 --- render.h 8 Nov 2004 14:17:36 -0000 1.7 *************** *** 20,24 **** double getx(float a, float b); double gety(float a, float b); ! void initialize(short mode, short xsize, short ysize); void deinit(); void sortpolys(); --- 20,24 ---- double getx(float a, float b); double gety(float a, float b); ! void initialize(short bits, short mode, short xsize, short ysize); void deinit(); void sortpolys(); Index: engineglobals.h =================================================================== RCS file: /cvsroot/qb2c/goengine/src/engine/engineglobals.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** engineglobals.h 20 Jan 2004 11:23:34 -0000 1.5 --- engineglobals.h 8 Nov 2004 14:17:36 -0000 1.6 *************** *** 21,35 **** #define rad pi / 180 ! #define vdist 22999 ! #define yes 1 ! #define no 0 ! #define up 0 ! #define down 1 ! #define left 2 ! #define right 3 #define max_planes 200 ! #define max_polies 1000 ! #define max_points 1000 #define max_lights 200 --- 21,35 ---- #define rad pi / 180 ! #define viewdist 22999 ! #define yes 1 ! #define no 0 ! #define up 0 ! #define down 1 ! #define left 2 ! #define right 3 #define max_planes 200 ! #define max_polies 2200 ! #define max_points 2000 #define max_lights 200 *************** *** 42,49 **** float sz; float psx, psy, psz; ! float x, y; float scale;//guessing bool flag; ! int plane, point; }; --- 42,51 ---- float sz; float psx, psy, psz; ! float x, y; ! float xx, yy, zz, ybase; float scale;//guessing bool flag; ! bool active; ! int plane, point, water; }; *************** *** 54,58 **** short u[3], v[3]; float nx, ny, nz; ! int plane, poly; }; --- 56,60 ---- short u[3], v[3]; float nx, ny, nz; ! int plane, poly, clipped, trigger; }; *************** *** 65,72 **** float basex, basey, basez, xrot, yrot, zrot, endx, endy, endz, height, rbx, rby, rbz; short rows, cols, lastpoint, lastpoly, npoints, npolies; ! float pointinfo[max_points][11]; ! //base x, y, z, rotated x, y, z, global point index, active, copy point, light > 0 = light # - 1, light on/off ! short polyinfo[max_polies][10]; ! //p1, p2, p3, tx, [not used], global poly index, active, clipped, trigger, alpha short polyvtx[max_polies][6]; //u123,v123 --- 67,74 ---- float basex, basey, basez, xrot, yrot, zrot, endx, endy, endz, height, rbx, rby, rbz; short rows, cols, lastpoint, lastpoly, npoints, npolies; ! float pointinfo[max_points][12]; ! //base x, y, z, rotated x, y, z, global point index, active, copy point, light > 0 = light # - 1, light on/off, shown ! short polyinfo[max_polies][11]; ! //p1, p2, p3, tx, [not used], global poly index, active, clipped, trigger, alpha, shown short polyvtx[max_polies][6]; //u123,v123 *************** *** 88,97 **** extern short lights[max_lights][2]; ! ! extern char textureset[100]; extern float camx, camy, camz, sgamma; extern short scrny; extern float tx1, tx2, tx3; --- 90,100 ---- extern short lights[max_lights][2]; + extern int vdist, zm; ! extern char textureset[100], mapfile[100]; extern float camx, camy, camz, sgamma; extern short scrny; + extern int lightres; extern float tx1, tx2, tx3; *************** *** 116,129 **** extern short start, depth; ! extern short dbuffer[vdist+1]; ! extern bool bfc; extern short trigger[100]; ! extern short FPS, fp, mapx, mapz, vispolys, refreshrate, nplanes, endplane, lastlight; extern double globaltime, timer, freeze; extern short nvtx; extern short vtx[256][6]; ! extern float fpsr; extern float current_fade_level; // 0.0 = black; 1.0 = normal; --- 119,132 ---- extern short start, depth; ! extern short dbuffer[viewdist+1]; ! extern bool bfc, sound; extern short trigger[100]; ! extern short FPS, fp, mapx, mapz, vispolys, npolies, npoints, refreshrate, nplanes, endplane, lastlight; extern double globaltime, timer, freeze; extern short nvtx; extern short vtx[256][6]; ! extern float fpsr, ripplex, ripplez, rippleamp, ripplefalloff, ripplewash; extern float current_fade_level; // 0.0 = black; 1.0 = normal; *************** *** 140,147 **** extern COLOR_MAP trans_table; ! extern int xres, xcenter, yres, ycenter; extern float xzoomratio, yzoomratio; ! extern bool generating_radiosity; #endif --- 143,150 ---- extern COLOR_MAP trans_table; ! extern int xres, xcenter, yres, ycenter, wideheight; extern float xzoomratio, yzoomratio; ! extern bool generating_radiosity, view_updated, use_joy; #endif Index: fileinput.cpp =================================================================== RCS file: /cvsroot/qb2c/goengine/src/engine/fileinput.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** fileinput.cpp 20 Jan 2004 18:19:27 -0000 1.7 --- fileinput.cpp 8 Nov 2004 14:17:36 -0000 1.8 *************** *** 18,26 **** void load_file_v1(char* rfile) { ! FILE *fp; ! char mapfile[100]; ! int c = 0, d, e; char tmp[100]; BITMAP *temppcx; --- 18,26 ---- void load_file_v1(char* rfile) { ! FILE *fp; ! int c = 0, d, e, whitec = makecol(192, 192, 192); char tmp[100]; + BITMAP *temppcx; *************** *** 35,41 **** fscanf(fp, "%hd", &lastlight); ! fscanf(fp, "%s", &tmp[0]); ! for (c = 0; c <= endplane; c++) { fscanf(fp, "%d", &d); if (d == 1) planeinfo[c].active = TRUE; --- 35,71 ---- fscanf(fp, "%hd", &lastlight); ! fscanf(fp, "%s", &tmp); ! ! int lx, ly, rx, ry, w, h; ! ! h = 20; ! 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); ! ! updscreen(); ! int bluec = makecol(64, 255, 64); ! ! for (c = 0; c < max_planes; c++) { + planeinfo[c].active = FALSE; + } + + //drawing_mode(DRAW_MODE_TRANS, NULL, 0, 0); + win (0, lx-4, ly, rx + 10, ry + 20); + + + for (c = 0; c <= endplane; c++) + { + sprintf(tmp, "Loading..."); + textout(offscreen, font, tmp, lx + 2, ly + 2, whitec); + rect (offscreen, lx, ly + 16, lx + w , ly + h + 16, whitec); + rectfill (offscreen, lx + 2, ly + 16 + 2, lx + (w - 4) * (float)c / endplane, ly + h + 16 - 2, bluec); + updscreen(); + fscanf(fp, "%d", &d); if (d == 1) planeinfo[c].active = TRUE; *************** *** 71,109 **** fscanf(fp, "%hd", &planeinfo[c].npolies); ! for (d = 0; d <= planeinfo[c].lastpoint; d++) { ! for (e = 0; e < 11; e++) { ! fscanf(fp, "%f", &planeinfo[c].pointinfo[d][e]); } } ! for (d = 0; d <= planeinfo[c].lastpoly; d++) { ! for (e = 0; e < 10; e++) { ! fscanf(fp, "%hd", &planeinfo[c].polyinfo[d][e]); } ! for (e = 0; e < 6; e++) { ! fscanf(fp, "%hd", &planeinfo[c].polyvtx[d][e]); ! } ! fscanf(fp, "%d", &e); ! if (e == 1) ! { ! sprintf(tmp, "data/maps/shadowmap/i%s_%d_%d.bmp", rfile, c, d); ! temppcx = load_bmp(tmp, pal); ! if (!temppcx) { ! printf("Error, couldn't load shadowmap (%s)\n", tmp); ! exit(1); } ! if (planeinfo[c].radiosity_setup[d] == 0) { ! planeinfo[c].radiosity[d] = create_system_bitmap(16, 16); } - blit(temppcx, planeinfo[c].radiosity[d], 0, 0, 0, 0, 16, 16); - planeinfo[c].radiosity_setup[d] = 2; } } --- 101,470 ---- fscanf(fp, "%hd", &planeinfo[c].npolies); ! if (planeinfo[c].active) { ! ! for (d = 0; d <= planeinfo[c].lastpoint; d++) { ! for (e = 0; e < 11; e++) ! { ! fscanf(fp, "%f", &planeinfo[c].pointinfo[d][e]); ! } } + + sprintf(tmp, "data/maps/shadowmap/i%s_%d.bmp", rfile, c); + temppcx = load_bmp(tmp, pal); + + for (d = 0; d <= planeinfo[c].lastpoly; d++) + { + for (e = 0; e < 10; e++) + { + fscanf(fp, "%d", &planeinfo[c].polyinfo[d][e]); + } + for (e = 0; e < 6; e++) + { + fscanf(fp, "%d", &planeinfo[c].polyvtx[d][e]); + } + + fscanf(fp, "%d", &e); + if (e == 1) + { + //sprintf(tmp, "data/maps/shadowmap2/i%s_%d_%d.bmp", rfile, c, d); + //temppcx = load_bmp(tmp, pal); + + if (planeinfo[c].radiosity_setup[d] == 0) planeinfo[c].radiosity[d] = create_system_bitmap(16, 16); + blit (temppcx, planeinfo[c].radiosity[d], d * 16, 0, 0, 0, 16, 16); + + planeinfo[c].radiosity_setup[d] = 2; + } + } + destroy_bitmap(temppcx); + } ! for (d = 0; d < lastlight; d++) { ! fscanf(fp, "%f", &lightinfo[d].strength); ! fscanf(fp, "%d", &lightinfo[d].lightr); ! fscanf(fp, "%d", &lightinfo[d].lightg); ! fscanf(fp, "%d", &lightinfo[d].lightb); ! } ! ! } ! ! fclose(fp); ! ! updscreen(); ! ! /*int a; ! for (a = 0; a <= endplane; a++) ! { ! for (c = 0; c <= planeinfo[a].lastpoint; c++) ! { ! planeinfo[a].pointinfo[c][8] = 0; ! } ! for (c = 0; c <= planeinfo[a].lastpoly; c++) ! { ! planeinfo[a].polyinfo[c][7] = 0; ! } ! }*/ ! ! set_trans_blender(0, 0, 0, 0); ! drawing_mode(DRAW_MODE_SOLID, NULL, 0, 0); ! ! } ! ! void load_file_v2(char* rfile) ! { ! FILE *fp; ! int c = 0, d, e, whitec = makecol(192, 192, 192); ! char tmp[100]; ! ! ! //BITMAP *temppcx; ! ! sprintf(mapfile, "data/maps/%s.dtl", rfile); ! ! fp = fopen(mapfile, "r"); ! ! fscanf(fp, "%d", &c); ! ! fscanf(fp, "%s", &tmp); ! fscanf(fp, "%d", &endplane); ! fscanf(fp, "%d", &lastlight); ! ! fscanf(fp, "%s", &tmp); ! ! int lx, ly, rx, ry, w, h; ! ! h = 20; ! 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); ! ! updscreen(); ! int bluec = makecol(64, 255, 64); ! ! for (c = 0; c < max_planes; c++) ! { ! planeinfo[c].active = FALSE; ! } ! ! //drawing_mode(DRAW_MODE_TRANS, NULL, 0, 0); ! win (0, lx-4, ly, rx + 10, ry + 20); ! ! ! ! for (c = 0; c <= endplane; c++) ! { ! sprintf(tmp, "Loading..."); ! textout(offscreen, font, tmp, lx + 2, ly + 2, whitec); ! rect (offscreen, lx, ly + 16, lx + w , ly + h + 16, whitec); ! rectfill (offscreen, lx + 2, ly + 16 + 2, lx + (w - 4) * (float)c / endplane, ly + h + 16 - 2, bluec); ! updscreen(); ! ! fscanf(fp, "%d", &d); ! if (d == 1) planeinfo[c].active = TRUE; ! if (d == 0) planeinfo[c].active = FALSE; ! ! fscanf(fp, "%d", &d); ! if (d == 1) planeinfo[c].condensed = TRUE; ! if (d == 0) planeinfo[c].condensed = FALSE; ! ! fscanf(fp, "%f", &planeinfo[c].basex); ! fscanf(fp, "%f", &planeinfo[c].basey); ! fscanf(fp, "%f", &planeinfo[c].basez); ! ! fscanf(fp, "%f", &planeinfo[c].xrot); ! fscanf(fp, "%f", &planeinfo[c].yrot); ! fscanf(fp, "%f", &planeinfo[c].zrot); ! ! fscanf(fp, "%f", &planeinfo[c].endx); ! fscanf(fp, "%f", &planeinfo[c].endy); ! fscanf(fp, "%f", &planeinfo[c].endz); ! ! fscanf(fp, "%f", &planeinfo[c].height); ! ! fscanf(fp, "%f", &planeinfo[c].rbx); ! fscanf(fp, "%f", &planeinfo[c].rby); ! fscanf(fp, "%f", &planeinfo[c].rbz); ! ! fscanf(fp, "%d", &planeinfo[c].rows); ! fscanf(fp, "%d", &planeinfo[c].cols); ! fscanf(fp, "%d", &planeinfo[c].lastpoint); ! fscanf(fp, "%d", &planeinfo[c].lastpoly); ! fscanf(fp, "%d", &planeinfo[c].npoints); ! fscanf(fp, "%d", &planeinfo[c].npolies); ! ! //temppcx = create_system_bitmap(16, 16); ! ! if (planeinfo[c].active) ! { ! ! for (d = 0; d <= planeinfo[c].lastpoint; d++) { ! for (e = 0; e < 11; e++) ! { ! fscanf(fp, "%f", &planeinfo[c].pointinfo[d][e]); ! } } ! ! ! for (d = 0; d <= planeinfo[c].lastpoly; d++) { ! for (e = 0; e < 10; e++) ! { ! fscanf(fp, "%d", &planeinfo[c].polyinfo[d][e]); ! } ! for (e = 0; e < 6; e++) ! { ! fscanf(fp, "%d", &planeinfo[c].polyvtx[d][e]); ! } ! fscanf(fp, "%d", &e); ! ! if (e == 1) ! { ! //sprintf(tmp, "data/maps/shadowmap2/i%s_%d_%d.bmp", rfile, c, d); ! //temppcx = load_bmp(tmp, pal); ! ! if (planeinfo[c].radiosity_setup[d] == 0) ! { ! planeinfo[c].radiosity[d] = create_system_bitmap(16, 16); ! planeinfo[c].radiosity_setup[d] = 1; ! //rectfill (planeinfo[c].radiosity[d], 0, 0, 15, 15, -1); ! //blit(textures[planeinfo[c].polyinfo[d][3]], planeinfo[c].radiosity[d], 0, 0, 0, 0, 16, 16); ! ! } ! //rectfill (planeinfo[c].radiosity[d], 0, 0, 15, 15, 0); ! //blit (temppcx, planeinfo[c].radiosity[d], d * 16, 0, 0, 0, 16, 16); ! ! planeinfo[c].radiosity_setup[d] = 2; } + } ! //destroy_bitmap(temppcx); ! ! ! } ! ! ! ! ! for (d = 0; d < lastlight; d++) ! { ! fscanf(fp, "%f", &lightinfo[d].strength); ! fscanf(fp, "%d", &lightinfo[d].lightr); ! fscanf(fp, "%d", &lightinfo[d].lightg); ! fscanf(fp, "%d", &lightinfo[d].lightb); ! } ! ! } ! ! fclose(fp); ! ! ! updscreen(); ! ! ! /*int a; ! for (a = 0; a <= endplane; a++) ! { ! for (c = 0; c <= planeinfo[a].lastpoint; c++) ! { ! planeinfo[a].pointinfo[c][8] = 0; ! } ! for (c = 0; c <= planeinfo[a].lastpoly; c++) ! { ! planeinfo[a].polyinfo[c][7] = 0; ! } ! }*/ ! ! set_trans_blender(0, 0, 0, 0); ! drawing_mode(DRAW_MODE_SOLID, NULL, 0, 0); ! ! } ! ! void load_file_v1_simple(char* rfile) ! { ! FILE *fp; ! char mapfile[100]; ! int c = 0, d, e; ! char tmp[100]; ! ! BITMAP *temppcx; ! ! sprintf(mapfile, "data/maps/%s.smp", rfile); ! ! fp = fopen(mapfile, "r"); ! ! fscanf(fp, "%d", &c); ! ! fscanf(fp, "%s", &tmp); ! fscanf(fp, "%d", &endplane); ! fscanf(fp, "%d", &lastlight); ! ! fscanf(fp, "%s", &tmp); ! ! int lx, ly, rx, ry, w, h; ! ! h = ycenter / 5; ! w = xcenter / 2; ! lx = xcenter - w / 2; ! ly = ycenter - h / 2; ! rx = lx + w - 1; ! ry = ly + h - 1; ! ! win (0, lx, ly, rx + 6, ry); ! ! updscreen(); ! int greenc = makecol(0, 255, 0); ! ! for (c = 0; c <= endplane; c++) ! { ! rectfill (screen, lx + 4, ly + 4, lx + 4 + (w - 8) * (float)c / endplane, ly + h - 4, greenc); ! fscanf(fp, "%d", &d); ! if (d == 1) planeinfo[c].active = TRUE; ! if (d == 0) planeinfo[c].active = FALSE; ! ! fscanf(fp, "%d", &d); ! if (d == 1) planeinfo[c].condensed = TRUE; ! if (d == 0) planeinfo[c].condensed = FALSE; ! ! if (planeinfo[c].active) ! { ! ! fscanf(fp, "%f", &planeinfo[c].basex); ! fscanf(fp, "%f", &planeinfo[c].basey); ! fscanf(fp, "%f", &planeinfo[c].basez); ! ! fscanf(fp, "%f", &planeinfo[c].xrot); ! fscanf(fp, "%f", &planeinfo[c].yrot); ! fscanf(fp, "%f", &planeinfo[c].zrot); ! ! fscanf(fp, "%f", &planeinfo[c].endx); ! fscanf(fp, "%f", &planeinfo[c].endy); ! fscanf(fp, "%f", &planeinfo[c].endz); ! ! fscanf(fp, "%f", &planeinfo[c].height); ! ! fscanf(fp, "%f", &planeinfo[c].rbx); ! fscanf(fp, "%f", &planeinfo[c].rby); ! fscanf(fp, "%f", &planeinfo[c].rbz); ! ! fscanf(fp, "%d", &planeinfo[c].rows); ! fscanf(fp, "%d", &planeinfo[c].cols); ! fscanf(fp, "%d", &planeinfo[c].lastpoint); ! fscanf(fp, "%d", &planeinfo[c].lastpoly); ! fscanf(fp, "%d", &planeinfo[c].npoints); ! fscanf(fp, "%d", &planeinfo[c].npolies); ! ! for (d = 0; d <= planeinfo[c].lastpoint; d++) ! { ! fscanf(fp, "%f", &planeinfo[c].pointinfo[d][7]); ! if (planeinfo[c].pointinfo[d][7] == 0) ! { ! for (e = 0; e < 11; e++) ! { ! fscanf(fp, "%f", &planeinfo[c].pointinfo[d][e]); ! } ! } ! } ! ! sprintf(tmp, "data/maps/shadowmap/i%s_%d.bmp", rfile, c); ! temppcx = load_bmp(tmp, pal); ! ! for (d = 0; d <= planeinfo[c].lastpoly; d++) ! { ! fscanf(fp, "%d", &planeinfo[c].polyinfo[d][6]); ! if (planeinfo[c].polyinfo[d][6] < 2) ! { ! for (e = 0; e < 10; e++) ! { ! fscanf(fp, "%d", &planeinfo[c].polyinfo[d][e]); ! } ! for (e = 0; e < 6; e++) ! { ! fscanf(fp, "%d", &planeinfo[c].polyvtx[d][e]); ! } ! ! fscanf(fp, "%d", &e); ! if (e == 1) ! { ! //sprintf(tmp, "data/maps/shadowmap2/i%s_%d_%d.bmp", rfile, c, d); ! //temppcx = load_bmp(tmp, pal); ! ! if (planeinfo[c].radiosity_setup[d] == 0) planeinfo[c].radiosity[d] = create_system_bitmap(16, 16); ! blit (temppcx, planeinfo[c].radiosity[d], d * 16, 0, 0, 0, 16, 16); ! ! planeinfo[c].radiosity_setup[d] = 2; ! } } } + destroy_bitmap(temppcx); + } *************** *** 119,121 **** --- 480,487 ---- fclose(fp); + + updscreen(); + } + + Index: fileinput.h =================================================================== RCS file: /cvsroot/qb2c/goengine/src/engine/fileinput.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** fileinput.h 20 Jan 2004 02:48:43 -0000 1.3 --- fileinput.h 8 Nov 2004 14:17:36 -0000 1.4 *************** *** 15,18 **** --- 15,21 ---- void load_file_v1(char* rfile); + void load_file_v2(char* rfile); + + void load_file_v1_simple(char* rfile); #endif |
|
From: Daniel K. <sy...@us...> - 2004-11-07 18:42:42
|
Update of /cvsroot/qb2c/goengine/data In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25551 Added Files: joypad.dat Log Message: New Updates --- NEW FILE: joypad.dat --- 0 1 1 0 1 2 0 0 1 0 0 2 0 2 1 0 2 2 1 0 1 1 0 2 183847292 183847296 183847300 183847304 183847308 183847312 |
|
From: <b_l...@us...> - 2004-01-20 18:19:31
|
Update of /cvsroot/qb2c/goengine/src/editor
In directory sc8-pr-cvs1:/tmp/cvs-serv26403/src/editor
Modified Files:
gomapedit.cpp mapeditgui.cpp mapeditgui.h
Log Message:
Another bunch of warnings fixed.
Index: gomapedit.cpp
===================================================================
RCS file: /cvsroot/qb2c/goengine/src/editor/gomapedit.cpp,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -d -r1.12 -r1.13
*** gomapedit.cpp 20 Jan 2004 02:48:43 -0000 1.12
--- gomapedit.cpp 20 Jan 2004 18:19:27 -0000 1.13
***************
*** 44,49 ****
setup_scene();
! int cgrey = makecol(128,128,128), whitec = makecol(192,192,192);
!
printf("Game data initialized, starting main loop...\n");
--- 44,48 ----
setup_scene();
! int cgrey = makecol(128,128,128);
printf("Game data initialized, starting main loop...\n");
Index: mapeditgui.cpp
===================================================================
RCS file: /cvsroot/qb2c/goengine/src/editor/mapeditgui.cpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** mapeditgui.cpp 20 Jan 2004 02:48:43 -0000 1.5
--- mapeditgui.cpp 20 Jan 2004 18:19:27 -0000 1.6
***************
*** 164,197 ****
if (strlen(rbasex) > 0 && strlen(rbasey) > 0 && strlen(rbasez) > 0 && strlen(rendx) > 0 && strlen(rendy) > 0 && strlen(rendz) > 0 && strlen(rheight) > 0 && strlen(rcols) > 0 && strlen(rrows) > 0)
{
! int c, newplane;
! for (c = 0; c < max_planes; c++)
{
! if (planeinfo[c].active == FALSE)
! {
! newplane = c;
! break;
}
}
- planeinfo[newplane].active = TRUE;
-
- planeinfo[newplane].basex = strtod(rbasex, NULL);
- planeinfo[newplane].basey = strtod(rbasey, NULL);
- planeinfo[newplane].basez = strtod(rbasez, NULL);
- planeinfo[newplane].endx = strtod(rendx, NULL);
- planeinfo[newplane].endy = strtod(rendy, NULL);
- planeinfo[newplane].endz = strtod(rendz, NULL);
- planeinfo[newplane].height = strtod(rheight, NULL);
- planeinfo[newplane].rows = (short)strtod(rrows, NULL);
- planeinfo[newplane].cols = (short)strtod(rcols, NULL);
- planeinfo[newplane].xrot = 0;
- planeinfo[newplane].yrot = 0;
- planeinfo[newplane].zrot = 0;
- planeinfo[newplane].rbx = 0;
- planeinfo[newplane].rby = 0;
- planeinfo[newplane].rbz = 0;
- planeinfo[newplane].condensed = FALSE;
-
- selplane = newplane;
- setup_plane(newplane, rettx);
} else {
allegro_message("Unable to Process Request");
--- 164,196 ----
if (strlen(rbasex) > 0 && strlen(rbasey) > 0 && strlen(rbasez) > 0 && strlen(rendx) > 0 && strlen(rendy) > 0 && strlen(rendz) > 0 && strlen(rheight) > 0 && strlen(rcols) > 0 && strlen(rrows) > 0)
{
! int p;
! for (p = 0; p < max_planes; p++)
{
! if (planeinfo[p].active == FALSE)
! {
! planeinfo[p].active = TRUE;
! planeinfo[p].basex = strtod(rbasex, NULL);
! planeinfo[p].basey = strtod(rbasey, NULL);
! planeinfo[p].basez = strtod(rbasez, NULL);
! planeinfo[p].endx = strtod(rendx, NULL);
! planeinfo[p].endy = strtod(rendy, NULL);
! planeinfo[p].endz = strtod(rendz, NULL);
! planeinfo[p].height = strtod(rheight, NULL);
! planeinfo[p].rows = (short)strtod(rrows, NULL);
! planeinfo[p].cols = (short)strtod(rcols, NULL);
! planeinfo[p].xrot = 0;
! planeinfo[p].yrot = 0;
! planeinfo[p].zrot = 0;
! planeinfo[p].rbx = 0;
! planeinfo[p].rby = 0;
! planeinfo[p].rbz = 0;
! planeinfo[p].condensed = FALSE;
!
! selplane = p;
! setup_plane(p, rettx);
!
! break;
}
}
} else {
allegro_message("Unable to Process Request");
***************
*** 324,328 ****
char rnumber[20];
! int p = planeinfo[selplane].pointinfo[(short)selpoint[0][3]][9] - 1;
length = 256;
--- 323,327 ----
char rnumber[20];
! int p = int(planeinfo[selplane].pointinfo[(short)selpoint[0][3]][9]) - 1;
length = 256;
***************
*** 408,412 ****
char rstrength[20];
! int p = planeinfo[selplane].pointinfo[(short)selpoint[0][3]][9] - 1;
length = 256;
--- 407,411 ----
char rstrength[20];
! int p = int(planeinfo[selplane].pointinfo[(short)selpoint[0][3]][9]) - 1;
length = 256;
***************
*** 831,835 ****
height = 12 * 3 + 5;
! int p = selpoint[0][3];
gtop = ycenter - height / 2;
--- 830,834 ----
height = 12 * 3 + 5;
! int p = int(selpoint[0][3]);
gtop = ycenter - height / 2;
***************
*** 1170,1174 ****
}
! void textbox(short x1, short y1, short x2, short y2, short length, char* basestr)
{
long redc = makecol(64,64,64), whitec = makecol(192,192,192), greyc = makecol(96, 96, 96);
--- 1169,1173 ----
}
! void textbox(short x1, short y1, short x2, short y2, unsigned short length, char* basestr)
{
long redc = makecol(64,64,64), whitec = makecol(192,192,192), greyc = makecol(96, 96, 96);
***************
*** 1178,1182 ****
}
! char* editbox(short x1, short y1, short x2, short y2, short length, char* basestr)
{
int greenc = makecol(0, 255, 0);
--- 1177,1181 ----
}
! char* editbox(short x1, short y1, short x2, short y2, unsigned short length, char* basestr)
{
int greenc = makecol(0, 255, 0);
***************
*** 1191,1195 ****
short last, set;
! long redc = makecol(192,192,192), whitec = makecol(192,192,192), greyc = makecol(72,72,72);
sprintf(str, "%s", basestr);
--- 1190,1194 ----
short last, set;
! long redc = makecol(192,192,192);
sprintf(str, "%s", basestr);
Index: mapeditgui.h
===================================================================
RCS file: /cvsroot/qb2c/goengine/src/editor/mapeditgui.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** mapeditgui.h 20 Jan 2004 02:48:43 -0000 1.4
--- mapeditgui.h 20 Jan 2004 18:19:27 -0000 1.5
***************
*** 30,35 ****
void gui_system_save(int mode);
! char* editbox(short x1, short y1, short x2, short y2, short length, char* basestr);
! void textbox(short x1, short y1, short x2, short y2, short length, char* basestr);
--- 30,35 ----
void gui_system_save(int mode);
! char* editbox(short x1, short y1, short x2, short y2, unsigned short length, char* basestr);
! void textbox(short x1, short y1, short x2, short y2, unsigned short length, char* basestr);
|
|
From: <b_l...@us...> - 2004-01-20 18:19:31
|
Update of /cvsroot/qb2c/goengine/src/engine
In directory sc8-pr-cvs1:/tmp/cvs-serv26403/src/engine
Modified Files:
fileinput.cpp render.cpp
Log Message:
Another bunch of warnings fixed.
Index: fileinput.cpp
===================================================================
RCS file: /cvsroot/qb2c/goengine/src/engine/fileinput.cpp,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** fileinput.cpp 20 Jan 2004 14:47:58 -0000 1.6
--- fileinput.cpp 20 Jan 2004 18:19:27 -0000 1.7
***************
*** 31,39 ****
fscanf(fp, "%d", &c);
! fscanf(fp, "%s", &tmp);
! fscanf(fp, "%d", &endplane);
! fscanf(fp, "%d", &lastlight);
! fscanf(fp, "%s", &tmp);
for (c = 0; c <= endplane; c++)
{
--- 31,39 ----
fscanf(fp, "%d", &c);
! fscanf(fp, "%s", &tmp[0]);
! fscanf(fp, "%hd", &endplane);
! fscanf(fp, "%hd", &lastlight);
! fscanf(fp, "%s", &tmp[0]);
for (c = 0; c <= endplane; c++)
{
***************
*** 64,73 ****
fscanf(fp, "%f", &planeinfo[c].rbz);
! fscanf(fp, "%d", &planeinfo[c].rows);
! fscanf(fp, "%d", &planeinfo[c].cols);
! fscanf(fp, "%d", &planeinfo[c].lastpoint);
! fscanf(fp, "%d", &planeinfo[c].lastpoly);
! fscanf(fp, "%d", &planeinfo[c].npoints);
! fscanf(fp, "%d", &planeinfo[c].npolies);
for (d = 0; d <= planeinfo[c].lastpoint; d++)
--- 64,73 ----
fscanf(fp, "%f", &planeinfo[c].rbz);
! fscanf(fp, "%hd", &planeinfo[c].rows);
! fscanf(fp, "%hd", &planeinfo[c].cols);
! fscanf(fp, "%hd", &planeinfo[c].lastpoint);
! fscanf(fp, "%hd", &planeinfo[c].lastpoly);
! fscanf(fp, "%hd", &planeinfo[c].npoints);
! fscanf(fp, "%hd", &planeinfo[c].npolies);
for (d = 0; d <= planeinfo[c].lastpoint; d++)
***************
*** 83,91 ****
for (e = 0; e < 10; e++)
{
! fscanf(fp, "%d", &planeinfo[c].polyinfo[d][e]);
}
for (e = 0; e < 6; e++)
{
! fscanf(fp, "%d", &planeinfo[c].polyvtx[d][e]);
}
--- 83,91 ----
for (e = 0; e < 10; e++)
{
! fscanf(fp, "%hd", &planeinfo[c].polyinfo[d][e]);
}
for (e = 0; e < 6; e++)
{
! fscanf(fp, "%hd", &planeinfo[c].polyvtx[d][e]);
}
***************
*** 111,117 ****
{
fscanf(fp, "%f", &lightinfo[d].strength);
! fscanf(fp, "%d", &lightinfo[d].lightr);
! fscanf(fp, "%d", &lightinfo[d].lightg);
! fscanf(fp, "%d", &lightinfo[d].lightb);
}
--- 111,117 ----
{
fscanf(fp, "%f", &lightinfo[d].strength);
! fscanf(fp, "%hd", &lightinfo[d].lightr);
! fscanf(fp, "%hd", &lightinfo[d].lightg);
! fscanf(fp, "%hd", &lightinfo[d].lightb);
}
Index: render.cpp
===================================================================
RCS file: /cvsroot/qb2c/goengine/src/engine/render.cpp,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -d -r1.14 -r1.15
*** render.cpp 20 Jan 2004 11:23:34 -0000 1.14
--- render.cpp 20 Jan 2004 18:19:27 -0000 1.15
***************
*** 224,229 ****
int gfx_mode;
! if (mode == 0) gfx_mode = GFX_AUTODETECT_WINDOWED;
! if (mode == 1) gfx_mode = GFX_AUTODETECT_FULLSCREEN;
xcenter = xres / 2;
--- 224,232 ----
int gfx_mode;
! if (mode == 0) {
! gfx_mode = GFX_AUTODETECT_WINDOWED;
! } else {
! gfx_mode = GFX_AUTODETECT_FULLSCREEN;
! }
xcenter = xres / 2;
|
|
From: <b_l...@us...> - 2004-01-20 18:19:31
|
Update of /cvsroot/qb2c/goengine/src/game
In directory sc8-pr-cvs1:/tmp/cvs-serv26403/src/game
Modified Files:
game.cpp goengine.cpp
Log Message:
Another bunch of warnings fixed.
Index: game.cpp
===================================================================
RCS file: /cvsroot/qb2c/goengine/src/game/game.cpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** game.cpp 20 Jan 2004 02:48:43 -0000 1.3
--- game.cpp 20 Jan 2004 18:19:27 -0000 1.4
***************
*** 131,138 ****
void drawpolys()
{
! int i, poly, p1, p2, p3, t, a, 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], level;
- int trans = makecol(255, 0, 255);
V3D_f v1, v2, v3;
--- 131,136 ----
void drawpolys()
{
! int i, poly, p1, p2, p3, t, a;
short u[3], v[3], level;
V3D_f v1, v2, v3;
***************
*** 182,186 ****
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 {
--- 180,184 ----
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 {
***************
*** 274,280 ****
if (planeinfo[c].polyinfo[a][6] < 2)
{
! tpoly.p1 = planeinfo[c].pointinfo[planeinfo[c].polyinfo[a][0]][6];
! tpoly.p2 = planeinfo[c].pointinfo[planeinfo[c].polyinfo[a][1]][6];
! tpoly.p3 = planeinfo[c].pointinfo[planeinfo[c].polyinfo[a][2]][6];
tpoly.tx = planeinfo[c].polyinfo[a][3];
tpoly.u[0] = planeinfo[c].polyvtx[a][0];
--- 272,278 ----
if (planeinfo[c].polyinfo[a][6] < 2)
{
! tpoly.p1 = int(planeinfo[c].pointinfo[planeinfo[c].polyinfo[a][0]][6]);
! tpoly.p2 = int(planeinfo[c].pointinfo[planeinfo[c].polyinfo[a][1]][6]);
! tpoly.p3 = int(planeinfo[c].pointinfo[planeinfo[c].polyinfo[a][2]][6]);
tpoly.tx = planeinfo[c].polyinfo[a][3];
tpoly.u[0] = planeinfo[c].polyvtx[a][0];
Index: goengine.cpp
===================================================================
RCS file: /cvsroot/qb2c/goengine/src/game/goengine.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** goengine.cpp 20 Jan 2004 02:48:43 -0000 1.4
--- goengine.cpp 20 Jan 2004 18:19:27 -0000 1.5
***************
*** 42,48 ****
setup_scene();
- int cgrey = makecol(128,128,128), whitec = makecol(192,192,192);
-
-
printf("Game data initialized, starting main loop...\n");
--- 42,45 ----
|
|
From: <b_l...@us...> - 2004-01-20 17:39:26
|
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;
|
|
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)
|
|
From: <b_l...@us...> - 2004-01-20 17:14:09
|
Update of /cvsroot/qb2c/goengine
In directory sc8-pr-cvs1:/tmp/cvs-serv11303
Modified Files:
HISTORY
Log Message:
Many many warnings fixed. Still a lot to go...
Index: HISTORY
===================================================================
RCS file: /cvsroot/qb2c/goengine/HISTORY,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** HISTORY 3 Jan 2004 22:09:26 -0000 1.3
--- HISTORY 20 Jan 2004 17:14:06 -0000 1.4
***************
*** 1,2 ****
--- 1,8 ----
+ Jan 20
+ Bjorn:
+ - Warning fixes
+ - Compile fix for 'gamma' name conflict
+ - Compile fix for 'or' name conflict
+
Jan 03
- map edit updates now operational:
***************
*** 11,15 ****
causes warping on rotation on more than 1 axis
-
Dec 28
Syn9
--- 17,20 ----
***************
*** 21,33 ****
- cleared out all inventory/npc/shop variables, so that he new scripting
system has a clean basis for them. as well as removed updnpcs
! - drawpolys now resides in the game.cpp or mapedit.cpp files, instead of render.cpp
! this is to allow each one to have unique drawing routines. also these contain
! a drawsprite(short spritenum); which will contain code for rendering sprites/animation.
spritenum = -1 if its refering to the player, else, its refering to the npc #
! - globals.h and .cpp are now split up into engineglobals.cpp/.h containing root
! engine specific variables. and gameglobals.cpp/.h and mapeditglobals.cpp/.h
! - introduced fileinput.cpp/.h for filereading. any file loading and saving routines
! that are shared for any game/mapeditor specific data files will reside within.
! then mapeditfileinput.cpp/.h and gamefileinput.cpp/.h are for each version respectively.
Dec 19
--- 26,41 ----
- cleared out all inventory/npc/shop variables, so that he new scripting
system has a clean basis for them. as well as removed updnpcs
! - drawpolys now resides in the game.cpp or mapedit.cpp files, instead of
! render.cpp this is to allow each one to have unique drawing routines. also
! these contain a drawsprite(short spritenum); which will contain code for
! rendering sprites/animation.
spritenum = -1 if its refering to the player, else, its refering to the npc #
! - globals.h and .cpp are now split up into engineglobals.cpp/.h containing
! root engine specific variables. and gameglobals.cpp/.h and
! mapeditglobals.cpp/.h
! - introduced fileinput.cpp/.h for filereading. any file loading and saving
! routines that are shared for any game/mapeditor specific data files will
! reside within. then mapeditfileinput.cpp/.h and gamefileinput.cpp/.h are for
! each version respectively.
Dec 19
|
|
From: <b_l...@us...> - 2004-01-20 15:24:16
|
Update of /cvsroot/qb2c/goengine/src/editor
In directory sc8-pr-cvs1:/tmp/cvs-serv20590/src/editor
Modified Files:
mapedit.cpp
Log Message:
Localize and get rid of initialization warning.
Index: mapedit.cpp
===================================================================
RCS file: /cvsroot/qb2c/goengine/src/editor/mapedit.cpp,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -d -r1.12 -r1.13
*** mapedit.cpp 20 Jan 2004 15:06:29 -0000 1.12
--- mapedit.cpp 20 Jan 2004 15:24:13 -0000 1.13
***************
*** 2752,2756 ****
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 xr, yr, zr, 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;
--- 2752,2756 ----
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, c, c1, c2, c3;
float ax, ay, az, bx, by, bz, ii, jj, kk, d, d1, d2, normalx, normaly, normalz;
***************
*** 2830,2869 ****
for (an = 0; an < 6; an++)
{
! if (an == 0)
! {
! xr = 0;
! yr = 0;
! zr = 0;
! }
! if (an == 1)
! {
! xr = 90;
! yr = 0;
! zr = 0;
! }
! if (an == 2)
! {
! xr = 180;
! yr = 0;
! zr = 0;
! }
! if (an == 3)
! {
! xr = 270;
! yr = 0;
! zr = 0;
! }
! if (an == 4)
! {
! xr = 0;
! yr = 90;
! zr = 0;
! }
! if (an == 5)
! {
! xr = 0;
! yr = 270;
! zr = 0;
! }
camrx = xr;
--- 2830,2842 ----
for (an = 0; an < 6; an++)
{
! float xr = 0.0f, zr = 0.0f, yr = 0.0f;
!
! switch (an) {
! case 1: xr = 90.0f; break;
! case 2: xr = 180.0f; break;
! case 3: xr = 270.0f; break;
! case 4: yr = 90.0f; break;
! case 5: yr = 270.0f; break;
! }
camrx = xr;
|
|
From: <b_l...@us...> - 2004-01-20 15:06:32
|
Update of /cvsroot/qb2c/goengine/src/editor
In directory sc8-pr-cvs1:/tmp/cvs-serv17380/src/editor
Modified Files:
mapedit.cpp
Log Message:
Warning fixes and editor now compiles ('or' appears to be a reserved keyword)
Index: mapedit.cpp
===================================================================
RCS file: /cvsroot/qb2c/goengine/src/editor/mapedit.cpp,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** mapedit.cpp 20 Jan 2004 11:23:34 -0000 1.11
--- mapedit.cpp 20 Jan 2004 15:06:29 -0000 1.12
***************
*** 2750,2754 ****
{
! 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 xr, yr, zr, dist, intense, strength, xx, yy, zz;
--- 2750,2754 ----
{
! 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 xr, yr, zr, dist, intense, strength, xx, yy, zz;
***************
*** 2756,2760 ****
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];
--- 2756,2760 ----
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];
***************
*** 3110,3113 ****
--- 3110,3115 ----
for (y = 0; y < 16; y++)
{
+ short old_r, old_g, old_b;
+
nr = 0;
ng = 0;
***************
*** 3115,3121 ****
c = getpixel(planeinfo[i].radiosity[j], x, y);
! or = getr(c);
! og = getg(c);
! ob = getb(c);
p = 0;
--- 3117,3123 ----
c = getpixel(planeinfo[i].radiosity[j], x, y);
! old_r = getr(c);
! old_g = getg(c);
! old_b = getb(c);
p = 0;
***************
*** 3148,3154 ****
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));
--- 3150,3156 ----
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));
***************
*** 3219,3223 ****
camry = bk_camry;
camrz = bk_camrz;
! scrny = bk_scrny;
gridbase = bk_gridbase;
xzoomratio = bk_xzoomratio;
--- 3221,3225 ----
camry = bk_camry;
camrz = bk_camrz;
! scrny = short(bk_scrny);
gridbase = bk_gridbase;
xzoomratio = bk_xzoomratio;
***************
*** 3318,3336 ****
for (b = x + 1; b <= xx; b++)
{
! vtx[i][0] = x * sx;
! vtx[i][1] = y * sy;
! vtx[i][2] = x * sx;
! vtx[i][3] = a * sy;
! vtx[i][4] = b * sx;
! vtx[i][5] = y * sy;
i++;
! vtx[i][0] = b * sx;
! vtx[i][1] = a * sy;
! vtx[i][2] = b * sx;
! vtx[i][3] = y * sy;
! vtx[i][4] = x * sx;
! vtx[i][5] = a * sy;
i++;
--- 3320,3338 ----
for (b = x + 1; b <= xx; b++)
{
! vtx[i][0] = short(x * sx);
! vtx[i][1] = short(y * sy);
! vtx[i][2] = short(x * sx);
! vtx[i][3] = short(a * sy);
! vtx[i][4] = short(b * sx);
! vtx[i][5] = short(y * sy);
i++;
! vtx[i][0] = short(b * sx);
! vtx[i][1] = short(a * sy);
! vtx[i][2] = short(b * sx);
! vtx[i][3] = short(y * sy);
! vtx[i][4] = short(x * sx);
! vtx[i][5] = short(a * sy);
i++;
***************
*** 3348,3366 ****
for (b = x + 1; b <= xx; b++)
{
! vtx[i][0] = x * sx;
! vtx[i][1] = a * sy;
! vtx[i][2] = b * sx;
! vtx[i][3] = a * sy;
! vtx[i][4] = x * sx;
! vtx[i][5] = y * sy;
i++;
! vtx[i][0] = b * sx;
! vtx[i][1] = y * sy;
! vtx[i][2] = x * sx;
! vtx[i][3] = y * sy;
! vtx[i][4] = b * sx;
! vtx[i][5] = a * sy;
i++;
--- 3350,3368 ----
for (b = x + 1; b <= xx; b++)
{
! vtx[i][0] = short(x * sx);
! vtx[i][1] = short(a * sy);
! vtx[i][2] = short(b * sx);
! vtx[i][3] = short(a * sy);
! vtx[i][4] = short(x * sx);
! vtx[i][5] = short(y * sy);
i++;
! vtx[i][0] = short(b * sx);
! vtx[i][1] = short(y * sy);
! vtx[i][2] = short(x * sx);
! vtx[i][3] = short(y * sy);
! vtx[i][4] = short(b * sx);
! vtx[i][5] = short(a * sy);
i++;
***************
*** 3447,3451 ****
}
} else {
! p = selpoint[c][3];
}
--- 3449,3453 ----
}
} else {
! p = int(selpoint[c][3]);
}
***************
*** 3605,3610 ****
if (planeinfo[c].pointinfo[a][9] > 0 && planeinfo[c].pointinfo[a][10] == 0)
{
! lightnum = planeinfo[c].pointinfo[a][9] - 1;
! lights[nlights][0] = planeinfo[c].pointinfo[a][6];
lights[nlights][1] = lightnum;
nlights++;
--- 3607,3612 ----
if (planeinfo[c].pointinfo[a][9] > 0 && planeinfo[c].pointinfo[a][10] == 0)
{
! lightnum = int(planeinfo[c].pointinfo[a][9]) - 1;
! lights[nlights][0] = short(planeinfo[c].pointinfo[a][6]);
lights[nlights][1] = lightnum;
nlights++;
***************
*** 3618,3624 ****
if (planeinfo[c].polyinfo[a][6] < 2)
{
! tpoly.p1 = planeinfo[c].pointinfo[planeinfo[c].polyinfo[a][0]][6];
! tpoly.p2 = planeinfo[c].pointinfo[planeinfo[c].polyinfo[a][1]][6];
! tpoly.p3 = planeinfo[c].pointinfo[planeinfo[c].polyinfo[a][2]][6];
tpoly.tx = planeinfo[c].polyinfo[a][3];
tpoly.u[0] = planeinfo[c].polyvtx[a][0];
--- 3620,3626 ----
if (planeinfo[c].polyinfo[a][6] < 2)
{
! tpoly.p1 = int(planeinfo[c].pointinfo[planeinfo[c].polyinfo[a][0]][6]);
! tpoly.p2 = int(planeinfo[c].pointinfo[planeinfo[c].polyinfo[a][1]][6]);
! tpoly.p3 = int(planeinfo[c].pointinfo[planeinfo[c].polyinfo[a][2]][6]);
tpoly.tx = planeinfo[c].polyinfo[a][3];
tpoly.u[0] = planeinfo[c].polyvtx[a][0];
|
|
From: <b_l...@us...> - 2004-01-20 14:48:01
|
Update of /cvsroot/qb2c/goengine/src/engine
In directory sc8-pr-cvs1:/tmp/cvs-serv14333/src/engine
Modified Files:
fileinput.cpp
Log Message:
Don't crash, report loading error and quit.
Index: fileinput.cpp
===================================================================
RCS file: /cvsroot/qb2c/goengine/src/engine/fileinput.cpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** fileinput.cpp 20 Jan 2004 11:23:34 -0000 1.5
--- fileinput.cpp 20 Jan 2004 14:47:58 -0000 1.6
***************
*** 95,101 ****
sprintf(tmp, "data/maps/shadowmap/i%s_%d_%d.bmp", rfile, c, d);
temppcx = load_bmp(tmp, pal);
! if (planeinfo[c].radiosity_setup[d] == 0) planeinfo[c].radiosity[d] = create_system_bitmap(16, 16);
! blit (temppcx, planeinfo[c].radiosity[d], 0, 0, 0, 0, 16, 16);
planeinfo[c].radiosity_setup[d] = 2;
}
--- 95,107 ----
sprintf(tmp, "data/maps/shadowmap/i%s_%d_%d.bmp", rfile, c, d);
temppcx = load_bmp(tmp, pal);
! if (!temppcx) {
! printf("Error, couldn't load shadowmap (%s)\n", tmp);
! exit(1);
! }
+ if (planeinfo[c].radiosity_setup[d] == 0) {
+ planeinfo[c].radiosity[d] = create_system_bitmap(16, 16);
+ }
+ blit(temppcx, planeinfo[c].radiosity[d], 0, 0, 0, 0, 16, 16);
planeinfo[c].radiosity_setup[d] = 2;
}
|
|
From: <b_l...@us...> - 2004-01-20 11:23:37
|
Update of /cvsroot/qb2c/goengine/src/engine
In directory sc8-pr-cvs1:/tmp/cvs-serv6579/src/engine
Modified Files:
engineglobals.cpp engineglobals.h fileinput.cpp render.cpp
Log Message:
Compile fix, 'gamma' appears to be a function from math.h somewhere.
Index: engineglobals.cpp
===================================================================
RCS file: /cvsroot/qb2c/goengine/src/engine/engineglobals.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** engineglobals.cpp 20 Jan 2004 02:48:43 -0000 1.4
--- engineglobals.cpp 20 Jan 2004 11:23:34 -0000 1.5
***************
*** 24,28 ****
char textureset[100];
! float camx, camy, camz, gamma;
short scrny;
--- 24,28 ----
char textureset[100];
! float camx, camy, camz, sgamma;
short scrny;
Index: engineglobals.h
===================================================================
RCS file: /cvsroot/qb2c/goengine/src/engine/engineglobals.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** engineglobals.h 20 Jan 2004 02:48:43 -0000 1.4
--- engineglobals.h 20 Jan 2004 11:23:34 -0000 1.5
***************
*** 92,96 ****
extern char textureset[100];
! extern float camx, camy, camz, gamma;
extern short scrny;
--- 92,96 ----
extern char textureset[100];
! extern float camx, camy, camz, sgamma;
extern short scrny;
Index: fileinput.cpp
===================================================================
RCS file: /cvsroot/qb2c/goengine/src/engine/fileinput.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** fileinput.cpp 20 Jan 2004 03:05:27 -0000 1.4
--- fileinput.cpp 20 Jan 2004 11:23:34 -0000 1.5
***************
*** 113,116 ****
fclose(fp);
!
! }
\ No newline at end of file
--- 113,115 ----
fclose(fp);
! }
Index: render.cpp
===================================================================
RCS file: /cvsroot/qb2c/goengine/src/engine/render.cpp,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** render.cpp 20 Jan 2004 02:48:43 -0000 1.13
--- render.cpp 20 Jan 2004 11:23:34 -0000 1.14
***************
*** 11,19 ****
*/
#include "engineglobals.h"
#include "render.h"
#include "fileinput.h"
- #include <math.h>
void calcpoints()
--- 11,20 ----
*/
+ #include <math.h>
+
#include "engineglobals.h"
#include "render.h"
#include "fileinput.h"
void calcpoints()
***************
*** 298,307 ****
camrz = 0;
! gamma = 1;
scrny = short(-52 * xres / 320);
!
! }
!
void deinit()
{
--- 299,307 ----
camrz = 0;
! sgamma = 1;
scrny = short(-52 * xres / 320);
! }
!
void deinit()
{
|