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
|