Skip to content

Commit c2ff012

Browse files
committed
Removed DRAW_MOID_LAYER legacy stuff
1 parent baaa850 commit c2ff012

14 files changed

+15
-144
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
4242

4343
</details>
4444

45+
<details><summary><b>Removed</b></summary>
46+
47+
- Removed `Settings.ini` property `SimplifiedCollisionDetection = 0/1`. With the physics detection overhaul in pre-5, this became unnecessary.
48+
49+
</details>
50+
4551
## [Release v6.1.0] - 2024/02/15
4652

4753
<details><summary><b>Added</b></summary>

Source/Entities/AHuman.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -764,11 +764,7 @@ bool AHuman::EquipDeviceInGroup(std::string group, bool doEquip) {
764764
// Note - This is a fix to deal with an edge case bug when this method is called by a global script.
765765
// Because the global script runs before everything has finished traveling, the removed item needs to undraw itself from the MO layer, otherwise it can result in ghost collisions and crashes.
766766
if (previouslyHeldItem->GetsHitByMOs()) {
767-
#ifdef DRAW_MOID_LAYER
768-
previouslyHeldItem->Draw(g_SceneMan.GetMOIDBitmap(), Vector(), g_DrawNoMOID, true);
769-
#else
770767
previouslyHeldItem->SetTraveling(true);
771-
#endif
772768
}
773769
AddToInventoryBack(previouslyHeldItem);
774770
}

Source/Entities/AtomGroup.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1470,13 +1470,11 @@ bool AtomGroup::ResolveMOSIntersection(Vector& position) {
14701470
if (tempMO->GetsHitByMOs()) {
14711471
// Make that MO draw itself again in the MOID layer so we can find its true edges
14721472
intersectedMO = tempMO;
1473-
#ifdef DRAW_MOID_LAYER
1474-
intersectedMO->Draw(g_SceneMan.GetMOIDBitmap(), Vector(), g_DrawMOID, true);
1475-
#endif
14761473
break;
14771474
}
14781475
}
14791476
}
1477+
14801478
if (!intersectedMO) {
14811479
return false;
14821480
}

Source/Entities/MOPixel.cpp

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -246,15 +246,8 @@ void MOPixel::Draw(BITMAP* targetBitmap, const Vector& targetPos, DrawMode mode,
246246
break;
247247
}
248248

