예제 #1
0
void P_ArchiveSpecials(void)
{
    /*
    T_MoveCeiling, (ceiling_t: sector_t * swizzle), - active list
    T_VerticalDoor, (vldoor_t: sector_t * swizzle),
    T_MoveFloor, (floormove_t: sector_t * swizzle),
    T_LightFlash, (lightflash_t: sector_t * swizzle),
    T_StrobeFlash, (strobe_t: sector_t *),
    T_Glow, (glow_t: sector_t *),
    T_PlatRaise, (plat_t: sector_t *), - active list
    */

    thinker_t *th;

    for (th = thinkercap.next; th != &thinkercap; th = th->next)
    {
        if (th->function == T_MoveCeiling)
        {
            SV_WriteByte(tc_ceiling);
            saveg_write_ceiling_t((ceiling_t *) th);
        }
        else if (th->function == T_VerticalDoor)
        {
            SV_WriteByte(tc_door);
            saveg_write_vldoor_t((vldoor_t *) th);
        }
        else if (th->function == T_MoveFloor)
        {
            SV_WriteByte(tc_floor);
            saveg_write_floormove_t((floormove_t *) th);
        }
        else if (th->function == T_PlatRaise)
        {
            SV_WriteByte(tc_plat);
            saveg_write_plat_t((plat_t *) th);
        }
        else if (th->function == T_LightFlash)
        {
            SV_WriteByte(tc_flash);
            saveg_write_lightflash_t((lightflash_t *) th);
        }
        else if (th->function == T_StrobeFlash)
        {
            SV_WriteByte(tc_strobe);
            saveg_write_strobe_t((strobe_t *) th);
        }
        else if (th->function == T_Glow)
        {
            SV_WriteByte(tc_glow);
            saveg_write_glow_t((glow_t *) th);
        }
    }
    // Add a terminating marker
    SV_WriteByte(tc_endspecials);
}
예제 #2
0
//
// Things to handle:
//
// T_MoveCeiling, (ceiling_t: sector_t * swizzle), - active list
// T_VerticalDoor, (vldoor_t: sector_t * swizzle),
// T_MoveFloor, (floormove_t: sector_t * swizzle),
// T_LightFlash, (lightflash_t: sector_t * swizzle),
// T_StrobeFlash, (strobe_t: sector_t *),
// T_Glow, (glow_t: sector_t *),
// T_PlatRaise, (plat_t: sector_t *), - active list
//
void P_ArchiveSpecials (void)
{
    thinker_t*		th;
    int			i;
	
    // save off the current thinkers
    for (th = thinkercap.next ; th != &thinkercap ; th=th->next)
    {
	if (th->function.acv == (actionf_v)NULL)
	{
	    for (i = 0; i < MAXCEILINGS;i++)
		if (activeceilings[i] == (ceiling_t *)th)
		    break;
	    
	    if (i<MAXCEILINGS)
	    {
                saveg_write8(tc_ceiling);
		saveg_write_pad();
                saveg_write_ceiling_t((ceiling_t *) th);
	    }
	    continue;
	}
			
	if (th->function.acp1 == (actionf_p1)T_MoveCeiling)
	{
            saveg_write8(tc_ceiling);
	    saveg_write_pad();
            saveg_write_ceiling_t((ceiling_t *) th);
	    continue;
	}
			
	if (th->function.acp1 == (actionf_p1)T_VerticalDoor)
	{
            saveg_write8(tc_door);
	    saveg_write_pad();
            saveg_write_vldoor_t((vldoor_t *) th);
	    continue;
	}
			
	if (th->function.acp1 == (actionf_p1)T_MoveFloor)
	{
            saveg_write8(tc_floor);
	    saveg_write_pad();
            saveg_write_floormove_t((floormove_t *) th);
	    continue;
	}
			
	if (th->function.acp1 == (actionf_p1)T_PlatRaise)
	{
            saveg_write8(tc_plat);
	    saveg_write_pad();
            saveg_write_plat_t((plat_t *) th);
	    continue;
	}
			
	if (th->function.acp1 == (actionf_p1)T_LightFlash)
	{
            saveg_write8(tc_flash);
	    saveg_write_pad();
            saveg_write_lightflash_t((lightflash_t *) th);
	    continue;
	}
			
	if (th->function.acp1 == (actionf_p1)T_StrobeFlash)
	{
            saveg_write8(tc_strobe);
	    saveg_write_pad();
            saveg_write_strobe_t((strobe_t *) th);
	    continue;
	}
			
	if (th->function.acp1 == (actionf_p1)T_Glow)
	{
            saveg_write8(tc_glow);
	    saveg_write_pad();
            saveg_write_glow_t((glow_t *) th);
	    continue;
	}
    }
	
    // add a terminating marker
    saveg_write8(tc_endspecials);

}
예제 #3
0
//
// P_ArchiveSpecials
//
void P_ArchiveSpecials(void)
{
    int         i = maxbuttons;
    button_t    *button_ptr = buttonlist;

    // save off the current thinkers
    for (thinker_t *th = thinkers[th_misc].cnext; th != &thinkers[th_misc]; th = th->cnext)
    {
        if (!th->function)
        {
            dboolean    done_one = false;

            for (ceilinglist_t *ceilinglist = activeceilings; ceilinglist; ceilinglist = ceilinglist->next)
                if (ceilinglist->ceiling == (ceiling_t *)th)
                {
                    saveg_write8(tc_ceiling);
                    saveg_write_pad();
                    saveg_write_ceiling_t((ceiling_t *)th);
                    done_one = true;
                    break;
                }

            // [jeff-d] save height of moving platforms
            for (platlist_t *platlist = activeplats; platlist; platlist = platlist->next)
                if (platlist->plat == (plat_t *)th)
                {
                    saveg_write8(tc_plat);
                    saveg_write_pad();
                    saveg_write_plat_t((plat_t *)th);
                    done_one = true;
                    break;
                }

            if (done_one)
                continue;
        }

        if (th->function == T_MoveCeiling)
        {
            saveg_write8(tc_ceiling);
            saveg_write_pad();
            saveg_write_ceiling_t((ceiling_t *)th);
            continue;
        }

        if (th->function == T_VerticalDoor)
        {
            saveg_write8(tc_door);
            saveg_write_pad();
            saveg_write_vldoor_t((vldoor_t *)th);
            continue;
        }

        if (th->function == T_MoveFloor)
        {
            saveg_write8(tc_floor);
            saveg_write_pad();
            saveg_write_floormove_t((floormove_t *)th);
            continue;
        }

        if (th->function == T_PlatRaise)
        {
            saveg_write8(tc_plat);
            saveg_write_pad();
            saveg_write_plat_t((plat_t *)th);
            continue;
        }

        if (th->function == T_LightFlash)
        {
            saveg_write8(tc_flash);
            saveg_write_pad();
            saveg_write_lightflash_t((lightflash_t *)th);
            continue;
        }

        if (th->function == T_StrobeFlash)
        {
            saveg_write8(tc_strobe);
            saveg_write_pad();
            saveg_write_strobe_t((strobe_t *)th);
            continue;
        }

        if (th->function == T_Glow)
        {
            saveg_write8(tc_glow);
            saveg_write_pad();
            saveg_write_glow_t((glow_t *)th);
            continue;
        }

        if (th->function == T_FireFlicker)
        {
            saveg_write8(tc_fireflicker);
            saveg_write_pad();
            saveg_write_fireflicker_t((fireflicker_t *)th);
            continue;
        }

        if (th->function == T_MoveElevator)
        {
            saveg_write8(tc_elevator);
            saveg_write_pad();
            saveg_write_elevator_t((elevator_t *)th);
            continue;
        }

        if (th->function == T_Scroll)
        {
            saveg_write8(tc_scroll);
            saveg_write_pad();
            saveg_write_scroll_t((scroll_t *)th);
            continue;
        }

        if (th->function == T_Pusher)
        {
            saveg_write8(tc_pusher);
            saveg_write_pad();
            saveg_write_pusher_t((pusher_t *)th);
            continue;
        }
    }

    do
    {
        if (button_ptr->btimer)
        {
            saveg_write8(tc_button);
            saveg_write_pad();
            saveg_write_button_t(button_ptr);
        }

        button_ptr++;
    } while (--i);

    // add a terminating marker
    saveg_write8(tc_endspecials);
}