Skip to content
This repository was archived by the owner on Jan 5, 2024. It is now read-only.

Commit 3d6564b

Browse files
committed
Removed SetIntX,Y,XY methods
The regular SetX,Y,XY can be used instead, with the same result.
1 parent 31e68d5 commit 3d6564b

File tree

7 files changed

+23
-45
lines changed

7 files changed

+23
-45
lines changed

Entities/HDFirearm.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -787,7 +787,7 @@ void HDFirearm::Update()
787787
(m_Supported ? 1.0F : m_NoSupportFactor) * RandomNormalNum();
788788
tempNozzle = m_MuzzleOff.GetYFlipped(m_HFlipped);
789789
tempNozzle.DegRotate(degAimAngle + shake);
790-
roundVel.SetIntXY(pRound->GetFireVel(), 0);
790+
roundVel.SetXY(static_cast<int>(pRound->GetFireVel()), 0);
791791
roundVel.DegRotate(degAimAngle + shake);
792792

793793
Vector particlePos;
@@ -851,7 +851,7 @@ void HDFirearm::Update()
851851
pShell->SetPos(m_Pos + tempEject);
852852

853853
// ##@#@@$ TEMP
854-
shellVel.SetIntXY(pRound->GetShellVel(), 0);
854+
shellVel.SetXY(static_cast<int>(pRound->GetShellVel()), 0);
855855
shellVel.DegRotate(degAimAngle + 150 * (m_HFlipped ? -1 : 1) + shellSpread);
856856
pShell->SetVel(m_Vel + shellVel);
857857
pShell->SetRotAngle(m_Rotation.GetRadAngle());

Managers/FrameMan.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -972,23 +972,23 @@ namespace RTE {
972972
case Players::PlayerTwo:
973973
// If both splits, or just VSplit, then in upper right quadrant
974974
if ((m_VSplit && !m_HSplit) || (m_VSplit && m_HSplit)) {
975-
screenOffset.SetIntXY(GetResX() / 2, 0);
975+
screenOffset.SetXY(GetResX() / 2, 0);
976976
} else {
977977
// If only HSplit, then lower left quadrant
978-
screenOffset.SetIntXY(0, GetResY() / 2);
978+
screenOffset.SetXY(0, GetResY() / 2);
979979
}
980980
break;
981981
case Players::PlayerThree:
982982
// Always lower left quadrant
983-
screenOffset.SetIntXY(0, GetResY() / 2);
983+
screenOffset.SetXY(0, GetResY() / 2);
984984
break;
985985
case Players::PlayerFour:
986986
// Always lower right quadrant
987-
screenOffset.SetIntXY(GetResX() / 2, GetResY() / 2);
987+
screenOffset.SetXY(GetResX() / 2, GetResY() / 2);
988988
break;
989989
default:
990990
// Always upper left corner
991-
screenOffset.SetIntXY(0, 0);
991+
screenOffset.SetXY(0, 0);
992992
break;
993993
}
994994
}

Managers/SceneMan.cpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1849,7 +1849,7 @@ bool SceneMan::CastMaterialRay(const Vector &start, const Vector &ray, unsigned
18491849
foundPixel = true;
18501850
result.SetXY(intPos[X], intPos[Y]);
18511851
// Save last ray pos
1852-
m_LastRayHitPos.SetIntXY(intPos[X], intPos[Y]);
1852+
m_LastRayHitPos.SetXY(intPos[X], intPos[Y]);
18531853
break;
18541854
}
18551855

@@ -1981,7 +1981,7 @@ bool SceneMan::CastNotMaterialRay(const Vector &start, const Vector &ray, unsign
19811981
foundPixel = true;
19821982
result.SetXY(intPos[X], intPos[Y]);
19831983
// Save last ray pos
1984-
m_LastRayHitPos.SetIntXY(intPos[X], intPos[Y]);
1984+
m_LastRayHitPos.SetXY(intPos[X], intPos[Y]);
19851985
break;
19861986
}
19871987

@@ -2309,7 +2309,7 @@ bool SceneMan::CastStrengthRay(const Vector &start, const Vector &ray, float str
23092309
foundPixel = true;
23102310
result.SetXY(intPos[X], intPos[Y]);
23112311
// Save last ray pos
2312-
m_LastRayHitPos.SetIntXY(intPos[X], intPos[Y]);
2312+
m_LastRayHitPos.SetXY(intPos[X], intPos[Y]);
23132313
break;
23142314
}
23152315
}
@@ -2429,7 +2429,7 @@ bool SceneMan::CastWeaknessRay(const Vector &start, const Vector &ray, float str
24292429
foundPixel = true;
24302430
result.SetXY(intPos[X], intPos[Y]);
24312431
// Save last ray pos
2432-
m_LastRayHitPos.SetIntXY(intPos[X], intPos[Y]);
2432+
m_LastRayHitPos.SetXY(intPos[X], intPos[Y]);
24332433
break;
24342434
}
24352435

