From: <ac...@us...> - 2008-03-30 11:10:14
|
Revision: 12087 http://vegastrike.svn.sourceforge.net/vegastrike/?rev=12087&view=rev Author: ace123 Date: 2008-03-30 04:10:20 -0700 (Sun, 30 Mar 2008) Log Message: ----------- Fixed star streaks length, and also made it load some subunits in network so that the jump points show up properly. Modified Paths: -------------- trunk/vegastrike/src/cmd/unit_csv.cpp trunk/vegastrike/src/gfx/star.cpp Modified: trunk/vegastrike/src/cmd/unit_csv.cpp =================================================================== --- trunk/vegastrike/src/cmd/unit_csv.cpp 2008-03-30 03:59:37 UTC (rev 12086) +++ trunk/vegastrike/src/cmd/unit_csv.cpp 2008-03-30 11:10:20 UTC (rev 12087) @@ -335,7 +335,11 @@ } static void AddSubUnits (Unit *thus, Unit::XML &xml, const std::string &subunits, int faction, const std::string &modification) { if (SERVER || Network) { - return; // subvert all subunits in MP + // Semihack: Keep loading if thus is already a subunit... + // A planet can have a wormhole subunit, which itself has more subunits. + if (!thus->graphicOptions.SubUnit) { + return; // subvert all subunits in MP + } } vector<SubUnitStruct> su=GetSubUnits(subunits); xml.units.reserve(subunits.size()+xml.units.size()); Modified: trunk/vegastrike/src/gfx/star.cpp =================================================================== --- trunk/vegastrike/src/gfx/star.cpp 2008-03-30 03:59:37 UTC (rev 12086) +++ trunk/vegastrike/src/gfx/star.cpp 2008-03-30 11:10:20 UTC (rev 12087) @@ -320,9 +320,10 @@ static float fov_smoothing=XMLSupport::parse_float(vs_config->getVariable("graphics","warp.fovlink.smoothing",".4")); float fov_smoot = pow(double(fov_smoothing),GetElapsedTime()); Vector vel (-velocity*velstreakscale); - if ((smoothstreak>=minstreak||vel.MagnitudeSquared()>=minstreak*minstreak)&&(vel.i!=0||vel.j!=0||vel.k!=0)) { + float speed = vel.Magnitude(); + + if ((smoothstreak>=minstreak||vel.MagnitudeSquared()>=minstreak*minstreak)&&(speed>1.0e-7)) { ret=true; - float speed = vel.Magnitude(); vel*=1./speed; speed = fov_smoot*speed + (1-fov_smoot)*smoothstreak; |