249-
bool shouldDraw = true;
250-
251-
#ifndef DRAW_MOID_LAYER
252-
shouldDraw = mode != DrawMode::g_DrawMOID;
253-
#endif
254-
255249
Vector pixelPos = m_Pos - targetPos;
256-
257-
if (shouldDraw) {
250+
if (mode != DrawMode::g_DrawMOID) {
258251
putpixel(targetBitmap, pixelPos.GetFloorIntX(), pixelPos.GetFloorIntY(), drawColor);
259252
}
260253

Source/Entities/MOSParticle.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -201,11 +201,6 @@ void MOSParticle::Draw(BITMAP* targetBitmap, const Vector& targetPos, DrawMode m
201201
case g_DrawWhite:
202202
draw_character_ex(targetBitmap, m_aSprite[m_Frame], spriteX, spriteY, g_WhiteColor, -1);
203203
break;
204-
case g_DrawMOID:
205-
#ifdef DRAW_MOID_LAYER
206-
draw_character_ex(targetBitmap, m_aSprite[m_Frame], spriteX, spriteY, m_MOID, -1);
207-
#endif
208-
break;
209204
case g_DrawNoMOID:
210205
draw_character_ex(targetBitmap, m_aSprite[m_Frame], spriteX, spriteY, g_NoMOID, -1);
211206
break;

Source/Entities/MOSRotating.cpp

Lines changed: 4 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1245,17 +1245,6 @@ bool MOSRotating::DeepCheck(bool makeMOPs, int skipMOP, int maxMOPs) {
12451245
return false;
12461246
}
12471247

1248-
void MOSRotating::PreTravel() {
1249-
MOSprite::PreTravel();
1250-
1251-
#ifdef DRAW_MOID_LAYER
1252-
// If this is going slow enough, check for and redraw the MOID representations of any other MOSRotatings that may be overlapping this
1253-
if (m_GetsHitByMOs && m_HitsMOs && m_Vel.GetX() < 2.0F && m_Vel.GetY() < 2.0F) {
1254-
g_MovableMan.RedrawOverlappingMOIDs(this);
1255-
}
1256-
#endif
1257-
}
1258-
12591248
void MOSRotating::Travel() {
12601249
MOSprite::Travel();
12611250

@@ -1625,12 +1614,9 @@ void MOSRotating::Draw(BITMAP* pTargetBitmap, const Vector& targetPos, DrawMode
16251614
}
16261615

16271616
// If we're drawing a material silhouette, then create an intermediate material bitmap as well
1628-
#ifdef DRAW_MOID_LAYER
1629-
bool intermediateBitmapUsed = mode != g_DrawColor && mode != g_DrawTrans;
1630-
#else
16311617
bool intermediateBitmapUsed = mode != g_DrawColor && mode != g_DrawTrans && mode != g_DrawMOID;
16321618
RTEAssert(mode != g_DrawNoMOID, "DrawNoMOID drawing mode used with no MOID layer!");
1633-
#endif
1619+
16341620
if (intermediateBitmapUsed) {
16351621
clear_to_color(pTempBitmap, keyColor);
16361622

@@ -1651,18 +1637,13 @@ void MOSRotating::Draw(BITMAP* pTargetBitmap, const Vector& targetPos, DrawMode
16511637
}
16521638
}
16531639

1654-
#ifdef DRAW_MOID_LAYER
1655-
bool needsWrap = true;
1656-
#else
1657-
bool needsWrap = mode != g_DrawMOID;
1658-
#endif
1659-
16601640
// Take care of wrapping situations
16611641
Vector aDrawPos[4];
16621642
int passes = 1;
16631643

16641644
aDrawPos[0] = spritePos;
16651645

1646+
bool needsWrap = mode != g_DrawMOID;
16661647
if (needsWrap && g_SceneMan.SceneWrapsX()) {
16671648
// See if need to double draw this across the scene seam if we're being drawn onto a scenewide bitmap
16681649
if (targetPos.IsZero() && m_WrapDoubleDraw) {
@@ -1691,12 +1672,7 @@ void MOSRotating::Draw(BITMAP* pTargetBitmap, const Vector& targetPos, DrawMode
16911672
}
16921673

16931674
if (m_HFlipped && pFlipBitmap) {
1694-
#ifdef DRAW_MOID_LAYER
1695-
bool drawIntermediate = true;
1696-
#else
16971675
bool drawIntermediate = mode != g_DrawMOID;
1698-
#endif
1699-
17001676
if (drawIntermediate) {
17011677
// Don't size the intermediate bitmaps to the m_Scale, because the scaling happens after they are done
17021678
clear_to_color(pFlipBitmap, keyColor);
@@ -1732,11 +1708,10 @@ void MOSRotating::Draw(BITMAP* pTargetBitmap, const Vector& targetPos, DrawMode
17321708
int spriteX = aDrawPos[i].GetFloorIntX();
17331709
int spriteY = aDrawPos[i].GetFloorIntY();
17341710
g_SceneMan.RegisterDrawing(pTargetBitmap, mode == g_DrawNoMOID ? g_NoMOID : m_MOID, spriteX + m_SpriteOffset.m_X - (m_SpriteRadius * m_Scale), spriteY + m_SpriteOffset.m_Y - (m_SpriteRadius * m_Scale), spriteX - m_SpriteOffset.m_X + (m_SpriteRadius * m_Scale), spriteY - m_SpriteOffset.m_Y + (m_SpriteRadius * m_Scale));
1735-
#ifndef DRAW_MOID_LAYER
17361711
if (mode == g_DrawMOID) {
17371712
continue;
17381713
}
1739-
#endif
1714+
17401715
// Take into account the h-flipped pivot point
17411716
pivot_scaled_sprite(pTargetBitmap, pFlipBitmap, spriteX, spriteY, pFlipBitmap->w + m_SpriteOffset.GetFloorIntX(), -(m_SpriteOffset.GetFloorIntY()), ftofix(m_Rotation.GetAllegroAngle()), ftofix(m_Scale));
17421717
}
@@ -1763,11 +1738,10 @@ void MOSRotating::Draw(BITMAP* pTargetBitmap, const Vector& targetPos, DrawMode
17631738
int spriteX = aDrawPos[i].GetFloorIntX();
17641739
int spriteY = aDrawPos[i].GetFloorIntY();
17651740
g_SceneMan.RegisterDrawing(pTargetBitmap, mode == g_DrawNoMOID ? g_NoMOID : m_MOID, spriteX + m_SpriteOffset.m_X - (m_SpriteRadius * m_Scale), spriteY + m_SpriteOffset.m_Y - (m_SpriteRadius * m_Scale), spriteX - m_SpriteOffset.m_X + (m_SpriteRadius * m_Scale), spriteY - m_SpriteOffset.m_Y + (m_SpriteRadius * m_Scale));
1766-
#ifndef DRAW_MOID_LAYER
17671741
if (mode == g_DrawMOID) {
17681742
continue;
17691743
}
1770-
#endif
1744+
17711745
pivot_scaled_sprite(pTargetBitmap, mode == g_DrawColor ? m_aSprite[m_Frame] : pTempBitmap, spriteX, spriteY, -m_SpriteOffset.GetFloorIntX(), -m_SpriteOffset.GetFloorIntY(), ftofix(m_Rotation.GetAllegroAngle()), ftofix(m_Scale));
17721746
}
17731747
}

Source/Entities/MOSRotating.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -319,10 +319,6 @@ namespace RTE {
319319
/// @return Whether deep penetration was detected and erasure was done.
320320
bool DeepCheck(bool makeMOPs = true, int skipMOP = 2, int maxMOP = 100);
321321

322-
/// Does stuff that needs to be done before Travel(). Always call before
323-
/// calling Travel.
324-
void PreTravel() override;
325-
326322
/// Travels this MOSRotatin, using its physical representation.
327323
void Travel() override;
328324

Source/Entities/MOSprite.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -454,11 +454,6 @@ void MOSprite::Draw(BITMAP* pTargetBitmap,
454454
case g_DrawWhite:
455455
draw_character_ex(pTargetBitmap, m_aSprite[m_Frame], spriteX, spriteY, g_WhiteColor, -1);
456456
break;
457-
case g_DrawMOID:
458-
#ifdef DRAW_MOID_LAYER
459-
draw_character_ex(pTargetBitmap, m_aSprite[m_Frame], spriteX, spriteY, m_MOID, -1);
460-
#endif
461-
break;
462457
case g_DrawNoMOID:
463458
draw_character_ex(pTargetBitmap, m_aSprite[m_Frame], spriteX, spriteY, g_NoMOID, -1);
464459
break;

Source/Entities/MovableObject.cpp

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -827,11 +827,6 @@ void MovableObject::PreTravel() {
827827
// Temporarily remove the representation of this from the scene MO sampler
828828
if (m_GetsHitByMOs) {
829829
m_IsTraveling = true;
830-
#ifdef DRAW_MOID_LAYER
831-
if (!g_SettingsMan.SimplifiedCollisionDetection()) {
832-
Draw(g_SceneMan.GetMOIDBitmap(), Vector(), DrawMode::g_DrawNoMOID, true);
833-
}
834-
#endif
835830
}
836831

837832
// Save previous position and velocities before moving
@@ -855,11 +850,6 @@ void MovableObject::PostTravel() {
855850
if (m_GetsHitByMOs) {
856851
if (!GetParent()) {
857852
m_IsTraveling = false;
858-
#ifdef DRAW_MOID_LAYER
859-
if (!g_SettingsMan.SimplifiedCollisionDetection()) {
860-
Draw(g_SceneMan.GetMOIDBitmap(), Vector(), DrawMode::g_DrawMOID, true);
861-
}
862-
#endif
863853
}
864854
m_AlreadyHitBy.clear();
865855
}

Source/Managers/FrameMan.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -964,11 +964,6 @@ void FrameMan::DrawScreenText(int playerScreen, AllegroBitmap playerGUIBitmap) {
964964
case g_LayerTerrainMatter:
965965
GetSmallFont()->DrawAligned(&playerGUIBitmap, GetPlayerScreenWidth() / 2, GetPlayerScreenHeight() - 12, "Viewing terrain material layer\nHit Ctrl+M to cycle modes", GUIFont::Centre, GUIFont::Bottom);
966966
break;
967-
#ifdef DRAW_MOID_LAYER
968-
case g_LayerMOID:
969-
GetSmallFont()->DrawAligned(&playerGUIBitmap, GetPlayerScreenWidth() / 2, GetPlayerScreenHeight() - 12, "Viewing MovableObject ID layer\nHit Ctrl+M to cycle modes", GUIFont::Centre, GUIFont::Bottom);
970-
break;
971-
#endif
972967
default:
973968
break;
974969
}

0 commit comments

Comments
 (0)