@@ -2555,15 +2555,15 @@ MOID SceneMan::CastMORay(const Vector &start, const Vector &ray, MOID ignoreMOID
25552555
else
25562556
{
25572557
// Save last ray pos
2558-
m_LastRayHitPos.SetIntXY(intPos[X], intPos[Y]);
2558+
m_LastRayHitPos.SetXY(intPos[X], intPos[Y]);
25592559
return hitMOID;
25602560
}
25612561
}
25622562
// Legit hit
25632563
else
25642564
{
25652565
// Save last ray pos
2566-
m_LastRayHitPos.SetIntXY(intPos[X], intPos[Y]);
2566+
m_LastRayHitPos.SetXY(intPos[X], intPos[Y]);
25672567
return hitMOID;
25682568
}
25692569
}
@@ -2575,7 +2575,7 @@ MOID SceneMan::CastMORay(const Vector &start, const Vector &ray, MOID ignoreMOID
25752575
if (hitTerrain != g_MaterialAir && hitTerrain != ignoreMaterial)
25762576
{
25772577
// Save last ray pos
2578-
m_LastRayHitPos.SetIntXY(intPos[X], intPos[Y]);
2578+
m_LastRayHitPos.SetXY(intPos[X], intPos[Y]);
25792579
return g_NoMOID;
25802580
}
25812581
}
@@ -2686,7 +2686,7 @@ bool SceneMan::CastFindMORay(const Vector &start, const Vector &ray, MOID target
26862686
// Found target MOID, so save result and report success
26872687
resultPos.SetXY(intPos[X], intPos[Y]);
26882688
// Save last ray pos
2689-
m_LastRayHitPos.SetIntXY(intPos[X], intPos[Y]);
2689+
m_LastRayHitPos.SetXY(intPos[X], intPos[Y]);
26902690
return true;
26912691
}
26922692

@@ -2697,7 +2697,7 @@ bool SceneMan::CastFindMORay(const Vector &start, const Vector &ray, MOID target
26972697
if (hitTerrain != g_MaterialAir && hitTerrain != ignoreMaterial)
26982698
{
26992699
// Save last ray pos
2700-
m_LastRayHitPos.SetIntXY(intPos[X], intPos[Y]);
2700+
m_LastRayHitPos.SetXY(intPos[X], intPos[Y]);
27012701
return false;
27022702
}
27032703
}
@@ -2831,7 +2831,7 @@ float SceneMan::CastObstacleRay(const Vector &start, const Vector &ray, Vector &
28312831
hitObstacle = true;
28322832
obstaclePos.SetXY(intPos[X], intPos[Y]);
28332833
// Save last ray pos
2834-
m_LastRayHitPos.SetIntXY(intPos[X], intPos[Y]);
2834+
m_LastRayHitPos.SetXY(intPos[X], intPos[Y]);
28352835
break;
28362836
}
28372837
else

