@@ -4419,38 +4419,24 @@ void AHuman::Update()
4419
4419
// ////////////////////////////////////////////////////////////////////////////////////////
4420
4420
// Description: Draws an aiming aid in front of this HeldDevice for throwing.
4421
4421
4422
- void AHuman::DrawThrowingReticule (BITMAP *pTargetBitmap, const Vector &targetPos, float amount)
4422
+ void AHuman::DrawThrowingReticule (BITMAP *pTargetBitmap, const Vector &targetPos, double amount) const
4423
4423
{
4424
4424
const int pointCount = 9 ;
4425
4425
Vector points[pointCount];
4426
- // Color colors[pointCount];
4427
-
4428
- points[0 ].SetXY (0 , 0 );
4429
- // colors[0].SetRGB(255, 225, 0);
4430
- points[1 ].SetXY (4 , 0 );
4431
- // colors[1].SetRGB(250, 210, 5);
4432
- points[2 ].SetXY (8 , 0 );
4433
- // colors[2].SetRGB(250, 180, 5);
4434
- points[3 ].SetXY (12 , 0 );
4435
- // colors[3].SetRGB(250, 160, 5);
4436
- points[4 ].SetXY (16 , 0 );
4437
- // colors[4].SetRGB(242, 120, 5);
4438
- points[5 ].SetXY (20 , 0 );
4439
- // colors[5].SetRGB(240, 90, 6);
4440
- points[6 ].SetXY (24 , 0 );
4441
- // colors[6].SetRGB(240, 50, 8);
4442
- points[7 ].SetXY (28 , 0 );
4443
- // colors[7].SetRGB(230, 40, 10);
4444
- points[8 ].SetXY (32 , 0 );
4445
- // colors[8].SetRGB(230, 30, 10);
4426
+ // Color colors[pointCount];
4427
+
4428
+ for (int index = 0 ; index < pointCount; index++) {
4429
+ points[index].SetXY (static_cast <float >(index * 4 ), 0 .0F );
4430
+ // colors[index].SetRGB(255 - index * 3, 225 - index * 20, index);
4431
+ }
4446
4432
4447
4433
Vector outOffset (m_HFlipped ? -15 : 15 , -4 );
4448
4434
// Matrix aimMatrix(m_AimAngle);
4449
4435
// aimMatrix.SetXFlipped(m_HFlipped);
4450
4436
4451
4437
acquire_bitmap (pTargetBitmap);
4452
4438
4453
- for (int i = 0 ; i < ( pointCount * amount) ; ++i) {
4439
+ for (int i = 0 ; i < pointCount * amount; ++i) {
4454
4440
points[i].FlipX (m_HFlipped);
4455
4441
points[i] += outOffset;
4456
4442
points[i].RadRotate (m_HFlipped ? -m_AimAngle : m_AimAngle);
@@ -4459,9 +4445,9 @@ void AHuman::DrawThrowingReticule(BITMAP *pTargetBitmap, const Vector &targetPos
4459
4445
points[i] += m_pFGArm->GetParentOffset ();
4460
4446
4461
4447
// Put the flickering glows on the reticule dots, in absolute scene coordinates
4462
- g_PostProcessMan.RegisterGlowDotEffect (points[i], YellowDot, 55 . 0F + RandomNum (0 . 0F , 100 . 0F ));
4448
+ g_PostProcessMan.RegisterGlowDotEffect (points[i], YellowDot, 55 + RandomNum (0 , 100 ));
4463
4449
4464
- putpixel (pTargetBitmap, points[i].m_X - targetPos.m_X , points[i].m_Y - targetPos.m_Y , g_YellowGlowColor);
4450
+ putpixel (pTargetBitmap, points[i].GetFloorIntX () - targetPos.GetFloorIntX () , points[i].GetFloorIntY () - targetPos.GetFloorIntY () , g_YellowGlowColor);
4465
4451
}
4466
4452
4467
4453
release_bitmap (pTargetBitmap);
@@ -4659,23 +4645,23 @@ void AHuman::Draw(BITMAP *pTargetBitmap,
4659
4645
m_Paths[m_HFlipped][CLIMB].Draw (pTargetBitmap, targetPos, 165 );
4660
4646
}
4661
4647
4662
- if (mode == g_DrawColor && !onlyPhysical)
4663
- {
4664
- acquire_bitmap (pTargetBitmap);
4665
- putpixel (pTargetBitmap, std::floor (m_Pos.m_X ),
4666
- std::floor (m_Pos.m_Y ),
4667
- 64 );
4668
- putpixel (pTargetBitmap, std::floor (m_Pos.m_X ),
4669
- std::floor (m_Pos.m_Y ),
4670
- 64 );
4671
- release_bitmap (pTargetBitmap);
4672
-
4673
- // m_pAtomGroup->Draw(pTargetBitmap, targetPos, false, 122);
4674
- m_pFGFootGroup->Draw (pTargetBitmap, targetPos, true , 13 );
4675
- m_pBGFootGroup->Draw (pTargetBitmap, targetPos, true , 13 );
4676
- m_pFGHandGroup->Draw (pTargetBitmap, targetPos, true , 13 );
4677
- m_pBGHandGroup->Draw (pTargetBitmap, targetPos, true , 13 );
4678
- }
4648
+ if (mode == g_DrawColor && !onlyPhysical)
4649
+ {
4650
+ acquire_bitmap (pTargetBitmap);
4651
+ putpixel (pTargetBitmap, std::floor (m_Pos.m_X ),
4652
+ std::floor (m_Pos.m_Y ),
4653
+ 64 );
4654
+ putpixel (pTargetBitmap, std::floor (m_Pos.m_X ),
4655
+ std::floor (m_Pos.m_Y ),
4656
+ 64 );
4657
+ release_bitmap (pTargetBitmap);
4658
+
4659
+ // m_pAtomGroup->Draw(pTargetBitmap, targetPos, false, 122);
4660
+ m_pFGFootGroup->Draw (pTargetBitmap, targetPos, true , 13 );
4661
+ m_pBGFootGroup->Draw (pTargetBitmap, targetPos, true , 13 );
4662
+ m_pFGHandGroup->Draw (pTargetBitmap, targetPos, true , 13 );
4663
+ m_pBGHandGroup->Draw (pTargetBitmap, targetPos, true , 13 );
4664
+ }
4679
4665
#endif
4680
4666
}
4681
4667
@@ -4687,67 +4673,67 @@ void AHuman::Draw(BITMAP *pTargetBitmap,
4687
4673
// BITMAP of choice.
4688
4674
4689
4675
void AHuman::DrawHUD (BITMAP *pTargetBitmap, const Vector &targetPos, int whichScreen, bool playerControlled) {
4690
- if (!m_HUDVisible)
4691
- return ;
4676
+ if (!m_HUDVisible)
4677
+ return ;
4692
4678
4693
- // Only do HUD if on a team
4694
- if (m_Team < 0 )
4695
- return ;
4679
+ // Only do HUD if on a team
4680
+ if (m_Team < 0 )
4681
+ return ;
4696
4682
4697
- // Only draw if the team viewing this is on the same team OR has seen the space where this is located
4698
- int viewingTeam = g_ActivityMan.GetActivity ()->GetTeamOfPlayer (g_ActivityMan.GetActivity ()->PlayerOfScreen (whichScreen));
4699
- if (viewingTeam != m_Team && viewingTeam != Activity::NoTeam)
4700
- {
4701
- if (g_SceneMan.IsUnseen (m_Pos.m_X , m_Pos.m_Y , viewingTeam))
4702
- return ;
4703
- }
4683
+ // Only draw if the team viewing this is on the same team OR has seen the space where this is located
4684
+ int viewingTeam = g_ActivityMan.GetActivity ()->GetTeamOfPlayer (g_ActivityMan.GetActivity ()->PlayerOfScreen (whichScreen));
4685
+ if (viewingTeam != m_Team && viewingTeam != Activity::NoTeam)
4686
+ {
4687
+ if (g_SceneMan.IsUnseen (m_Pos.m_X , m_Pos.m_Y , viewingTeam))
4688
+ return ;
4689
+ }
4704
4690
4705
- Actor::DrawHUD (pTargetBitmap, targetPos, whichScreen);
4691
+ Actor::DrawHUD (pTargetBitmap, targetPos, whichScreen);
4706
4692
4707
4693
#ifdef DEBUG_BUILD
4708
- // Limbpath debug drawing
4709
- m_Paths[FGROUND][WALK].Draw (pTargetBitmap, targetPos, 122 );
4710
- m_Paths[FGROUND][CRAWL].Draw (pTargetBitmap, targetPos, 122 );
4711
- m_Paths[FGROUND][ARMCRAWL].Draw (pTargetBitmap, targetPos, 13 );
4712
- m_Paths[FGROUND][CLIMB].Draw (pTargetBitmap, targetPos, 98 );
4713
-
4714
- m_Paths[BGROUND][WALK].Draw (pTargetBitmap, targetPos, 122 );
4715
- m_Paths[BGROUND][CRAWL].Draw (pTargetBitmap, targetPos, 122 );
4716
- m_Paths[BGROUND][ARMCRAWL].Draw (pTargetBitmap, targetPos, 13 );
4717
- m_Paths[BGROUND][CLIMB].Draw (pTargetBitmap, targetPos, 98 );
4718
-
4719
- // Draw the AI paths
4720
- list<Vector>::iterator last = m_MovePath.begin ();
4721
- Vector waypoint, lastPoint, lineVec;
4722
- for (list<Vector>::iterator lItr = m_MovePath.begin (); lItr != m_MovePath.end (); ++lItr)
4723
- {
4724
- lastPoint = (*last) - targetPos;
4725
- waypoint = lastPoint + g_SceneMan.ShortestDistance (lastPoint, (*lItr) - targetPos);
4726
- line (pTargetBitmap, lastPoint.m_X , lastPoint.m_Y , waypoint.m_X , waypoint.m_Y , g_RedColor);
4727
- last = lItr;
4728
- }
4729
- waypoint = m_MoveTarget - targetPos;
4730
- circlefill (pTargetBitmap, waypoint.m_X , waypoint.m_Y , 3 , g_RedColor);
4731
- lastPoint = m_PrevPathTarget - targetPos;
4732
- circlefill (pTargetBitmap, lastPoint.m_X , lastPoint.m_Y , 2 , g_YellowGlowColor);
4733
- lastPoint = m_DigTunnelEndPos - targetPos;
4734
- circlefill (pTargetBitmap, lastPoint.m_X , lastPoint.m_Y , 2 , g_YellowGlowColor);
4735
- // Raidus
4694
+ // Limbpath debug drawing
4695
+ m_Paths[FGROUND][WALK].Draw (pTargetBitmap, targetPos, 122 );
4696
+ m_Paths[FGROUND][CRAWL].Draw (pTargetBitmap, targetPos, 122 );
4697
+ m_Paths[FGROUND][ARMCRAWL].Draw (pTargetBitmap, targetPos, 13 );
4698
+ m_Paths[FGROUND][CLIMB].Draw (pTargetBitmap, targetPos, 98 );
4699
+
4700
+ m_Paths[BGROUND][WALK].Draw (pTargetBitmap, targetPos, 122 );
4701
+ m_Paths[BGROUND][CRAWL].Draw (pTargetBitmap, targetPos, 122 );
4702
+ m_Paths[BGROUND][ARMCRAWL].Draw (pTargetBitmap, targetPos, 13 );
4703
+ m_Paths[BGROUND][CLIMB].Draw (pTargetBitmap, targetPos, 98 );
4704
+
4705
+ // Draw the AI paths
4706
+ list<Vector>::iterator last = m_MovePath.begin ();
4707
+ Vector waypoint, lastPoint, lineVec;
4708
+ for (list<Vector>::iterator lItr = m_MovePath.begin (); lItr != m_MovePath.end (); ++lItr)
4709
+ {
4710
+ lastPoint = (*last) - targetPos;
4711
+ waypoint = lastPoint + g_SceneMan.ShortestDistance (lastPoint, (*lItr) - targetPos);
4712
+ line (pTargetBitmap, lastPoint.m_X , lastPoint.m_Y , waypoint.m_X , waypoint.m_Y , g_RedColor);
4713
+ last = lItr;
4714
+ }
4715
+ waypoint = m_MoveTarget - targetPos;
4716
+ circlefill (pTargetBitmap, waypoint.m_X , waypoint.m_Y , 3 , g_RedColor);
4717
+ lastPoint = m_PrevPathTarget - targetPos;
4718
+ circlefill (pTargetBitmap, lastPoint.m_X , lastPoint.m_Y , 2 , g_YellowGlowColor);
4719
+ lastPoint = m_DigTunnelEndPos - targetPos;
4720
+ circlefill (pTargetBitmap, lastPoint.m_X , lastPoint.m_Y , 2 , g_YellowGlowColor);
4721
+ // Raidus
4736
4722
// waypoint = m_Pos - targetPos;
4737
4723
// circle(pTargetBitmap, waypoint.m_X, waypoint.m_Y, m_MoveProximityLimit, g_RedColor);
4738
4724
#endif
4739
4725
4740
- // Player AI drawing
4726
+ // Player AI drawing
4741
4727
4742
- // Device aiming reticule
4728
+ // Device aiming reticule
4743
4729
if (m_Controller.IsState (AIM_SHARP) && m_pFGArm && m_pFGArm->IsAttached () && m_pFGArm->HoldsHeldDevice ()) {
4744
4730
m_pFGArm->GetHeldDevice ()->DrawHUD (pTargetBitmap, targetPos, whichScreen, m_Controller.IsPlayerControlled ());
4745
4731
}
4732
+
4746
4733
4747
-
4748
- // Throwing reticule
4734
+ // Throwing reticule
4749
4735
if (m_ArmsState == THROWING_PREP) {
4750
- DrawThrowingReticule (pTargetBitmap, targetPos, std::min (static_cast < float >( m_ThrowTmr.GetElapsedSimTimeMS () / m_ThrowPrepTime) , 1 .0F ));
4736
+ DrawThrowingReticule (pTargetBitmap, targetPos, std::min (m_ThrowTmr.GetElapsedSimTimeMS () / m_ThrowPrepTime, 1.0 ));
4751
4737
}
4752
4738
4753
4739
// ////////////////////////////////////
0 commit comments