Commit 237ec21a authored by Steven Fuller's avatar Steven Fuller

* Fixed problem with pressing START in map mode (it would flash and go back)

* Fixed topsprite in GL mode
* Tried (but failed) to fix key holding (when you win/die, you can exit the
screen too quickly)
parent 3e9c0037
...@@ -289,7 +289,7 @@ void IO_ClearViewBuffer() ...@@ -289,7 +289,7 @@ void IO_ClearViewBuffer()
/* glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); */ /* glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); */
glClear(GL_DEPTH_BUFFER_BIT); glClear(GL_DEPTH_BUFFER_BIT);
/* IO_AttackShape disables depth */ glDisable(GL_DEPTH_TEST);
glMatrixMode(GL_MODELVIEW); glMatrixMode(GL_MODELVIEW);
glLoadIdentity(); glLoadIdentity();
...@@ -508,25 +508,34 @@ void DrawSprite(thing_t *t) ...@@ -508,25 +508,34 @@ void DrawSprite(thing_t *t)
void DrawTopSprite() void DrawTopSprite()
{ {
GLfloat z = -128.0 / (GLfloat)topspritescale; GLfloat z;
if (topspritescale) {
glMatrixMode(GL_MODELVIEW); z = -128.0 / (GLfloat)topspritescale;
glPushMatrix();
glLoadIdentity();
if (LastTexture != sprtex[topspritenum]) { glDisable(GL_DEPTH_TEST);
LastTexture = sprtex[topspritenum];
glBindTexture(GL_TEXTURE_2D, sprtex[topspritenum]);
}
glBegin(GL_QUADS); glMatrixMode(GL_MODELVIEW);
glTexCoord2f(1.0, 0.0); glVertex3f( 0.5, 1, z); glPushMatrix();
glTexCoord2f(1.0, 1.0); glVertex3f( 0.5, -1, z); glLoadIdentity();
glTexCoord2f(0.0, 1.0); glVertex3f(-0.5, -1, z);
glTexCoord2f(0.0, 0.0); glVertex3f(-0.5, 1, z); if (LastTexture != sprtex[topspritenum]) {
glEnd(); LastTexture = sprtex[topspritenum];
glBindTexture(GL_TEXTURE_2D, sprtex[topspritenum]);
}
glBegin(GL_QUADS);
glTexCoord2f(1.0, 0.0); glVertex3f( 0.5, 1, z);
glTexCoord2f(1.0, 1.0); glVertex3f( 0.5, -1, z);
glTexCoord2f(0.0, 1.0); glVertex3f(-0.5, -1, z);
glTexCoord2f(0.0, 0.0); glVertex3f(-0.5, 1, z);
glEnd();
glPopMatrix(); glPopMatrix();
glEnable(GL_DEPTH_TEST);
}
} }
Word *src1,*src2,*dest; /* Used by the sort */ Word *src1,*src2,*dest; /* Used by the sort */
......
...@@ -79,7 +79,7 @@ void RunAutoMap(void) ...@@ -79,7 +79,7 @@ void RunAutoMap(void)
oldjoy &= joystick1; oldjoy &= joystick1;
newjoy = joystick1 ^ oldjoy; newjoy = joystick1 ^ oldjoy;
if (newjoy & (JOYPAD_START|JOYPAD_SELECT|JOYPAD_A|JOYPAD_B|JOYPAD_X|JOYPAD_Y)) { if (newjoy & (JOYPAD_SELECT|JOYPAD_A|JOYPAD_B|JOYPAD_X|JOYPAD_Y)) {
playstate = EX_STILLPLAYING; playstate = EX_STILLPLAYING;
} }
if (newjoy & JOYPAD_UP && vy) { if (newjoy & JOYPAD_UP && vy) {
......
This is not yet finished, but: This is not yet finished, but:
Wolfenstein 3D is an id Software game. This is a port of the Macintosh Wolfenstein 3D is an Id Software game. This is a port of the Macintosh
version that was released by MacPlay in 1994. You can find information about version that was released by MacPlay in 1994. You can find information about
the source release at: http://www.maccentral.com/news/0001/24.wolf3d.shtml the source release at: http://www.maccentral.com/news/0001/24.wolf3d.shtml
WolfReadMe.txt, from that Mac Wolf3d source release, is also included with WolfReadMe.txt, from that Mac Wolf3d source release, is also included with
...@@ -13,7 +13,7 @@ to Linux before, so when I found the source to the Macintosh version, I ...@@ -13,7 +13,7 @@ to Linux before, so when I found the source to the Macintosh version, I
thought "Why not?" So here it is. My goal is to implement everything the thought "Why not?" So here it is. My goal is to implement everything the
Macintosh version had, and then somehow improve on that. Macintosh version had, and then somehow improve on that.
To use this, you need the resource fork from the First Encounter (the two To use this, you need the resource fork from the First Encounter (the three
level shareware version) or the Second Encounter (the for-sell version). level shareware version) or the Second Encounter (the for-sell version).
You can find the First Encounter on many web sites (Search for: Macintosh You can find the First Encounter on many web sites (Search for: Macintosh
Wolfenstein 3D download) and you can get the Second Encounter on eBay (I Wolfenstein 3D download) and you can get the Second Encounter on eBay (I
...@@ -54,8 +54,8 @@ resource fork. ...@@ -54,8 +54,8 @@ resource fork.
Status of the port: Status of the port:
You can play the game, but not save, load, change difficulty, hear sounds You can play the game, but not save, load, change difficulty, hear sounds
and music, use the mouse, and change window size. View TODO for the and music, use the mouse and joystics, and change window size. View TODO for
specifics. the specifics.
Specifically: Specifically:
swolf3d : The SVGAlib Version. Only supports 320x200x256 at the moment, so swolf3d : The SVGAlib Version. Only supports 320x200x256 at the moment, so
...@@ -70,7 +70,8 @@ use it so I can have menus and dialogs without having to create them in Xlib. ...@@ -70,7 +70,8 @@ use it so I can have menus and dialogs without having to create them in Xlib.
Any suggestions? Any suggestions?
glwolf3d: The OpenGL Version (written using Xlib w/ GLX). I like it. Not glwolf3d: The OpenGL Version (written using Xlib w/ GLX). I like it. Not
all graphics are currently shown. all graphics are currently shown (So when you have a blank screen, press
enter a few times to get passed the screens).
Note: The available targets (binaries) may change over time as I decide Note: The available targets (binaries) may change over time as I decide
which APIs work the best, etc. which APIs work the best, etc.
...@@ -90,7 +91,7 @@ Macintosh version) for answering my inquiries. ...@@ -90,7 +91,7 @@ Macintosh version) for answering my inquiries.
Steven Fuller <relnev@users.sourceforge.net> Steven Fuller <relnev@users.sourceforge.net>
http://wolf3d.sourceforge.net/
---------------------------- ----------------------------
TODO (Stuff to Write About): TODO (Stuff to Write About):
......
...@@ -11,15 +11,14 @@ TODO: ...@@ -11,15 +11,14 @@ TODO:
640x400 or 480 is supported?) 640x400 or 480 is supported?)
* Finish moving all 2D code to SoftDraw.c * Finish moving all 2D code to SoftDraw.c
* Finish OpenGL * Finish OpenGL
- Check if topsprite drawing is correct
+ Status bars, Introscreens [DrawShape] + Status bars, Introscreens [DrawShape]
- Not sure exactly yet how I will implement this yet. - Not exactly sure how I will implement this yet.
- Correct viewing frustum - Correct viewing frustum
+ Allow window resizing - Allow window resizing
- Only bother with 640x480 versions of GameShapes. Minimum for GLQuake
was 640x480, and you could get lower resolutions with software.
- Could use the LastTexture to have less glBegin/Ends (would need to know - Could use the LastTexture to have less glBegin/Ends (would need to know
where to stop though (try IO_DisplayViewBuffer). where to stop though (try IO_DisplayViewBuffer).
- When all drawing is implemented, remove any unnecessary state/matrix
changes.
* Save/Load Games * Save/Load Games
* Documentation * Documentation
* Sound! * Sound!
...@@ -37,6 +36,9 @@ BUGS: ...@@ -37,6 +36,9 @@ BUGS:
forth, and walls 'swim' when you move around, or sprites pop into different forth, and walls 'swim' when you move around, or sprites pop into different
sizes when are far enough and get closer/farther away sizes when are far enough and get closer/farther away
- Possibly caused by 8.8 imprecision? - Possibly caused by 8.8 imprecision?
* Automap may not be "just right" in OpenGL. Some walls are clipped on the
left side for example.
* If you die/win, and have a key held down, screen passes by too fast
IDEAS: IDEAS:
* Menu Keys * Menu Keys
......
...@@ -140,9 +140,12 @@ angle_t PointToAngle(fixed_t x, fixed_t y) ...@@ -140,9 +140,12 @@ angle_t PointToAngle(fixed_t x, fixed_t y)
void GameOver(void) void GameOver(void)
{ {
FlushKeys();
topspritenum = S_GAMEOVER; /* Game over words */ topspritenum = S_GAMEOVER; /* Game over words */
topspritescale = 8; /* Start the scale factor */ topspritescale = 8; /* Start the scale factor */
do { do {
WaitTick();
RenderView(); /* Draw the 3-d view */ RenderView(); /* Draw the 3-d view */
topspritescale+=8; topspritescale+=8;
} while (topspritescale<120); } while (topspritescale<120);
...@@ -173,10 +176,13 @@ void GameOver(void) ...@@ -173,10 +176,13 @@ void GameOver(void)
void VictoryScale(void) void VictoryScale(void)
{ {
FlushKeys();
topspritenum = S_VICTORY; topspritenum = S_VICTORY;
topspritescale = 16; topspritescale = 16;
do { do {
WaitTick();
RenderView(); RenderView();
topspritescale += 16; topspritescale += 16;
} while (topspritescale<240); } while (topspritescale<240);
...@@ -461,6 +467,7 @@ skipbrief: ...@@ -461,6 +467,7 @@ skipbrief:
nextmap = MapListPtr->InfoArray[gamestate.mapon].NextLevel; /* Normal warp? */ nextmap = MapListPtr->InfoArray[gamestate.mapon].NextLevel; /* Normal warp? */
} /* If warped, then nextmap is preset */ } /* If warped, then nextmap is preset */
if (nextmap == 0xffff) { /* Last level? */ if (nextmap == 0xffff) { /* Last level? */
FlushKeys();
VictoryScale(); /* You win!! */ VictoryScale(); /* You win!! */
ReleaseMap(); /* Unload the map */ ReleaseMap(); /* Unload the map */
Intermission(); /* Display the wrapup... */ Intermission(); /* Display the wrapup... */
......
/* /*
Copyright (C) 1992-1994 Id Software, Inc. Copyright (C) 1992-1994 Id Software, Inc.
Copyright (C) 2000 Steven Fuller <relnev@atdot.org>
This program is free software; you can redistribute it and/or This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License modify it under the terms of the GNU General Public License
......
...@@ -31,7 +31,6 @@ Byte *gfxbuf; ...@@ -31,7 +31,6 @@ Byte *gfxbuf;
void keyboard_handler(int key, int press); void keyboard_handler(int key, int press);
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
if (argc != 2) { if (argc != 2) {
...@@ -195,7 +194,9 @@ static int keys[128]; ...@@ -195,7 +194,9 @@ static int keys[128];
void FlushKeys() void FlushKeys()
{ {
while (keyboard_update()) ; while (keyboard_update()) ;
keyboard_clearstate();
gamestate.keys = 0;
joystick1 = 0; joystick1 = 0;
memset(keys, 0, sizeof(keys)); memset(keys, 0, sizeof(keys));
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment