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
|