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

Commit 491296f

Browse files
committed
Misc missed stuff
1 parent a73a381 commit 491296f

File tree

1 file changed

+24
-24
lines changed

1 file changed

+24
-24
lines changed

Entities/AtomGroup.cpp

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,7 @@ namespace RTE {
371371
}
372372
#ifdef DEBUG_BUILD
373373
// Draw the positions of the Atoms at the start of each segment, for visual debugging.
374-
putpixel(g_SceneMan.GetMOColorBitmap(), atom->GetCurrentPos().GetIntX(), atom->GetCurrentPos().GetIntY(), 122);
374+
//putpixel(g_SceneMan.GetMOColorBitmap(), atom->GetCurrentPos().GetIntX(), atom->GetCurrentPos().GetIntY(), 122);
375375
#endif
376376
}
377377

@@ -752,7 +752,7 @@ namespace RTE {
752752

753753
HitData hitData;
754754

755-
std::map<MOID, std::set<Atom *>>MOIgnoreMap;
755+
std::map<MOID, std::set<Atom *>> MOIgnoreMap;
756756
std::map<MOID, std::deque<std::pair<Atom *, Vector>>> hitMOAtoms;
757757
std::deque<std::pair<Atom *, Vector>> hitTerrAtoms;
758758
std::deque<std::pair<Atom *, Vector>> penetratingAtoms;
@@ -799,9 +799,6 @@ namespace RTE {
799799
delta[X] = nextPosition.GetFloorIntX() - intPos[X];
800800
delta[Y] = nextPosition.GetFloorIntY() - intPos[Y];
801801

802-
hit[X] = false;
803-
hit[Y] = false;
804-
805802
if (delta[X] == 0 && delta[Y] == 0) {
806803
break;
807804
}
@@ -848,6 +845,9 @@ namespace RTE {
848845
if (delta[X] > 1000) { delta[X] = 1000; }
849846
if (delta[Y] > 1000) { delta[Y] = 1000; }
850847

848+
hit[X] = false;
849+
hit[Y] = false;
850+
851851
// Bresenham's line drawing algorithm execution
852852
for (int domSteps = 0; domSteps < delta[dom] && !(hit[X] || hit[Y]); ++domSteps) {
853853
if (subStepped) { ++subSteps; }
@@ -880,7 +880,7 @@ namespace RTE {
880880
if (hitMOs) {
881881
tempMOID = g_SceneMan.GetMOIDPixel(intPos[X] + flippedOffset.GetFloorIntX(), intPos[Y] + flippedOffset.GetFloorIntY());
882882
// Check the ignore map for Atoms that should ignore hits against certain MOs.
883-
if (tempMOID != g_NoMOID && (MOIgnoreMap.count(tempMOID) != 0)) { ignoreHit = (MOIgnoreMap.at(tempMOID).count(atom) != 0); }
883+
if (tempMOID != g_NoMOID && (MOIgnoreMap.count(tempMOID) != 0)) { ignoreHit = MOIgnoreMap.at(tempMOID).count(atom) != 0; }
884884
}
885885

886886
if (hitMOs && tempMOID && !ignoreHit) {
@@ -891,7 +891,7 @@ namespace RTE {
891891
hitMOAtoms.insert({ tempMOID, newDeque });
892892
} else {
893893
// If another Atom of this group has already hit this same MO during this step, go ahead and add the new Atom to the corresponding deque for that MOID.
894-
(hitMOAtoms.at(tempMOID)).push_back({ atom, flippedOffset });
894+
hitMOAtoms.at(tempMOID).push_back({ atom, flippedOffset });
895895
}
896896
// Count the number of Atoms of this group that hit MOs this step. Used to properly distribute the mass of the owner MO in later collision responses during this step.
897897
atomsHitMOsCount++;
@@ -902,7 +902,7 @@ namespace RTE {
902902

903903
#ifdef DEBUG_BUILD
904904
// Draw the positions of the hit points on screen for easy debugging.
905-
putpixel(g_SceneMan.GetMOColorBitmap(), std::floor(position.m_X + flippedOffset.m_X), std::floor(position.m_Y + flippedOffset.m_Y), 122);
905+
//putpixel(g_SceneMan.GetMOColorBitmap(), std::floor(position.m_X + flippedOffset.m_X), std::floor(position.m_Y + flippedOffset.m_Y), 122);
906906
#endif
907907
}
908908

@@ -977,12 +977,12 @@ namespace RTE {
977977
//if (hitData.HitPoint.IsZero()) {
978978
// NOTE: THis can actually be wrong since there may not in fact be a corner pixel, but two pixels hit on X and Y directions
979979
hitData.HitPoint = (sub == X) ? Vector(static_cast<float>(hitPos[X]), static_cast<float>(intPos[Y])) : Vector(static_cast<float>(intPos[X]), static_cast<float>(hitPos[Y]));
980-
/*
981-
// We hit pixels in both sub and dom directions on the other MO, a corner hit.
982-
} else {
983-
hitData.HitPoint.SetXY(hitPos[X], hitPos[Y]);
984-
}
985-
*/
980+
/*
981+
// We hit pixels in both sub and dom directions on the other MO, a corner hit.
982+
} else {
983+
hitData.HitPoint.SetXY(hitPos[X], hitPos[Y]);
984+
}
985+
*/
986986
hitData.BitmapNormal[sub] = static_cast<float>(-increment[sub]);
987987
}
988988

@@ -1014,7 +1014,7 @@ namespace RTE {
10141014
}
10151015
}
10161016
}
1017-
// If any MO's were hit, continue on to the next leg without doing terrain stuff now.
1017+
// If any MOs were hit, continue on to the next leg without doing terrain stuff now.
10181018
// Any terrain collisions will be taken care of on the next leg, when the effects of these MO hits have been applied.
10191019
hitTerrAtoms.clear();
10201020
}
@@ -1030,14 +1030,14 @@ namespace RTE {
10301030

10311031
massDist = mass / static_cast<float>(hitTerrAtoms.size() * (m_Resolution ? m_Resolution : 1));
10321032

1033-
for (std::deque<std::pair<Atom *, Vector>>::iterator aoItr = hitTerrAtoms.begin(); aoItr != hitTerrAtoms.end(); ) {
1034-
if (g_SceneMan.WillPenetrate(intPos[X] + (*aoItr).second.GetFloorIntX(), intPos[Y] + (*aoItr).second.GetFloorIntY(), forceVel, massDist)) {
1035-
// Move the penetrating Atom to the pen. list from the coll. list.
1036-
penetratingAtoms.push_back({ (*aoItr).first, (*aoItr).second });
1037-
aoItr = hitTerrAtoms.erase(aoItr);
1033+
for (std::deque<std::pair<Atom *, Vector>>::iterator atomItr = hitTerrAtoms.begin(); atomItr != hitTerrAtoms.end(); ) {
1034+
if (g_SceneMan.WillPenetrate(intPos[X] + (*atomItr).second.GetFloorIntX(), intPos[Y] + (*atomItr).second.GetFloorIntY(), forceVel, massDist)) {
1035+
// Move the penetrating Atom to the penetrating list from the collision list.
1036+
penetratingAtoms.push_back({ (*atomItr).first, (*atomItr).second });
1037+
atomItr = hitTerrAtoms.erase(atomItr);
10381038
somethingPenetrated = true;
10391039
} else {
1040-
++aoItr;
1040+
++atomItr;
10411041
}
10421042
}
10431043
} while (!hitTerrAtoms.empty() && somethingPenetrated);
@@ -1054,7 +1054,7 @@ namespace RTE {
10541054
didWrap = !g_SceneMan.WrapPosition(intPos[X], intPos[Y]) && didWrap;
10551055

10561056
// Call the call-on-bounce function, if requested.
1057-
//if (m_OwnerMO && callOnBounce) { halted = m_OwnerMO->OnBounce(position); }
1057+
//if (m_OwnerMO && callOnBounce) { halted = m_OwnerMO->OnBounce(position); }
10581058

10591059
// Calculate the distributed mass that each bouncing Atom has.
10601060
massDist = mass / static_cast<float>((hitTerrAtoms.size()/* + atomsHitMOsCount*/) * (m_Resolution ? m_Resolution : 1));
@@ -1523,9 +1523,9 @@ namespace RTE {
15231523

15241524
for (const Atom *atom : m_Atoms) {
15251525
if (!useLimbPos) {
1526-
atomPos = (m_OwnerMO->GetPos() + (atom->GetOffset().GetXFlipped(m_OwnerMO->m_HFlipped))).GetFloored();
1526+
atomPos = (m_OwnerMO->GetPos() + (atom->GetOffset().GetXFlipped(m_OwnerMO->m_HFlipped) * m_OwnerMO->GetRotMatrix())).GetFloored();
15271527
} else {
1528-
atomPos = (m_LimbPos + (atom->GetOffset().GetXFlipped(m_OwnerMO->m_HFlipped))).GetFloored();
1528+
atomPos = (m_LimbPos + (atom->GetOffset().GetXFlipped(m_OwnerMO->m_HFlipped) * m_OwnerMO->GetRotMatrix())).GetFloored();
15291529
}
15301530
// Draw normal first, then draw the Atom position
15311531
if (!atom->GetNormal().IsZero()) {

0 commit comments

Comments
 (0)