- Fixed: The ANIMATED parser must read the bytes for the speed as unsigned bytes.

- Fixed: The screen wipe must be disabled for Heretic's underwater ending. If
  not, the wipe will try to mix pictures with different palettes.


SVN r435 (trunk)
This commit is contained in:
Christoph Oelckers 2007-01-02 09:51:04 +00:00
parent e15988505a
commit 6a89d3594a
8 changed files with 216 additions and 210 deletions

View file

@ -1,3 +1,8 @@
January 2, 2007 (Changes by Graf Zahl)
- Fixed: The ANIMATED parser must read the bytes for the speed as unsigned bytes.
- Fixed: The screen wipe must be disabled for Heretic's underwater ending. If
not, the wipe will try to mix pictures with different palettes.
December 31, 2006 (Changes by Graf Zahl) December 31, 2006 (Changes by Graf Zahl)
- Fixed: Several actors for Doom were missing their spawn ID. - Fixed: Several actors for Doom were missing their spawn ID.

View file

@ -698,7 +698,7 @@ void AddToConsole (int printlevel, const char *text)
worklen = size; worklen = size;
} }
if (work == NULL) if (work == NULL)
{ {
static char oom[] = TEXTCOLOR_RED "*** OUT OF MEMORY ***"; static char oom[] = TEXTCOLOR_RED "*** OUT OF MEMORY ***";
work = oom; work = oom;
worklen = 0; worklen = 0;

View file

@ -586,7 +586,7 @@ void D_Display (bool screenshot)
NetUpdate (); // send out any new accumulation NetUpdate (); // send out any new accumulation
if (!wipe || screenshot) if (!wipe || screenshot || NoWipe < 0)
{ {
// normal update // normal update
C_DrawConsole (); // draw console C_DrawConsole (); // draw console
@ -2273,7 +2273,7 @@ void D_DoomMain (void)
// turbo option // [RH] (now a cvar) // turbo option // [RH] (now a cvar)
{ {
UCVarValue value; UCVarValue value;
static char one_hundred[] = "100"; static char one_hundred[] = "100";
value.String = Args.CheckValue ("-turbo"); value.String = Args.CheckValue ("-turbo");

View file

@ -829,6 +829,7 @@ void F_DemonScroll ()
= =
================== ==================
*/ */
extern int NoWipe;
void F_DrawUnderwater(void) void F_DrawUnderwater(void)
{ {
@ -852,20 +853,19 @@ void F_DrawUnderwater(void)
*palette++ = PalEntry (orgpal[0], orgpal[1], orgpal[2]); *palette++ = PalEntry (orgpal[0], orgpal[1], orgpal[2]);
} }
screen->UpdatePalette (); screen->UpdatePalette ();
FinaleStage = 2;
}
// intentional fall-through
case 2:
pic = TexMan("E2END"); pic = TexMan("E2END");
screen->DrawTexture (pic, 0, 0, screen->DrawTexture (pic, 0, 0,
DTA_VirtualWidth, pic->GetWidth(), DTA_VirtualWidth, pic->GetWidth(),
DTA_VirtualHeight, pic->GetHeight(), DTA_VirtualHeight, pic->GetHeight(),
TAG_DONE); TAG_DONE);
screen->FillBorder (NULL); screen->FillBorder (NULL);
FinaleStage = 2;
}
// intentional fall-through
case 2:
paused = false; paused = false;
menuactive = MENU_Off; menuactive = MENU_Off;
NoWipe = -1;
break; break;
case 4: case 4:
@ -886,6 +886,7 @@ void F_DrawUnderwater(void)
DTA_VirtualHeight, pic->GetHeight(), DTA_VirtualHeight, pic->GetHeight(),
TAG_DONE); TAG_DONE);
screen->FillBorder (NULL); screen->FillBorder (NULL);
NoWipe = 0;
break; break;
} }
} }

View file

