Beispiel #1
0
void D_WipeDraw()
{
	int				wipestart;
	boolean			done;

	 wipestart = I_GetTime () - 1;

	// MIKE 11/08 don't busy wait here during wipes, let Flash update
   /* do
    {
	do
	{
	    nowtime = I_GetTime ();
	    tics = nowtime - wipestart;
	} while (!tics);
	wipestart =		nowtime;*/
	done = wipe_ScreenWipe(wipe_Melt
			       , 0, 0, SCREENWIDTH, SCREENHEIGHT, 1);
	if(done)wipe = false;	// MIKE 11/08

	I_UpdateNoBlit ();
	M_Drawer ();                            // menu is drawn even on top of wipes
	I_FinishUpdate ();                      // page flip or blit buffer
    //} while (!done);
}
Beispiel #2
0
void D_DoomTicker(int tics, fixed_t frac)
{
	static boolean wipe = false;
	int i;

	if (tics > 4) tics = 4;

	if (!wipe) {
		D_ProcessEvents();

		for (i = 0; i < tics; ++i) {
			D_DoAdvanceDemo();
			M_Ticker();
			G_Ticker();
		}

		// move positional sounds
		S_UpdateSounds(players[consoleplayer].mo);

		// change the view size if needed
		if (setsizeneeded) {
			R_ExecuteSetViewSize();
			oldgamestate = -1;	// force background redraw
		}
		// save the current screen if about to wipe
		if (gamestate != wipegamestate) {
			wipe = true;
			wipe_StartScreen(0, 0, SCREENWIDTH, SCREENHEIGHT);
		}

		D_Display(frac);
		oldgamestate = wipegamestate = gamestate;

		if (wipe) {
			wipe_EndScreen(0, 0, SCREENWIDTH, SCREENHEIGHT);
		}
	}

	if (wipe && tics > 0) {
		if (wipe_ScreenWipe(wipe_Melt, 0, 0, SCREENWIDTH, SCREENHEIGHT,
				    tics)) {
			// done
			wipe = false;
		}
	}
	// menu is drawn even on top of everything
	M_Drawer();
	I_FinishUpdate(tics);
	framecount++;
}
Beispiel #3
0
static void D_Wipe(void)
{
   boolean done;
   int wipestart = I_GetTime () - 1;

   do
   {
      int nowtime, tics;
      do
      {
         //I_uSleep(5000); // CPhipps - don't thrash cpu in this loop
         nowtime = I_GetTime();
         tics = nowtime - wipestart;
      }
      while (!tics);
      wipestart = nowtime;

      done = wipe_ScreenWipe(0,0,SCREENWIDTH,SCREENHEIGHT,tics);
      M_Drawer();                   // menu is drawn even on top of wipes
      I_FinishUpdate();             // page flip or blit buffer
   }
   while (!done);
}
Beispiel #4
0
FrameType D_DoomWipeFrame(int& elapsedTicks)
{
	int				nowtime;
	int				tics;
	qboolean			done;

	do
	{
		nowtime = I_GetTime();
		tics = nowtime - wipestart;
		if (!tics)
		{
			doomCallbacks->Sleep();
		}
	} while (!tics);
	wipestart = nowtime;

	elapsedTicks = tics;
	done = wipe_ScreenWipe(wipe_Melt, SCREENWIDTH, SCREENHEIGHT, tics);

	M_Drawer();                            // menu is drawn even on top of wipes

	return done ? FrameType::NORMAL : FrameType::WIPE;
}
Beispiel #5
0
void D_Display (void)
{
    static  boolean		viewactivestate = false;
    static  boolean		menuactivestate = false;
    static  boolean		inhelpscreensstate = false;
    static  boolean		fullscreen = false;
    static  gamestate_t		oldgamestate = -1;
    static  int			borderdrawcount;
    int				nowtime;
    int				tics;
    int				wipestart;
    int				y;
    boolean			done;
    boolean			wipe;
    boolean			redrawsbar;

    if (nodrawers)
	return;                    // for comparative timing / profiling
		
    redrawsbar = false;
    
    // change the view size if needed
    if (setsizeneeded)
    {
	R_ExecuteSetViewSize ();
	oldgamestate = -1;                      // force background redraw
	borderdrawcount = 3;
    }

    // save the current screen if about to wipe
    if (gamestate != wipegamestate)
    {
	wipe = true;
	wipe_StartScreen(0, 0, SCREENWIDTH, SCREENHEIGHT);
    }
    else
	wipe = false;

    if (gamestate == GS_LEVEL && gametic)
	HU_Erase();
    
    // do buffered drawing
    switch (gamestate)
    {
      case GS_LEVEL:
	if (!gametic)
	    break;
	if (automapactive)
	    AM_Drawer ();
	if (wipe || (viewheight != 200 && fullscreen) )
	    redrawsbar = true;
	if (inhelpscreensstate && !inhelpscreens)
	    redrawsbar = true;              // just put away the help screen
	ST_Drawer (viewheight == 200, redrawsbar );
	fullscreen = viewheight == 200;
	break;

      case GS_INTERMISSION:
	WI_Drawer ();
	break;

      case GS_FINALE:
	F_Drawer ();
	break;

      case GS_DEMOSCREEN:
	D_PageDrawer ();
	break;
    }
    
    // draw buffered stuff to screen
    I_UpdateNoBlit ();
    
    // draw the view directly
    if (gamestate == GS_LEVEL && !automapactive && gametic)
	R_RenderPlayerView (&players[displayplayer]);

    if (gamestate == GS_LEVEL && gametic)
	HU_Drawer ();
    
    // clean up border stuff
    if (gamestate != oldgamestate && gamestate != GS_LEVEL)
	I_SetPalette (W_CacheLumpName ("PLAYPAL",PU_CACHE));

    // see if the border needs to be initially drawn
    if (gamestate == GS_LEVEL && oldgamestate != GS_LEVEL)
    {
	viewactivestate = false;        // view was not active
	R_FillBackScreen ();    // draw the pattern into the back screen
    }

    // see if the border needs to be updated to the screen
    if (gamestate == GS_LEVEL && !automapactive && scaledviewwidth != 320)
    {
	if (menuactive || menuactivestate || !viewactivestate)
	    borderdrawcount = 3;
	if (borderdrawcount)
	{
	    R_DrawViewBorder ();    // erase old menu stuff
	    borderdrawcount--;
	}

    }

    menuactivestate = menuactive;
    viewactivestate = viewactive;
    inhelpscreensstate = inhelpscreens;
    oldgamestate = wipegamestate = gamestate;
    
    // draw pause pic
    if (paused)
    {
	if (automapactive)
	    y = 4;
	else
	    y = viewwindowy+4;
	V_DrawPatchDirect(viewwindowx+(scaledviewwidth-68)/2,
			  y,0,W_CacheLumpName ("M_PAUSE", PU_CACHE));
    }


    // menus go directly to the screen
    M_Drawer ();          // menu is drawn even on top of everything
    NetUpdate ();         // send out any new accumulation


    // normal update
    if (!wipe)
    {
	I_FinishUpdate ();              // page flip or blit buffer
	return;
    }
    
    // wipe update
    wipe_EndScreen(0, 0, SCREENWIDTH, SCREENHEIGHT);

    wipestart = I_GetTime () - 1;

    do
    {
	do
	{
	    nowtime = I_GetTime ();
	    tics = nowtime - wipestart;
	} while (!tics);
	wipestart = nowtime;
	done = wipe_ScreenWipe(wipe_Melt
			       , 0, 0, SCREENWIDTH, SCREENHEIGHT, tics);
	I_UpdateNoBlit ();
	M_Drawer ();                            // menu is drawn even on top of wipes
	I_FinishUpdate ();                      // page flip or blit buffer
    } while (!done);
}
Beispiel #6
0
//
// D_Display
//  draw current display, possibly wiping it from the previous
//
void D_Display (void)
{
    BOOL wipe;

    if (nodrawers)
        return; 				// for comparative timing / profiling

    BEGIN_STAT(D_Display);

    if (gamestate == GS_LEVEL && viewactive && consoleplayer().camera)
        R_SetFOV (consoleplayer().camera->player ?
                  consoleplayer().camera->player->fov : 90.0f);

    // [RH] change the screen mode if needed
    if (setmodeneeded)
    {
        int oldwidth = screen->width;
        int oldheight = screen->height;
        int oldbits = DisplayBits;

        // Change screen mode.
        if (!V_SetResolution (NewWidth, NewHeight, NewBits))
            if (!V_SetResolution (oldwidth, oldheight, oldbits))
                I_FatalError ("Could not change screen mode");

        // Recalculate various view parameters.
        setsizeneeded = true;
        // Trick status bar into rethinking its position
        st_scale.Callback ();
        // Refresh the console.
        C_NewModeAdjust ();
    }

    // change the view size if needed
    if (setsizeneeded)
    {
        R_ExecuteSetViewSize ();
        setmodeneeded = false;
    }

    I_BeginUpdate ();

    // [RH] Allow temporarily disabling wipes
    if (NoWipe)
    {
        NoWipe--;
        wipe = false;
        wipegamestate = gamestate;
    }
    else if (gamestate != wipegamestate && gamestate != GS_FULLCONSOLE)
    {   // save the current screen if about to wipe
        wipe = true;
        wipe_StartScreen ();
        wipegamestate = gamestate;
    }
    else
    {
        wipe = false;
    }

    switch (gamestate)
    {
    case GS_FULLCONSOLE:
    case GS_DOWNLOAD:
    case GS_CONNECTING:
        C_DrawConsole ();
        M_Drawer ();
        I_FinishUpdate ();
        return;

    case GS_LEVEL:
        if (!gametic)
            break;

        // denis - freshen the borders (ffs..)
        R_DrawViewBorder ();    // erase old menu stuff

        if (viewactive)
            R_RenderPlayerView (&displayplayer());
        if (automapactive)
            AM_Drawer ();
        C_DrawMid ();
        CTF_DrawHud ();
        ST_Drawer ();
        HU_Drawer ();
        break;

    case GS_INTERMISSION:
        if (viewactive)
            R_RenderPlayerView (&displayplayer());
        C_DrawMid ();
        CTF_DrawHud ();
        WI_Drawer ();
        HU_Drawer ();
        break;

    case GS_FINALE:
        F_Drawer ();
        break;

    case GS_DEMOSCREEN:
        D_PageDrawer ();
        break;

    default:
        break;
    }

    // draw pause pic
    if (paused && !menuactive)
    {
        patch_t *pause = W_CachePatch ("M_PAUSE");
        int y;

        y = (automapactive && !viewactive) ? 4 : viewwindowy + 4;
        screen->DrawPatchCleanNoMove (pause, (screen->width-(pause->width())*CleanXfac)/2, y);
    }

    // [RH] Draw icon, if any
    if (D_DrawIcon)
    {
        int lump = W_CheckNumForName (D_DrawIcon);

        D_DrawIcon = NULL;
        if (lump >= 0)
        {
            patch_t *p = W_CachePatch (lump);

            screen->DrawPatchIndirect (p, 160-p->width()/2, 100-p->height()/2);
        }
        NoWipe = 10;
    }

    static bool live_wiping = false;

    if (!wipe)
    {
        if(live_wiping)
        {
            // wipe update online (multiple calls, not just looping here)
            C_DrawConsole ();
            wipe_EndScreen();
            live_wiping = !wipe_ScreenWipe (1);
            M_Drawer ();			// menu is drawn even on top of wipes
            I_FinishUpdate ();		// page flip or blit buffer
        }
        else
        {
            // normal update
            C_DrawConsole ();	// draw console
            M_Drawer ();		// menu is drawn even on top of everything
            I_FinishUpdate ();	// page flip or blit buffer
        }
    }
    else
    {
        if(!connected)
        {
            // wipe update offline
            int wipestart, wipecont, nowtime, tics;
            BOOL done;

            C_DrawConsole ();
            wipe_EndScreen ();
            I_FinishUpdateNoBlit ();

            extern int canceltics;

            wipestart = I_GetTime ();
            wipecont = wipestart - 1;

            do
            {
                do
                {
                    nowtime = I_GetTime ();
                    tics = nowtime - wipecont;
                } while (!tics);
                wipecont = nowtime;
                I_BeginUpdate ();
                done = wipe_ScreenWipe (tics);
                M_Drawer ();			// menu is drawn even on top of wipes
                I_FinishUpdate ();		// page flip or blit buffer
            } while (!done);

            if(!connected)
                canceltics += I_GetTime () - wipestart;
        }
        else
        {
            // wipe update online
            live_wiping = true;

            // wipe update online (multiple calls, not just looping here)
            C_DrawConsole ();
            wipe_EndScreen();
            live_wiping = !wipe_ScreenWipe (1);
            M_Drawer ();			// menu is drawn even on top of wipes
            I_FinishUpdate ();		// page flip or blit buffer
        }
    }

    END_STAT(D_Display);
}
Beispiel #7
0
static void D_Wipe(void)
{
   in_d_wipe = !wipe_ScreenWipe(1);
   M_Drawer();                   // menu is drawn even on top of wipes
   I_FinishUpdate();             // page flip or blit buffer
}
Beispiel #8
0
void D_Display(void)
{
    static boolean     viewactivestate = false;
    static boolean     menuactivestate = false;
    static boolean     pausedstate = false;
    static gamestate_t oldgamestate = (gamestate_t)(-1);
    static int         borderdrawcount;
    int                nowtime;
    int                tics;
    int                wipestart;
    boolean            done;

    // change the view size if needed
    if (setsizeneeded)
    {
        R_ExecuteSetViewSize();
        oldgamestate = (gamestate_t)(-1);         // force background redraw
        borderdrawcount = 3;
    }

    // save the current screen if about to wipe
    if ((wipe = (gamestate != wipegamestate || forcewipe)))
    {
        wipe_StartScreen();
        if (forcewipe)
            forcewipe = false;
        else
            menuactive = false;
    }

    if (gamestate != GS_LEVEL)
    {
        if (gamestate != oldgamestate)
            I_SetPalette((byte *)W_CacheLumpName("PLAYPAL", PU_CACHE));

        switch (gamestate)
        {
            case GS_INTERMISSION:
                WI_Drawer();
                break;

            case GS_FINALE:
                F_Drawer();
                break;

            case GS_DEMOSCREEN:
                D_PageDrawer();
                break;
        }
    }
    else if (gametic)
    {
        HU_Erase();

        ST_Drawer(viewheight == SCREENHEIGHT, true);

        // draw the view directly
        R_RenderPlayerView(&players[displayplayer]);

        if (automapactive)
            AM_Drawer();

        // see if the border needs to be initially drawn
        if (oldgamestate != GS_LEVEL)
        {
            viewactivestate = false;    // view was not active
            R_FillBackScreen();         // draw the pattern into the back screen
        }

        // see if the border needs to be updated to the screen
        if (!automapactive)
        {
            if (scaledviewwidth != SCREENWIDTH)
            {
                if (menuactive || menuactivestate || !viewactivestate || paused || pausedstate || message_on)
                    borderdrawcount = 3;
                if (borderdrawcount)
                {
                    R_DrawViewBorder();     // erase old menu stuff
                    borderdrawcount--;
                }
            }
            if (graphicdetail == LOW)
                V_LowGraphicDetail(0, viewheight2);
        }
        HU_Drawer();
    }

    menuactivestate = menuactive;
    viewactivestate = viewactive;
    oldgamestate = wipegamestate = gamestate;

    // draw pause pic
    if ((pausedstate = paused))
    {
        M_DarkBackground();
        if (M_PAUSE)
        {
            patch_t     *patch = W_CacheLumpName("M_PAUSE", PU_CACHE);

            if (widescreen)
                V_DrawPatchWithShadow((ORIGINALWIDTH - patch->width) / 2,
                                      viewwindowy / 2 + (viewheight / 2 - patch->height) / 2,
                                      0, patch, false);
            else
                V_DrawPatchWithShadow((ORIGINALWIDTH - patch->width) / 2,
                                      (ORIGINALHEIGHT - patch->height) / 2,
                                      0, patch, false);
        }
        else
        {
            if (widescreen)
                M_DrawCenteredString(viewwindowy / 2 + (viewheight / 2 - 16) / 2, "Paused");
            else
                M_DrawCenteredString((ORIGINALHEIGHT - 16) / 2, "Paused");
        }
    }

    // menus go directly to the screen
    M_Drawer();                 // menu is drawn even on top of everything

    // normal update
    if (!wipe)
    {
        I_FinishUpdate();       // page flip or blit buffer
        return;
    }

    // wipe update
    wipe_EndScreen();

    wipestart = I_GetTime() - 1;

    do
    {
        do
        {
            nowtime = I_GetTime();
            tics = nowtime - wipestart;
            I_Sleep(1);
        }
        while (tics <= 0);

        wipestart = nowtime;
        done = wipe_ScreenWipe(tics);
        blurred = false;
        M_Drawer();             // menu is drawn even on top of wipes
        I_FinishUpdate();       // page flip or blit buffer
    }
    while (!done);
}
Beispiel #9
0
void D_Display (void)
{
    static  boolean             viewactivestate = false;
    static  boolean             menuactivestate = false;
    static  boolean             inhelpscreensstate = false;
    static  boolean             popupactivestate = false; // [STRIFE]
    static  boolean             fullscreen = false;
    static  gamestate_t         oldgamestate = -1;
    static  int                 borderdrawcount;
    int                         nowtime;
    int                         tics;
    int                         wipestart;
    int                         y;
    boolean                     done;
    boolean                     wipe;
    boolean                     redrawsbar;

    if (nodrawers)
        return;                    // for comparative timing / profiling

    redrawsbar = false;
    
    // change the view size if needed
    if (setsizeneeded)
    {
        R_ExecuteSetViewSize ();
        oldgamestate = -1;                      // force background redraw
        borderdrawcount = 3;
    }

    // save the current screen if about to wipe
    if (gamestate != wipegamestate)
    {
        wipe = true;
        wipe_StartScreen(0, 0, SCREENWIDTH, SCREENHEIGHT);
    }
    else
        wipe = false;

    if (gamestate == GS_LEVEL && gametic)
        HU_Erase();

    // do buffered drawing
    switch (gamestate)
    {
    case GS_LEVEL:
        if (!gametic)
            break;
        if (automapactive)
            AM_Drawer ();
        if (wipe || (viewheight != 200 && fullscreen) )
            redrawsbar = true;
        // haleyjd 08/29/10: [STRIFE] Always redraw sbar if menu is/was active
        if (menuactivestate || (inhelpscreensstate && !inhelpscreens))
            redrawsbar = true;              // just put away the help screen
        ST_Drawer (viewheight == 200, redrawsbar );
        fullscreen = viewheight == 200;
        break;
      
     // haleyjd 08/23/2010: [STRIFE] No intermission
     /*
     case GS_INTERMISSION:
         WI_Drawer ();
         break;
     */

    case GS_FINALE:
        F_Drawer ();
        break;

    case GS_DEMOSCREEN:
        D_PageDrawer ();
        break;
    
    default:
        break;
    }
    
    // draw buffered stuff to screen
    I_UpdateNoBlit ();

    // draw the view directly
    if (gamestate == GS_LEVEL && !automapactive && gametic)
        R_RenderPlayerView (&players[displayplayer]);

    // clean up border stuff
    if (gamestate != oldgamestate && gamestate != GS_LEVEL)
        I_SetPalette (W_CacheLumpName (DEH_String("PLAYPAL"),PU_CACHE));

    // see if the border needs to be initially drawn
    if (gamestate == GS_LEVEL && oldgamestate != GS_LEVEL)
    {
        viewactivestate = false;        // view was not active
        R_FillBackScreen ();    // draw the pattern into the back screen
    }

    // see if the border needs to be updated to the screen
    if (gamestate == GS_LEVEL && !automapactive && scaledviewwidth != 320)
    {
        if (menuactive || menuactivestate || !viewactivestate)
        {
            borderdrawcount = 3;
            popupactivestate = false;
        }
        if (borderdrawcount)
        {
            R_DrawViewBorder ();    // erase old menu stuff
            borderdrawcount--;
        }

    }

    if (testcontrols)
    {
        // Box showing current mouse speed

        V_DrawMouseSpeedBox(testcontrols_mousespeed);
    }

    menuactivestate = menuactive;
    viewactivestate = viewactive;
    inhelpscreensstate = inhelpscreens;
    oldgamestate = wipegamestate = gamestate;

    // haleyjd 20120208: [STRIFE] Rogue moved this down to below border drawing
    if (gamestate == GS_LEVEL && gametic)
    {
        HU_Drawer ();
        if(ST_DrawExternal()) 
            popupactivestate = true;
        else if(popupactivestate)
        {
            popupactivestate = false;
            menuactivestate = 1;
        }
    }

    // draw pause pic
    if (paused)
    {
        if (automapactive)
            y = 4;
        else
            y = viewwindowy+4;
        V_DrawPatchDirect(viewwindowx + (scaledviewwidth - 68) / 2, y,
                          W_CacheLumpName (DEH_String("M_PAUSE"), PU_CACHE));
    }


    // menus go directly to the screen
    M_Drawer ();          // menu is drawn even on top of everything
    NetUpdate ();         // send out any new accumulation


    // normal update
    if (!wipe)
    {
        I_FinishUpdate ();              // page flip or blit buffer
        return;
    }
    
    // wipe update
    wipe_EndScreen(0, 0, SCREENWIDTH, SCREENHEIGHT);

    wipestart = I_GetTime () - 1;

    do
    {
        do
        {
            nowtime = I_GetTime ();
            tics = nowtime - wipestart;
            I_Sleep(1);
        } while (tics < 3); // haleyjd 08/23/2010: [STRIFE] Changed from == 0 to < 3

        // haleyjd 08/26/10: [STRIFE] Changed to use ColorXForm wipe.
        wipestart = nowtime;
        done = wipe_ScreenWipe(wipe_ColorXForm
                               , 0, 0, SCREENWIDTH, SCREENHEIGHT, tics);
        I_UpdateNoBlit ();
        M_Drawer ();                            // menu is drawn even on top of wipes
        I_FinishUpdate ();                      // page flip or blit buffer
    } while (!done);
}