/* Emacs style mode select -*- C++ -*- *----------------------------------------------------------------------------- * * * PrBoom: a Doom port merged with LxDoom and LSDLDoom * based on BOOM, a modified and improved DOOM engine * Copyright (C) 1999 by * id Software, Chi Hoang, Lee Killough, Jim Flynn, Rand Phares, Ty Halderman * Copyright (C) 1999-2000 by * Jess Haas, Nicolas Kalkhof, Colin Phipps, Florian Schulze * Copyright 2005, 2006 by * Florian Schulze, Colin Phipps, Neil Stevens, Andrey Budko * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA * 02111-1307, USA. * * DESCRIPTION: * Mission begin melt/wipe screen special effect. * *----------------------------------------------------------------------------- */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "z_zone.h" #include "doomdef.h" #include "i_video.h" #include "v_video.h" #include "m_random.h" #include "f_wipe.h" // // SCREEN WIPE PACKAGE // // Parts re-written to support true-color video modes. Column-major // formatting removed. - POPE // CPhipps - macros for the source and destination screens #define SRC_SCR 2 #define DEST_SCR 3 static screeninfo_t wipe_scr_start; static screeninfo_t wipe_scr_end; static screeninfo_t wipe_scr; static int y_lookup[MAX_SCREENWIDTH]; static int wipe_initMelt(int ticks) { int i; // copy start screen to main screen for(i=0;i not ready to scroll yet) y_lookup[0] = -(M_Random()%16); for (i=1;i 0) y_lookup[i] = 0; else if (y_lookup[i] == -16) y_lookup[i] = -15; } return 0; } static int wipe_doMelt(int ticks) { boolean done = true; int i; const int depth = V_GetPixelDepth(); while (ticks--) { for (i=0;i<(SCREENWIDTH);i++) { if (y_lookup[i]<0) { y_lookup[i]++; done = false; continue; } if (y_lookup[i] < SCREENHEIGHT) { byte *s, *d; int j, k, dy; /* cph 2001/07/29 - * The original melt rate was 8 pixels/sec, i.e. 25 frames to melt * the whole screen, so make the melt rate depend on SCREENHEIGHT * so it takes no longer in high res */ dy = (y_lookup[i] < 16) ? y_lookup[i]+1 : SCREENHEIGHT/25; if (y_lookup[i]+dy >= SCREENHEIGHT) dy = SCREENHEIGHT - y_lookup[i]; s = wipe_scr_end.data + (y_lookup[i]*wipe_scr_end.byte_pitch+(i*depth)); d = wipe_scr.data + (y_lookup[i]*wipe_scr.byte_pitch+(i*depth)); for (j=dy;j;j--) { for (k=0; k