Managers/UInputMan.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -808,7 +808,7 @@ namespace RTE {
808808
int mickeyX;
809809
int mickeyY;
810810
get_mouse_mickeys(&mickeyX, &mickeyY);
811-
m_RawMouseMovement.SetIntXY(mickeyX, mickeyY);
811+
m_RawMouseMovement.SetXY(mickeyX, mickeyY);
812812

813813
// TODO: Add sensitivity slider to settings menu
814814
m_RawMouseMovement *= m_MouseSensitivity;

Menus/GibEditorGUI.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -697,8 +697,8 @@ void GibEditorGUI::Update()
697697
if (m_pCurrentGib && m_DrawCurrentGib)
698698
{
699699
Vector gibPos = g_SceneMan.SnapPosition(m_CursorPos - m_CursorOffset, m_GridSnapping);
700-
gibPos.SetIntX(gibPos.m_X);
701-
gibPos.SetIntY(gibPos.m_Y);
700+
gibPos.SetX(static_cast<int>(gibPos.m_X));
701+
gibPos.SetY(static_cast<int>(gibPos.m_Y));
702702

703703
m_pCurrentGib->SetPos(gibPos);
704704
m_pCurrentGib->Update();

Menus/PieMenuGUI.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1083,7 +1083,7 @@ void PieMenuGUI::Update()
10831083
Vector separator;
10841084
for (vector<Slice *>::iterator sItr = m_AllSlices.begin(); sItr != m_AllSlices.end(); ++sItr)
10851085
{
1086-
separator.SetIntXY(m_InnerRadius + m_Thickness + 2, 0);
1086+
separator.SetXY(m_InnerRadius + m_Thickness + 2, 0);
10871087
separator.RadRotate((*sItr)->m_AreaStart);
10881088
// Draw four so that the result will be at least 2px thick, no matter what angle
10891089
line(m_pBGBitmap, centerX, centerY, centerX + separator.GetCeilingIntX(), centerY + separator.GetCeilingIntY(), g_MaskColor);
@@ -1095,7 +1095,7 @@ void PieMenuGUI::Update()
10951095
// Indicate the highlighted segment, only if it is also enabled?
10961096
if (m_pHoveredSlice && m_pHoveredSlice->m_Enabled)
10971097
{
1098-
separator.SetIntXY(m_InnerRadius + (m_Thickness / 2), 0);
1098+
separator.SetXY(m_InnerRadius + (m_Thickness / 2), 0);
10991099
separator.RadRotate(m_pHoveredSlice->m_MidAngle);
11001100
// floodfill(m_pBGBitmap, centerX + separator.GetFloorIntX(), centerY + separator.GetFloorIntY(), 122);
11011101
floodfill(m_pBGBitmap, centerX + separator.GetFloorIntX(), centerY + separator.GetFloorIntY(), m_pHoveredSlice->m_Enabled ? g_BlackColor : g_RedColor);
@@ -1350,7 +1350,7 @@ void PieMenuGUI::Draw(BITMAP *pTargetBitmap, const Vector &targetPos) const
13501350
// If we have the disabled etc frames, then use em if applicable
13511351
pIcon = (*sItr)->m_Icon.GetBitmaps8()[(!((*sItr)->m_Enabled) && (*sItr)->m_Icon.GetFrameCount() > PIS_DISABLED) ? PIS_DISABLED : (((*sItr) == m_pHoveredSlice && (*sItr)->m_Icon.GetFrameCount() > PIS_SELECTED) ? PIS_SELECTED : PIS_NORMAL)];
13521352
// Position and draw the icon bitmap
1353-
iconPos.SetIntXY(m_InnerRadius + (m_Thickness / 2), 0);
1353+
iconPos.SetXY(m_InnerRadius + (m_Thickness / 2), 0);
13541354
iconPos.RadRotate((*sItr)->m_MidAngle);
13551355
iconPos += Vector(1, 1);
13561356
draw_sprite(pTargetBitmap, pIcon, drawPos.m_X + iconPos.m_X - (pIcon->w / 2), drawPos.m_Y + iconPos.m_Y - (pIcon->h / 2));

System/Vector.h

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -61,13 +61,6 @@ namespace RTE {
6161
/// <returns>Vector reference to this after the operation.</returns>
6262
Vector & SetX(const float newX) { m_X = newX; return *this; }
6363

64-
/// <summary>
65-
/// Sets the X value of this Vector.
66-
/// </summary>
67-
/// <param name="newX">An int value that the X value will be set to.</param>
68-
/// <returns>Vector reference to this after the operation.</returns>
69-
Vector & SetIntX(const int newX) { m_X = static_cast<float>(newX); return *this; }
70-
7164
/// <summary>
7265
/// Gets the Y value of this Vector.
7366
/// </summary>
@@ -81,13 +74,6 @@ namespace RTE {
8174
/// <returns>Vector reference to this after the operation.</returns>
8275
Vector & SetY(const float newY) { m_Y = newY; return *this; }
8376

84-
/// <summary>
85-
/// Sets the Y value of this Vector.
86-
/// </summary>
87-
/// <param name="newY">An int value that the Y value will be set to.</param>
88-
/// <returns>Vector reference to this after the operation.</returns>
89-
Vector & SetIntY(const int newY) { m_Y = static_cast<float>(newY); return *this; }
90-
9177
/// <summary>
9278
/// Sets both the X and Y values of this Vector.
9379
/// </summary>
@@ -96,14 +82,6 @@ namespace RTE {
9682
/// <returns>Vector reference to this after the operation.</returns>
9783
Vector & SetXY(const float newX, const float newY) { m_X = newX; m_Y = newY; return *this; }
9884

99-
/// <summary>
100-
/// Sets both the X and Y values of this Vector.
101-
/// </summary>
102-
/// <param name="newX">An int value that the X value will be set to.</param>
103-
/// <param name="newY">An int value that the Y value will be set to.</param>
104-
/// <returns>Vector reference to this after the operation.</returns>
105-
Vector & SetIntXY(const int newX, const int newY) { m_X = static_cast<float>(newX); m_Y = static_cast<float>(newY); return *this; }
106-
10785
/// <summary>
10886
/// Gets the absolute largest of the two elements. Will always be positive.
10987
/// </summary>

0 commit comments

Comments
 (0)