예제 #1
0
        /*
         * ===============
         * R_AliasSetupSkin
         * ===============
         */
        static void R_AliasSetupSkin()
        {
            int skinnum;
            int i, numskins;

            model.maliasskingroup_t paliasskingroup;
            double[] pskinintervals;
            double   fullskininterval;
            double   skintargettime, skintime;

            skinnum = currententity.skinnum;
            if ((skinnum >= pmdl.numskins) || (skinnum < 0))
            {
                console.Con_DPrintf("R_AliasSetupSkin: no such skin # " + skinnum + "\n");
                skinnum = 0;
            }

            pskindesc   = (model.maliasskindesc_t)paliashdr.skindesc[skinnum];
            a_skinwidth = pmdl.skinwidth;

            if (pskindesc.type == model.aliasskintype_t.ALIAS_SKIN_GROUP)
            {
                paliasskingroup  = (model.maliasskingroup_t)pskindesc.skin;
                pskinintervals   = (double[])paliasskingroup.intervals;
                numskins         = paliasskingroup.numskins;
                fullskininterval = pskinintervals[numskins - 1];

                skintime = client.cl.time + currententity.syncbase;

                // when loading in Mod_LoadAliasSkinGroup, we guaranteed all interval
                // values are positive, so we don't have to worry about division by 0
                skintargettime = skintime -
                                 ((int)(skintime / fullskininterval)) * fullskininterval;

                for (i = 0; i < (numskins - 1); i++)
                {
                    if (pskinintervals[i] > skintargettime)
                    {
                        break;
                    }
                }

                pskindesc = paliasskingroup.skindescs[i];
            }

            r_affinetridesc.pskindesc    = pskindesc;
            r_affinetridesc.pskin        = (byte[])pskindesc.skin;
            r_affinetridesc.skinwidth    = a_skinwidth;
            r_affinetridesc.seamfixupX16 = (a_skinwidth >> 1) << 16;
            r_affinetridesc.skinheight   = pmdl.skinheight;
        }
예제 #2
0
        /*
        ===============
        R_AliasSetupSkin
        ===============
        */
        static void R_AliasSetupSkin()
        {
            int                     skinnum;
            int                     i, numskins;
            model.maliasskingroup_t paliasskingroup;
            double[]                pskinintervals;
            double                  fullskininterval;
            double                  skintargettime, skintime;

            skinnum = currententity.skinnum;
            if ((skinnum >= pmdl.numskins) || (skinnum < 0))
            {
                console.Con_DPrintf("R_AliasSetupSkin: no such skin # " + skinnum + "\n");
                skinnum = 0;
            }

            pskindesc = (model.maliasskindesc_t)paliashdr.skindesc[skinnum];
            a_skinwidth = pmdl.skinwidth;

            if (pskindesc.type == model.aliasskintype_t.ALIAS_SKIN_GROUP)
            {
                paliasskingroup = (model.maliasskingroup_t)pskindesc.skin;
                pskinintervals = (double[])paliasskingroup.intervals;
                numskins = paliasskingroup.numskins;
                fullskininterval = pskinintervals[numskins - 1];

                skintime = client.cl.time + currententity.syncbase;

                // when loading in Mod_LoadAliasSkinGroup, we guaranteed all interval
                // values are positive, so we don't have to worry about division by 0
                skintargettime = skintime -
                        ((int)(skintime / fullskininterval)) * fullskininterval;

                for (i = 0; i < (numskins - 1); i++)
                {
                    if (pskinintervals[i] > skintargettime)
                        break;
                }

                pskindesc = paliasskingroup.skindescs[i];
            }

            r_affinetridesc.pskindesc = pskindesc;
            r_affinetridesc.pskin = (byte[])pskindesc.skin;
            r_affinetridesc.skinwidth = a_skinwidth;
            r_affinetridesc.seamfixupX16 = (a_skinwidth >> 1) << 16;
            r_affinetridesc.skinheight = pmdl.skinheight;
        }