Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function Update(float Scale)
- {
- local Pawn P;
- local ASDisplayInfo d;
- local array<Actor> MyTeam;
- local array<Actor> Enemy;
- local ProjectBSPawn BSP;
- local float f;
- local vector V;
- local matrix M;
- local float MapScale;
- local bool bIsRedIconType;
- local vector MapOffset;
- local PlayerController PC;
- PC = GetPC();
- Scale = 1.0/Scale;
- if (PC.Pawn == None)
- {
- return;
- }
- if (bNeedsUpdateData)
- UpdateData();
- //player
- d.hasRotation = true;
- if (ProjectBSPlayerController(PC).bRotateMinimap)
- {
- d.Rotation = 0;
- PlayerIcon.SetDisplayInfo(d);
- d.Rotation = ((PC.Rotation.Yaw) & 65535) * (-360.0/65536.0);
- CompassIcon.SetDisplayInfo(d);
- f = -((PC.Rotation.Yaw + 16384) & 65535) * (Pi/32768.0);
- IconMatrix.XPlane.X = cos(f) * Scale;
- IconMatrix.XPlane.Y = sin(f) * Scale;
- IconMatrix.YPlane.X = -sin(f) * Scale;
- IconMatrix.YPlane.Y = cos(f) * Scale;
- IconMatrix.WPlane.X = 0;
- IconMatrix.WPlane.Y = 0;
- IconMatrix.WPlane.Z = 0;
- IconMatrix.WPlane.W = 1;
- IconMatrix.WPlane = TransformVector(IconMatrix, -PC.Pawn.Location);
- }
- else
- {
- d.Rotation = 0;
- CompassIcon.SetDisplayInfo(d);
- d.Rotation = ((PC.Rotation.Yaw) & 65535) * (360.0/65536.0);
- PlayerIcon.SetDisplayInfo(d);
- f = -Pi*0.5;
- IconMatrix.XPlane.X = 0;
- IconMatrix.XPlane.Y = -Scale;
- IconMatrix.YPlane.X = Scale;
- IconMatrix.YPlane.Y = 0;
- IconMatrix.WPlane.X = 0;
- IconMatrix.WPlane.Y = 0;
- IconMatrix.WPlane.Z = 0;
- IconMatrix.WPlane.W = 1;
- IconMatrix.WPlane = TransformVector(IconMatrix, -PC.Pawn.Location);
- }
- d.hasRotation = false;
- // terrain
- if (MapInfo != none && MapInfo.MapTexture != none)
- {
- f -= Pi*0.5;
- MapScale = Hud.NormalZoomf/(2.0 * Hud.CurZoomf);
- M.XPlane.X = -cos(f) * MapScale;
- M.XPlane.Y = -sin(f) * MapScale;
- M.YPlane.X = sin(f) * MapScale;
- M.YPlane.Y = -cos(f) * MapScale;
- MapOffset.X = -MapTexSize*0.5f;
- MapOffset.Y = -MapTexSize*0.5f;
- M.WPlane.X = 0;
- M.WPlane.Y = 0;
- M.WPlane.Z = 0;
- M.WPlane.W = 1;
- M.WPlane = TransformVector(M, MapOffset);
- f = Pi*1.5-f;
- V = (MapInfo.MapCenter - PC.Pawn.Location) * MapTexSize/MapInfo.MapExtent;
- MapScale = (Hud.NormalZoomf/(2.0 * Hud.CurZoomf));
- M.WPlane.X += (V.X * cos(f) + V.Y * sin(f)) * MapScale;
- M.WPlane.Y += (V.Y * cos(f) - V.X * sin(f)) * MapScale;
- MapMC.SetDisplayMatrix(M);
- }
- // other players
- foreach ThisWorld.AllPawns(class'Pawn', P)
- {
- if ( P.bHidden || (P.Health <=0) || P.IsInvisible() || (P.PlayerReplicationInfo == None) || (P == PC.Pawn))
- continue;
- BSP = ProjectBSPawn(P);
- if (BSP == None)
- continue;
- if (ThisWorld.GRI.OnSameTeam(PC, P))
- MyTeam.AddItem(P);
- else
- Enemy.AddItem(P);
- }
- bIsRedIconType = (PC.PlayerReplicationInfo.Team == None) || (PC.PlayerReplicationInfo.Team.TeamIndex == 0);
- UpdateIcons(Enemy, EnemyIcons, !bIsRedIconType);
- UpdateIcons(MyTeam, MyTeamIcons, bIsRedIconType);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement