Example #1
0
static void AddSpriteLump(lumpinfo_t *lump)
{
    sprite_frame_t      *sprite;
    int                 angle_num;
    int                 i;

    // first angle
    sprite = FindSpriteFrame(lump->name, lump->name[4]);
    angle_num = lump->name[5] - '0';

    if (angle_num == 0)
    {
        for (i = 0; i < 8; ++i)
            sprite->angle_lumps[i] = lump;
    }
    else
        sprite->angle_lumps[angle_num - 1] = lump;

    // second angle

    // no second angle?
    if (lump->name[6] == '\0')
        return;

    sprite = FindSpriteFrame(lump->name, lump->name[6]);
    angle_num = lump->name[7] - '0';

    if (angle_num == 0)
    {
        for (i = 0; i < 8; ++i)
            sprite->angle_lumps[i] = lump;
    }
    else
        sprite->angle_lumps[angle_num - 1] = lump;
}
Example #2
0
// Check if sprite lump is needed in the new wad
static dboolean SpriteLumpNeeded(lumpinfo_t *lump)
{
    sprite_frame_t  *sprite;
    int             angle_num;

    if (!ValidSpriteLumpName(lump->name))
        return true;

    // check the first frame
    sprite = FindSpriteFrame(lump->name, lump->name[4]);
    angle_num = lump->name[5] - '0';

    if (!angle_num)
    {
        // must check all frames
        for (int i = 0; i < 8; i++)
            if (sprite->angle_lumps[i] == lump)
                return true;
    }
    else
    {
        // check if this lump is being used for this frame
        if (sprite->angle_lumps[angle_num - 1] == lump)
            return true;
    }

    // second frame if any

    // no second frame?
    if (lump->name[6] == '\0')
        return false;

    sprite = FindSpriteFrame(lump->name, lump->name[6]);
    angle_num = lump->name[7] - '0';

    if (!angle_num)
    {
        // must check all frames
        for (int i = 0; i < 8; i++)
            if (sprite->angle_lumps[i] == lump)
                return true;
    }
    else
    {
        // check if this lump is being used for this frame
        if (sprite->angle_lumps[angle_num - 1] == lump)
            return true;
    }

    return false;
}
Example #3
0
static void AddSpriteLump(lumpinfo_t *lump)
{
    sprite_frame_t  *sprite;
    int             angle_num;
    int             i = 0;
    static int      MISFA0;
    static int      MISFB0;
    dboolean        ispackagewad = M_StringCompare(leafname(lump->wadfile->path), PACKAGE_WAD);

    if (!ValidSpriteLumpName(lump->name))
        return;

    if (lump->wadfile->type == PWAD)
    {
        if (M_StringCompare(lump->name, "SHT2A0") && !BTSX)
            SHT2A0 = true;

        if (!ispackagewad)
        {
            MISFA0 += M_StringCompare(lump->name, "MISFA0");
            MISFB0 += M_StringCompare(lump->name, "MISFB0");

            while (*weaponsprites[i].spr1)
            {
                if (M_StringStartsWith(lump->name, weaponsprites[i].spr1)
                    || (*weaponsprites[i].spr2 && M_StringStartsWith(lump->name, weaponsprites[i].spr2)))
                    weaponinfo[i].altered = true;

                i++;
            }
        }

        if (M_StringCompare(lump->name, "BAR1A0") || M_StringCompare(lump->name, "BAR1B0"))
        {
            states[S_BAR3].nextstate = S_BAR2;
            mobjinfo[MT_BARREL].frames = 2;
        }
    }

    if (ispackagewad && M_StringStartsWith(lump->name, "MISF") && ((MISFA0 >= 2 || MISFB0 >= 2) || hacx || FREEDOOM))
        return;

    // first angle
    sprite = FindSpriteFrame(lump->name, lump->name[4]);
    angle_num = lump->name[5] - '0';

    if (!angle_num)
    {
        for (i = 0; i < 8; i++)
            sprite->angle_lumps[i] = lump;
    }
    else
        sprite->angle_lumps[angle_num - 1] = lump;

    // second angle

    // no second angle?
    if (lump->name[6] == '\0')
        return;

    sprite = FindSpriteFrame(lump->name, lump->name[6]);
    angle_num = lump->name[7] - '0';

    if (!angle_num)
    {
        for (i = 0; i < 8; i++)
            sprite->angle_lumps[i] = lump;
    }
    else
        sprite->angle_lumps[angle_num - 1] = lump;
}