useAirLos

useAirLos

Requests for features in the spring code.

Moderator: Moderators

Post Reply
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

useAirLos

Post by Argh »

... is being set to TRUE within the code for almost all of the Projectile classes. Should revert to FALSE, and use the definition in the file, imo...

Typical example, from BeamLaserProjectile.cpp:

Code: Select all

CBeamLaserProjectile::CBeamLaserProjectile(const float3& startPos, const float3& endPos,
        float startAlpha, float endAlpha, const float3& color, const float3& color2,
        CUnit* owner, float thickness, float corethickness, float flaresize,
        const WeaponDef* weaponDef, int ttl, float decay):

        CWeaponProjectile((startPos + endPos) * 0.5f, ZeroVector, owner, 0, ZeroVector, weaponDef, 0, false,  ttl),
        startPos(startPos),
        endPos(endPos),
        thickness(thickness),
        corethickness(corethickness),
        flaresize(flaresize),
        decay(decay)
{
        checkCol=false;
        [size=150][b]useAirLos=true;[/b][/size]

        SetRadius(pos.distance(endPos));

        if (weaponDef) {
                midtexx = weaponDef->visuals.texture2->xstart
                                + (weaponDef->visuals.texture2->xend
                                                - weaponDef->visuals.texture2->xstart) * 0.5f;
        } else {
                midtexx=0;
        }
        corecolstart[0]=(unsigned char)(color2.x*startAlpha);
        corecolstart[1]=(unsigned char)(color2.y*startAlpha);
        corecolstart[2]=(unsigned char)(color2.z*startAlpha);
        corecolstart[3]=1;
        corecolend[0]=(unsigned char)(color2.x*endAlpha);
        corecolend[1]=(unsigned char)(color2.y*endAlpha);
        corecolend[2]=(unsigned char)(color2.z*endAlpha);
        corecolend[3]=1;
        kocolstart[0]=(unsigned char)(color.x*startAlpha);
        kocolstart[1]=(unsigned char)(color.y*startAlpha);
        kocolstart[2]=(unsigned char)(color.z*startAlpha);
        kocolstart[3]=1;
        kocolend[0]=(unsigned char)(color.x*endAlpha);
        kocolend[1]=(unsigned char)(color.y*endAlpha);
        kocolend[2]=(unsigned char)(color.z*endAlpha);
        kocolend[3]=1;

        if (cegTag.size() > 0) {
                ceg.Load(explGenHandler, cegTag);
        }
}
I thought this was getting overridden somewhere... turns out I was right...
Tobi
Spring Developer
Posts: 4598
Joined: 01 Jun 2005, 11:36

Re: useAirLos

Post by Tobi »

Note though that this is in the constructor. So for CEG created projectiles, the CEG setting for airLos will override what is in the constructor.
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Re: useAirLos

Post by Argh »

Hmm. Good point.

It doesn't work, however. All CEGs are visible at airLos ranges (twice groundLos), regardless of whether that tag is present in their TDF.

This means that all CEGs are visible long before the objects creating them are visible, and creates many problems of visual discontinuity, for objects using CEGs as special effects.
Post Reply

Return to “Feature Requests”