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

Commit

Permalink
Post-rebase cleanup to catch all the forced-through merge conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
Causeless committed Dec 26, 2023
1 parent 7b386c0 commit a106d34
Show file tree
Hide file tree
Showing 51 changed files with 947 additions and 1,352 deletions.
5 changes: 2 additions & 3 deletions Activities/GameActivity.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1204,7 +1204,6 @@ void GameActivity::UpdateEditing()
if (!(m_IsActive[player] && m_IsHuman[player]))
continue;

// Update the player controllers which control the switching and editor gui
m_pEditorGUI[player]->Update();

// Set the team associations with each screen displayed
Expand Down Expand Up @@ -2205,8 +2204,8 @@ void GameActivity::DrawGUI(BITMAP *pTargetBitmap, const Vector &targetPos, int w
m_PlayerController[player].RelativeCursorMovement(m_ActorCursor[player]);

// Set the view to the cursor pos
bool wrapped = g_SceneMan.ForceBounds(m_ActorCursor[player]);
g_CameraMan.SetScrollTarget(m_ActorCursor[player], 0.1, wrapped, ScreenOfPlayer(player));
g_SceneMan.ForceBounds(m_ActorCursor[player]);
g_CameraMan.SetScrollTarget(m_ActorCursor[player], 0.1, ScreenOfPlayer(player));

}
//TODO_MULTITHREAD
Expand Down
24 changes: 24 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -817,6 +817,30 @@ This can be accessed via the new Lua (R/W) `SettingsMan` property `AIUpdateInter

- New `Actor` Lua (R) property `DigStrength`, that gets the calculated dig strength of the given `Actor`, based on whether or not they have any digging tools.

- New `Actor` Lua (R) property `DigStrength`, that gets the calculated dig strength of the given `Actor`, based on whether or not they have any digging tools.

- New `Settings.ini` property `EnableMultithreadedAI`, which can be used to enable experimental support for multithreaded AI. Please note that this is in a testing phase and is likely to cause bugs, especially with mods.

- Multithreaded asynchronous pathfinding, which dramatically improves performance on large maps and improves AI responsiveness.
New `Actor` Lua property (R) `IsWaitingOnNewMovePath`, which returns true while the actor is currently calculating a new path.
New Lua `SceneMan` function `CalculatePathAsync` for asynchronous pathfinding. This function has no return value, and is used as follows:
```lua
SceneMan.Scene:CalculatePathAsync(
function(pathRequest) -- Callback function that is run when the path has finished calculating, passing in the pathRequest object.
pathRequest.Path; -- A list of Vectors that make up the calculated path.
pathRequest.PathLength -- The number of points in the calculated path.
pathRequest.Status; -- The enum status of the path, the options are PathRequest.Solved, PathRequest.NoSolution, and PathRequest.StartEndSame.
pathRequest.TotalCost; -- The total cost of path.
end,
-- All other arguments are the same as Scene:CalculatePath():
startPos, -- The start position of the path to calculate.
endPos, -- The end position of the path to calculate.
movePathToGround, -- Whether or not to move the points in the calculated path to ground level.
digStrength, -- The dig strength to use when calculating the path.
team -- The team to use when calculating the path, allowing the path to ignore that team's doors. If not specified, it will default to `Activity.NOTEAM`, and no doors will be ignored.
);
```

</details>

<details><summary><b>Changed</b></summary>
Expand Down
67 changes: 41 additions & 26 deletions Entities/ACrab.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1567,6 +1567,10 @@ void ACrab::DrawHUD(BITMAP *pTargetBitmap, const Vector &targetPos, int whichScr

Actor::DrawHUD(pTargetBitmap, targetPos, whichScreen);

if (!m_HUDVisible) {
return;
}

// Player AI drawing

if ((m_Controller.IsState(AIM_SHARP) || (m_Controller.IsPlayerControlled() && !m_Controller.IsState(PIE_MENU_ACTIVE))) && m_pTurret && m_pTurret->IsAttached() && m_pTurret->HasMountedDevice()) {
Expand Down Expand Up @@ -1609,32 +1613,6 @@ void ACrab::DrawHUD(BITMAP *pTargetBitmap, const Vector &targetPos, int whichScr
}
}

// Weight and jetpack energy
if (m_pJetpack && m_pJetpack->IsAttached() && m_Controller.IsState(BODY_JUMP)) {
float mass = GetMass();
if (m_JetTimeLeft < 100.0F) {
// Draw empty fuel indicator
str[0] = m_IconBlinkTimer.AlternateSim(100) ? -26 : -25;
} else {
// Display normal jet icons
// TODO: Don't hardcode the mass indicator! Figure out how to calculate the jetpack threshold values
str[0] = mass < 135.0F ? -31 :
mass < 150.0F ? -30 :
mass < 165.0F ? -29 :
-28;
// Do the blinky blink
if ((str[0] == -28 || str[0] == -29) && m_IconBlinkTimer.AlternateSim(250)) { str[0] = -27; }
}
str[1] = 0;
pSymbolFont->DrawAligned(&allegroBitmap, drawPos.m_X - 11, drawPos.m_Y + m_HUDStack, str, GUIFont::Centre);

float jetTimeRatio = m_JetTimeLeft / m_JetTimeTotal;
int gaugeColor = jetTimeRatio > 0.6F ? 149 : (jetTimeRatio > 0.3F ? 77 : 13);
rectfill(pTargetBitmap, drawPos.GetFloorIntX() + 1, drawPos.GetFloorIntY() + m_HUDStack + 7, drawPos.GetFloorIntX() + 16, drawPos.GetFloorIntY() + m_HUDStack + 8, 245);
rectfill(pTargetBitmap, drawPos.GetFloorIntX(), drawPos.GetFloorIntY() + m_HUDStack + 6, drawPos.GetFloorIntX() + static_cast<int>(15.0F * jetTimeRatio), drawPos.GetFloorIntY() + m_HUDStack + 7, gaugeColor);

m_HUDStack += -10;
}
// Held-related GUI stuff
if (m_pTurret) {
std::string textString;
Expand Down Expand Up @@ -1662,6 +1640,43 @@ void ACrab::DrawHUD(BITMAP *pTargetBitmap, const Vector &targetPos, int whichScr
pSmallFont->DrawAligned(&allegroBitmap, drawPos.m_X + 2, drawPos.m_Y + m_HUDStack + 3, str, GUIFont::Centre);
m_HUDStack += -9;
}

if (m_pJetpack && m_Status != INACTIVE && !m_Controller.IsState(PIE_MENU_ACTIVE) && (m_Controller.IsState(BODY_JUMP) || !m_pJetpack->IsFullyFueled())) {
if (m_pJetpack->GetJetTimeLeft() < 100.0F) {
str[0] = m_IconBlinkTimer.AlternateSim(100) ? -26 : -25;
} else if (m_pJetpack->IsEmitting()) {
float acceleration = m_pJetpack->EstimateImpulse(false) / std::max(GetMass(), 0.1F);
if (acceleration > 0.41F) {
str[0] = acceleration > 0.47F ? -31 : -30;
} else {
str[0] = acceleration > 0.35F ? -29 : -28;
if (m_IconBlinkTimer.AlternateSim(200)) { str[0] = -27; }
}
} else {
str[0] = -27;
}
str[1] = 0;
pSymbolFont->DrawAligned(&allegroBitmap, drawPos.GetFloorIntX() - 7, drawPos.GetFloorIntY() + m_HUDStack, str, GUIFont::Centre);

rectfill(pTargetBitmap, drawPos.GetFloorIntX() + 1, drawPos.GetFloorIntY() + m_HUDStack + 7, drawPos.GetFloorIntX() + 15, drawPos.GetFloorIntY() + m_HUDStack + 8, 245);
if (m_pJetpack->GetJetTimeTotal() > 0.0F) {
float jetTimeRatio = m_pJetpack->GetJetTimeRatio();
int gaugeColor;
if (jetTimeRatio > 0.75F) {
gaugeColor = 149;
} else if (jetTimeRatio > 0.5F) {
gaugeColor = 133;
} else if (jetTimeRatio > 0.375F) {
gaugeColor = 77;
} else if (jetTimeRatio > 0.25F) {
gaugeColor = 48;
} else {
gaugeColor = 13;
}
rectfill(pTargetBitmap, drawPos.GetFloorIntX(), drawPos.GetFloorIntY() + m_HUDStack + 6, drawPos.GetFloorIntX() + static_cast<int>(15.0F * jetTimeRatio), drawPos.GetFloorIntY() + m_HUDStack + 7, gaugeColor);
}
m_HUDStack -= 9;
}
}
}

Expand Down
20 changes: 0 additions & 20 deletions Entities/ACraft.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -803,22 +803,6 @@ float ACraft::GetCollectedInventoryMass() const {
return inventoryMass;
}

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

//////////////////////////////////////////////////////////////////////////////////////////
// Virtual method: OnMOHit
//////////////////////////////////////////////////////////////////////////////////////////
// Description: Defines what should happen when this MovableObject hits another MO.
// This is called by the owned Atom/AtomGroup of this MovableObject during
// travel.

bool ACraft::OnMOHit(MovableObject *pOtherMO)
{
// Don't terminate, continue travel
return false;
}


/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

void ACraft::GibThis(const Vector &impactImpulse, MovableObject *movableObjectToIgnore) {
Expand Down Expand Up @@ -988,10 +972,6 @@ void ACraft::Update()
void ACraft::DrawHUD(BITMAP *pTargetBitmap, const Vector &targetPos, int whichScreen, bool playerControlled) {
m_HUDStack = -m_CharHeight / 2;

if (!m_HUDVisible) {
return;
}

// Only do HUD if on a team
if (m_Team < 0) {
return;
Expand Down
2 changes: 1 addition & 1 deletion Entities/ADoor.h
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ namespace RTE {

static Entity::ClassInfo m_sClass; //!< ClassInfo for this class.

int m_InitialSpriteAnimDuration; //!< This stores the original SpriteAnimDuration value so we can drive the death spin-up animation using Lerp. For internal use only.
int m_InitialSpriteAnimDuration; //!< This stores the original SpriteAnimDuration value so we can drive the death spin-up animation using LERP. For internal use only.

std::list<ADSensor> m_Sensors; //!< All the sensors for detecting Actors approaching the door.
Timer m_SensorTimer; //!< Times the exit interval.
Expand Down
6 changes: 3 additions & 3 deletions Entities/AEmitter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -369,8 +369,8 @@ int AEmitter::GetTotalBurstSize() const {
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

float AEmitter::GetScaledThrottle(float throttle, float multiplier) const {
float throttleFactor = LERP(-1.0f, 1.0f, m_NegativeThrottleMultiplier, m_PositiveThrottleMultiplier, throttle);
return LERP(m_NegativeThrottleMultiplier, m_PositiveThrottleMultiplier, -1.0f, 1.0f, throttleFactor * multiplier);
float throttleFactor = Lerp(-1.0f, 1.0f, m_NegativeThrottleMultiplier, m_PositiveThrottleMultiplier, throttle);
return Lerp(m_NegativeThrottleMultiplier, m_PositiveThrottleMultiplier, -1.0f, 1.0f, throttleFactor * multiplier);
}

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -525,7 +525,7 @@ void AEmitter::Update()
pParticle->SetPos(m_Pos + RotateOffset(m_EmissionOffset));
}
} else {
pParticle->SetPos(m_Pos + RotateOffset((*eItr)->GetOffset()));
pParticle->SetPos(m_Pos + RotateOffset(emission.GetOffset()));
}
// TODO: Optimize making the random angles!")
emitVel.SetXY(velMin + RandomNum(0.0F, velRange), 0.0F);
Expand Down
4 changes: 2 additions & 2 deletions Entities/AEmitter.h
Original file line number Diff line number Diff line change
Expand Up @@ -272,13 +272,13 @@ ClassInfoGetters;
/// Gets the adjusted throttle multiplier that is factored into the emission rate of this AEmitter.
/// </summary>
/// <returns>The throttle strength as a multiplier.</returns>
float GetThrottleFactor() const { return LERP(-1.0f, 1.0f, m_NegativeThrottleMultiplier, m_PositiveThrottleMultiplier, m_Throttle); }
float GetThrottleFactor() const { return Lerp(-1.0f, 1.0f, m_NegativeThrottleMultiplier, m_PositiveThrottleMultiplier, m_Throttle); }

/// <summary>
/// Gets the throttle value that will achieve a given throttle factor that is factored into the emission rate of this AEmitter.
/// </summary>
/// <returns>The throttle value that will achieve the given throttle factor.</returns>
float GetThrottleForThrottleFactor(float throttleFactor) const { return LERP(m_NegativeThrottleMultiplier, m_PositiveThrottleMultiplier, -1.0f, 1.0f, throttleFactor); }
float GetThrottleForThrottleFactor(float throttleFactor) const { return Lerp(m_NegativeThrottleMultiplier, m_PositiveThrottleMultiplier, -1.0f, 1.0f, throttleFactor); }

/// <summary>
/// Returns a scaled throttle value that represents a linear increase of force.
Expand Down
Loading

0 comments on commit a106d34

Please sign in to comment.