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 ----
|