@ -184,10 +184,10 @@ void R_InitPicAnims (void)
// Speed is stored as tics, but we want ms so scale accordingly. // Speed is stored as tics, but we want ms so scale accordingly.
animspeed = /* .speed */ animspeed = /* .speed */
Scale ((anim_p[19] << 0) | Scale ((BYTE(anim_p[19]) << 0) |
(anim_p[20] << 8) | (BYTE(anim_p[20]) << 8) |
(anim_p[21] << 16) | (BYTE(anim_p[21]) << 16) |
(anim_p[22] << 24), 1000, 35); (BYTE(anim_p[22]) << 24), 1000, 35);
R_AddSimpleAnim (pic1, pic2 - pic1 + 1, animtype, animspeed); R_AddSimpleAnim (pic1, pic2 - pic1 + 1, animtype, animspeed);
} }

View file

@ -1,52 +1,52 @@
/* /*
** st_start.cpp ** st_start.cpp
** Handles the startup screen. ** Handles the startup screen.
** **
**--------------------------------------------------------------------------- **---------------------------------------------------------------------------
** Copyright 2006 Randy Heit ** Copyright 2006 Randy Heit
** All rights reserved. ** All rights reserved.
** **
** Redistribution and use in source and binary forms, with or without ** Redistribution and use in source and binary forms, with or without
** modification, are permitted provided that the following conditions ** modification, are permitted provided that the following conditions
** are met: ** are met:
** **
** 1. Redistributions of source code must retain the above copyright ** 1. Redistributions of source code must retain the above copyright
** notice, this list of conditions and the following disclaimer. ** notice, this list of conditions and the following disclaimer.
** 2. Redistributions in binary form must reproduce the above copyright ** 2. Redistributions in binary form must reproduce the above copyright
** notice, this list of conditions and the following disclaimer in the ** notice, this list of conditions and the following disclaimer in the
** documentation and/or other materials provided with the distribution. ** documentation and/or other materials provided with the distribution.
** 3. The name of the author may not be used to endorse or promote products ** 3. The name of the author may not be used to endorse or promote products
** derived from this software without specific prior written permission. ** derived from this software without specific prior written permission.
** **
** THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR ** THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
** IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES ** IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
** OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. ** OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
** IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, ** IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT ** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
** NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, ** NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
** THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ** THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
**--------------------------------------------------------------------------- **---------------------------------------------------------------------------
** **
*/ */
#include <unistd.h> #include <unistd.h>
#include <sys/time.h> #include <sys/time.h>
#include <sys/types.h> #include <sys/types.h>
#include <termios.h> #include <termios.h>
#include "st_start.h" #include "st_start.h"
#include "doomdef.h" #include "doomdef.h"
#include "i_system.h" #include "i_system.h"
static termios OldTermIOS; static termios OldTermIOS;
static bool DidNetInit; static bool DidNetInit;
static int NetProgressMax, NetProgressTicker; static int NetProgressMax, NetProgressTicker;
static const char *NetMessage; static const char *NetMessage;
static char SpinnyProgressChars[8] = { '|', '/', '-', '\\', '|', '/', '-', '\\' }; static char SpinnyProgressChars[8] = { '|', '/', '-', '\\', '|', '/', '-', '\\' };
//=========================================================================== //===========================================================================
// //
// ST_Init // ST_Init
@ -55,10 +55,10 @@ static char SpinnyProgressChars[8] = { '|', '/', '-', '\\', '|', '/', '-', '\\'
// //
//=========================================================================== //===========================================================================
void ST_Init(int maxProgress) void ST_Init(int maxProgress)
{ {
} }
//=========================================================================== //===========================================================================
// //
// ST_Done // ST_Done
@ -68,10 +68,10 @@ void ST_Init(int maxProgress)
// //
//=========================================================================== //===========================================================================
void ST_Done() void ST_Done()
{ {
} }
//=========================================================================== //===========================================================================
// //
// ST_Progress // ST_Progress
@ -80,10 +80,10 @@ void ST_Done()
// //
//=========================================================================== //===========================================================================
void ST_Progress() void ST_Progress()
{ {
} }
//=========================================================================== //===========================================================================
// //
// ST_NetInit // ST_NetInit
@ -93,38 +93,38 @@ void ST_Progress()
// //
//=========================================================================== //===========================================================================
void ST_NetInit(const char *message, int numplayers) void ST_NetInit(const char *message, int numplayers)
{ {
if (!DidNetInit) if (!DidNetInit)
{ {
termios rawtermios; termios rawtermios;
fprintf (stderr, "Press 'Q' to abort network game synchronization."); fprintf (stderr, "Press 'Q' to abort network game synchronization.");
// Set stdin to raw mode so we can get keypresses in ST_CheckNetAbort() // Set stdin to raw mode so we can get keypresses in ST_CheckNetAbort()
// immediately without waiting for an EOL. // immediately without waiting for an EOL.
tcgetattr (STDIN_FILENO, &OldTermIOS); tcgetattr (STDIN_FILENO, &OldTermIOS);
rawtermios = OldTermIOS; rawtermios = OldTermIOS;
rawtermios.c_lflag &= ~(ICANON | ECHO); rawtermios.c_lflag &= ~(ICANON | ECHO);
tcsetattr (STDIN_FILENO, TCSANOW, &rawtermios); tcsetattr (STDIN_FILENO, TCSANOW, &rawtermios);
DidNetInit = true; DidNetInit = true;
atterm (ST_NetDone); atterm (ST_NetDone);
} }
if (numplayers == 1) if (numplayers == 1)
{ {
// Status message without any real progress info. // Status message without any real progress info.
fprintf (stderr, "\n%s.", message); fprintf (stderr, "\n%s.", message);
} }
else else
{ {
fprintf (stderr, "\n%s: ", message); fprintf (stderr, "\n%s: ", message);
} }
fflush (stderr); fflush (stderr);
NetMessage = message; NetMessage = message;
NetProgressMax = numplayers; NetProgressMax = numplayers;
NetProgressTicker = 0; NetProgressTicker = 0;
ST_NetProgress(1); // You always know about yourself ST_NetProgress(1); // You always know about yourself
} }
//=========================================================================== //===========================================================================
// //
// ST_NetDone // ST_NetDone
@ -132,18 +132,18 @@ void ST_NetInit(const char *message, int numplayers)
// Restores the old stdin tty settings. // Restores the old stdin tty settings.
// //
//=========================================================================== //===========================================================================
void ST_NetDone() void ST_NetDone()
{ {
// Restore stdin settings // Restore stdin settings
if (DidNetInit) if (DidNetInit)
{ {
tcsetattr (STDIN_FILENO, TCSANOW, &OldTermIOS); tcsetattr (STDIN_FILENO, TCSANOW, &OldTermIOS);
printf ("\n"); printf ("\n");
DidNetInit = false; DidNetInit = false;
} }
} }
//=========================================================================== //===========================================================================
// //
// ST_NetMessage // ST_NetMessage
@ -153,18 +153,18 @@ void ST_NetDone()
// stream as normal messages. // stream as normal messages.
// //
//=========================================================================== //===========================================================================
void ST_NetMessage(const char *format, ...) void ST_NetMessage(const char *format, ...)
{ {
FString str; FString str;
va_list argptr; va_list argptr;
va_start (argptr, format); va_start (argptr, format);
str.VFormat (format, argptr); str.VFormat (format, argptr);
va_end (argptr); va_end (argptr);
fprintf (stderr, "\r%-40s\n", str.GetChars()); fprintf (stderr, "\r%-40s\n", str.GetChars());
} }
//=========================================================================== //===========================================================================
// //
// ST_NetProgress // ST_NetProgress
@ -174,37 +174,37 @@ void ST_NetMessage(const char *format, ...)
// //
//=========================================================================== //===========================================================================
void ST_NetProgress(int count) void ST_NetProgress(int count)
{ {
int i; int i;
if (count == 0) if (count == 0)
{ {
NetProgressTicker++; NetProgressTicker++;
} }
else if (count > 0) else if (count > 0)
{ {
NetProgressTicker = count; NetProgressTicker = count;
} }
if (NetProgressMax == 0) if (NetProgressMax == 0)
{ {
// Spinny-type progress meter, because we're a guest waiting for the host. // Spinny-type progress meter, because we're a guest waiting for the host.
fprintf (stderr, "\r%s: %c", NetMessage, SpinnyProgressChars[NetProgressTicker & 7]); fprintf (stderr, "\r%s: %c", NetMessage, SpinnyProgressChars[NetProgressTicker & 7]);
fflush (stderr); fflush (stderr);
} }
else if (NetProgressMax > 1) else if (NetProgressMax > 1)
{ {
// Dotty-type progress meter. // Dotty-type progress meter.
fprintf (stderr, "\r%s: ", NetMessage); fprintf (stderr, "\r%s: ", NetMessage);
for (i = 0; i < NetProgressTicker; ++i) for (i = 0; i < NetProgressTicker; ++i)
{ {
fputc ('.', stderr); fputc ('.', stderr);
} }
fprintf (stderr, "%*c[%2d/%2d]", NetProgressMax + 1 - NetProgressTicker, ' ', NetProgressTicker, NetProgressMax); fprintf (stderr, "%*c[%2d/%2d]", NetProgressMax + 1 - NetProgressTicker, ' ', NetProgressTicker, NetProgressMax);
fflush (stderr); fflush (stderr);
} }
} }
//=========================================================================== //===========================================================================
// //
// ST_NetLoop // ST_NetLoop
@ -219,44 +219,44 @@ void ST_NetProgress(int count)
// //
//=========================================================================== //===========================================================================
bool ST_NetLoop(bool (*timer_callback)(void *), void *userdata) bool ST_NetLoop(bool (*timer_callback)(void *), void *userdata)
{ {
fd_set rfds; fd_set rfds;
struct timeval tv; struct timeval tv;
int retval; int retval;
char k; char k;
for (;;) for (;;)
{ {
// Don't flood the network with packets on startup. // Don't flood the network with packets on startup.
tv.tv_sec = 0; tv.tv_sec = 0;
tv.tv_usec = 500000; tv.tv_usec = 500000;
FD_ZERO (&rfds); FD_ZERO (&rfds);
FD_SET (STDIN_FILENO, &rfds); FD_SET (STDIN_FILENO, &rfds);
retval = select (1, &rfds, NULL, NULL, &tv); retval = select (1, &rfds, NULL, NULL, &tv);
if (retval == -1) if (retval == -1)
{ {
// Error // Error
} }
else if (retval == 0) else if (retval == 0)
{ {
if (timer_callback (userdata)) if (timer_callback (userdata))
{ {
fputc ('\n', stderr); fputc ('\n', stderr);
return true; return true;
} }
} }
else if (read (STDIN_FILENO, &k, 1) == 1) else if (read (STDIN_FILENO, &k, 1) == 1)
{ {
// Check input on stdin // Check input on stdin
if (k == 'q' || k == 'Q') if (k == 'q' || k == 'Q')
{ {
fprintf (stderr, "\nNetwork game synchronization aborted."); fprintf (stderr, "\nNetwork game synchronization aborted.");
return false; return false;
} }
} }
} }
} }

View file

@ -38,7 +38,7 @@ extern void ST_Init(int maxProgress);
extern void ST_Done(); extern void ST_Done();
extern void ST_Progress(); extern void ST_Progress();
extern void ST_NetInit(const char *message, int numplayers); extern void ST_NetInit(const char *message, int numplayers);
extern void ST_NetProgress(int count); extern void ST_NetProgress(int count);
extern void ST_NetMessage(const char *format, ...); // cover for printf() extern void ST_NetMessage(const char *format, ...); // cover for printf()
extern void ST_NetDone(); extern void ST_NetDone();
extern bool ST_NetLoop(bool (*timer_callback)(void *), void *userdata); extern bool ST_NetLoop(bool (*timer_callback)(void *), void *userdata);

View file

@ -211,13 +211,13 @@ void ST_NetDone()
void ST_NetMessage(const char *format, ...) void ST_NetMessage(const char *format, ...)
{ {
FString str; FString str;
va_list argptr; va_list argptr;
va_start (argptr, format); va_start (argptr, format);
str.VFormat (format, argptr); str.VFormat (format, argptr);
va_end (argptr); va_end (argptr);
Printf ("%s\n", str.GetChars()); Printf ("%s\n", str.GetChars());
} }
//=========================================================================== //===========================================================================