@@ -892,7 +892,7 @@ bool SceneMan::TryPenetrate(int posX,
892
892
return false ;
893
893
}
894
894
895
- MovableObject * SceneMan::DislodgePixel (int posX, int posY) {
895
+ MOPixel * SceneMan::DislodgePixel (int posX, int posY) {
896
896
WrapPosition (posX, posY);
897
897
int materialID = getpixel (m_pCurrentScene->GetTerrain ()->GetMaterialBitmap (), posX, posY);
898
898
if (materialID <= MaterialColorKeys::g_MaterialAir) {
@@ -924,16 +924,16 @@ MovableObject* SceneMan::DislodgePixel(int posX, int posY) {
924
924
}
925
925
926
926
// Bool variant to avoid changing the original
927
- MovableObject * SceneMan::DislodgePixelBool (int posX, int posY, bool deletePixel) {
928
- MovableObject * pixelMO = DislodgePixel (posX, posY);
927
+ MOPixel * SceneMan::DislodgePixelBool (int posX, int posY, bool deletePixel) {
928
+ MOPixel * pixelMO = DislodgePixel (posX, posY);
929
929
if (pixelMO) {
930
930
pixelMO->SetToDelete (deletePixel);
931
931
}
932
932
return pixelMO;
933
933
}
934
934
935
- std::vector<MovableObject *>* SceneMan::DislodgePixelCircle (const Vector& centre, float radius, bool deletePixels) {
936
- std::vector<MovableObject *>* pixelList = new std::vector<MovableObject *>();
935
+ std::vector<MOPixel *>* SceneMan::DislodgePixelCircle (const Vector& centre, float radius, bool deletePixels) {
936
+ std::vector<MOPixel *>* pixelList = new std::vector<MOPixel *>();
937
937
int limit = static_cast <int >(radius) * 2 ;
938
938
for (int x = 0 ; x <= limit; x++) {
939
939
for (int y = 0 ; y <= limit; y++) {
@@ -945,7 +945,7 @@ std::vector<MovableObject*>* SceneMan::DislodgePixelCircle(const Vector& centre,
945
945
}
946
946
947
947
if (!distance.MagnitudeIsGreaterThan (radius)) {
948
- MovableObject * px = DislodgePixelBool (checkPos.m_X , checkPos.m_Y , deletePixels);
948
+ MOPixel * px = DislodgePixelBool (checkPos.m_X , checkPos.m_Y , deletePixels);
949
949
if (px) {
950
950
pixelList->push_back (px);
951
951
}
@@ -956,17 +956,17 @@ std::vector<MovableObject*>* SceneMan::DislodgePixelCircle(const Vector& centre,
956
956
return pixelList;
957
957
}
958
958
959
- std::vector<MovableObject *>* SceneMan::DislodgePixelCircleNoBool (const Vector& centre, float radius) {
959
+ std::vector<MOPixel *>* SceneMan::DislodgePixelCircleNoBool (const Vector& centre, float radius) {
960
960
return DislodgePixelCircle (centre, radius, false );
961
961
}
962
962
963
- std::vector<MovableObject *>* SceneMan::DislodgePixelRing (const Vector& centre, float innerRadius, float outerRadius, bool deletePixels) {
963
+ std::vector<MOPixel *>* SceneMan::DislodgePixelRing (const Vector& centre, float innerRadius, float outerRadius, bool deletePixels) {
964
964
// Account for users inputting radii in the wrong order
965
965
if (outerRadius < innerRadius) {
966
966
std::swap (outerRadius, innerRadius);
967
967
}
968
968
969
- std::vector<MovableObject *>* pixelList = new std::vector<MovableObject *>();
969
+ std::vector<MOPixel *>* pixelList = new std::vector<MOPixel *>();
970
970
int limit = static_cast <int >(outerRadius) * 2 ;
971
971
for (int x = 0 ; x <= limit; x++) {
972
972
for (int y = 0 ; y <= limit; y++) {
@@ -983,7 +983,7 @@ std::vector<MovableObject*>* SceneMan::DislodgePixelRing(const Vector& centre, f
983
983
}
984
984
985
985
if (!distance.MagnitudeIsGreaterThan (outerRadius) && !distance.MagnitudeIsLessThan (innerRadius)) {
986
- MovableObject * px = DislodgePixelBool (checkPos.m_X , checkPos.m_Y , deletePixels);
986
+ MOPixel * px = DislodgePixelBool (checkPos.m_X , checkPos.m_Y , deletePixels);
987
987
if (px) {
988
988
pixelList->push_back (px);
989
989
}
@@ -994,12 +994,12 @@ std::vector<MovableObject*>* SceneMan::DislodgePixelRing(const Vector& centre, f
994
994
return pixelList;
995
995
}
996
996
997
- std::vector<MovableObject *>* SceneMan::DislodgePixelRingNoBool (const Vector& centre, float innerRadius, float outerRadius) {
997
+ std::vector<MOPixel *>* SceneMan::DislodgePixelRingNoBool (const Vector& centre, float innerRadius, float outerRadius) {
998
998
return DislodgePixelRing (centre, innerRadius, outerRadius, false );
999
999
}
1000
1000
1001
- std::vector<MovableObject *>* SceneMan::DislodgePixelBox (const Vector& upperLeftCorner, const Vector& lowerRightCorner, bool deletePixels) {
1002
- std::vector<MovableObject *>* pixelList = new std::vector<MovableObject *>();
1001
+ std::vector<MOPixel *>* SceneMan::DislodgePixelBox (const Vector& upperLeftCorner, const Vector& lowerRightCorner, bool deletePixels) {
1002
+ std::vector<MOPixel *>* pixelList = new std::vector<MOPixel *>();
1003
1003
1004
1004
// Make sure it works even if people input corners in the wrong order
1005
1005
Vector start = Vector (std::min (upperLeftCorner.m_X , lowerRightCorner.m_X ), std::min (upperLeftCorner.m_Y , lowerRightCorner.m_Y ));
@@ -1010,7 +1010,7 @@ std::vector<MovableObject*>* SceneMan::DislodgePixelBox(const Vector& upperLeftC
1010
1010
for (int x = 0 ; x <= static_cast <int >(width) * 2 ; x++) {
1011
1011
for (int y = 0 ; y <= static_cast <int >(height) * 2 ; y++) {
1012
1012
Vector checkPos = start + Vector (static_cast <float >(x), static_cast <float >(y));
1013
- MovableObject * px = DislodgePixelBool (checkPos.m_X , checkPos.m_Y , deletePixels);
1013
+ MOPixel * px = DislodgePixelBool (checkPos.m_X , checkPos.m_Y , deletePixels);
1014
1014
if (px) {
1015
1015
pixelList->push_back (px);
1016
1016
}
@@ -1020,12 +1020,12 @@ std::vector<MovableObject*>* SceneMan::DislodgePixelBox(const Vector& upperLeftC
1020
1020
return pixelList;
1021
1021
}
1022
1022
1023
- std::vector<MovableObject *>* SceneMan::DislodgePixelBoxNoBool (const Vector& upperLeftCorner, const Vector& lowerRightCorner) {
1023
+ std::vector<MOPixel *>* SceneMan::DislodgePixelBoxNoBool (const Vector& upperLeftCorner, const Vector& lowerRightCorner) {
1024
1024
return DislodgePixelBox (upperLeftCorner, lowerRightCorner, false );
1025
1025
}
1026
1026
1027
- std::vector<MovableObject *>* SceneMan::DislodgePixelLine (const Vector& start, const Vector& ray, int skip, bool deletePixels) {
1028
- std::vector<MovableObject *>* pixelList = new std::vector<MovableObject *>();
1027
+ std::vector<MOPixel *>* SceneMan::DislodgePixelLine (const Vector& start, const Vector& ray, int skip, bool deletePixels) {
1028
+ std::vector<MOPixel *>* pixelList = new std::vector<MOPixel *>();
1029
1029
int error, dom, sub, domSteps, skipped = skip;
1030
1030
int intPos[2 ], delta[2 ], delta2[2 ], increment[2 ];
1031
1031
@@ -1080,7 +1080,7 @@ std::vector<MovableObject*>* SceneMan::DislodgePixelLine(const Vector& start, co
1080
1080
// Scene wrapping
1081
1081
g_SceneMan.WrapPosition (intPos[X], intPos[Y]);
1082
1082
1083
- MovableObject * px = DislodgePixelBool (intPos[X], intPos[Y], deletePixels);
1083
+ MOPixel * px = DislodgePixelBool (intPos[X], intPos[Y], deletePixels);
1084
1084
if (px) {
1085
1085
pixelList->push_back (px);
1086
1086
}
@@ -1093,7 +1093,7 @@ std::vector<MovableObject*>* SceneMan::DislodgePixelLine(const Vector& start, co
1093
1093
return pixelList;
1094
1094
}
1095
1095
1096
- std::vector<MovableObject *>* SceneMan::DislodgePixelLineNoBool (const Vector& start, const Vector& ray, int skip) {
1096
+ std::vector<MOPixel *>* SceneMan::DislodgePixelLineNoBool (const Vector& start, const Vector& ray, int skip) {
1097
1097
return DislodgePixelLine (start, ray, skip, false );
1098
1098
}
1099
1099
0 commit comments