[Qb2c-cvs] goengine/src/editor mapedit.cpp,1.16,1.17 mapeditglobals.h,1.8,1.9
Brought to you by:
b_lindeijer,
syn9
|
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 |