Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions Source/Entities/ADoor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -465,11 +465,6 @@ void ADoor::Update() {

Actor::Update();

// Start the spinning out of control animation for the motor, start it slow
if (!m_Door) {
m_SpriteAnimDuration *= 4;
}

if (m_SpriteAnimMode == LOOPWHENOPENCLOSE && m_FrameCount > 1 && (m_DoorState == OPENING || m_DoorState == CLOSING) && m_SpriteAnimTimer.IsPastSimMS(m_SpriteAnimDuration)) {
m_Frame = (m_Frame + 1) % m_FrameCount;
m_SpriteAnimTimer.Reset();
Expand Down
1 change: 1 addition & 0 deletions Source/Entities/Actor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1047,6 +1047,7 @@ float Actor::EstimateDigStrength() const {
}

float Actor::EstimateJumpHeight() const {
// Sentinel value that is explicitly checked for within pathfinder code.
return FLT_MAX;
}

Expand Down
2 changes: 1 addition & 1 deletion Source/Entities/Actor.h
Original file line number Diff line number Diff line change
Expand Up @@ -668,7 +668,7 @@ namespace RTE {
/// @return The actor's dig strength.
virtual float EstimateDigStrength() const;

/// Estimates how high this actor can jump.
/// Estimates how high this actor can jump. Default implementation returns FLT_MAX.
/// @return The actor's jump height.
virtual float EstimateJumpHeight() const;

Expand Down
4 changes: 3 additions & 1 deletion Source/Managers/WindowMan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -675,12 +675,14 @@ void WindowMan::DisplaySwitchOut() const {
SDL_SetCursor(nullptr);
}

void WindowMan::HandleWindowExposedEvent(void *userdata, SDL_Event *event) {
bool WindowMan::HandleWindowExposedEvent(void *userdata, SDL_Event *event) {
if (event->type == SDL_EVENT_WINDOW_EXPOSED) {
g_WindowMan.SetViewportLetterboxed();
g_WindowMan.ClearBackbuffer(false);
g_WindowMan.UploadFrame();
}

return true;
}

void WindowMan::QueueWindowEvent(const SDL_Event& windowEvent) {
Expand Down
4 changes: 2 additions & 2 deletions Source/Managers/WindowMan.h
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,8 @@ namespace RTE {
#pragma endregion

#pragma region Concrete Methods
/// SDL_EventFilter to hadnle window exposed events for live resize.
static void HandleWindowExposedEvent(void* userdata, SDL_Event* event);
/// SDL_EventFilter to handle window exposed events for live resize.
static bool HandleWindowExposedEvent(void* userdata, SDL_Event* event);

/// Adds an SDL_Event to the Event queue for processing on Update.
/// @param windowEvent The SDL window event to queue.
Expand Down
2 changes: 0 additions & 2 deletions Source/Menus/ScenarioActivityConfigGUI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,6 @@ ScenarioActivityConfigGUI::ScenarioActivityConfigGUI(GUIControlManager* parentCo
m_CPULockLabel = dynamic_cast<GUILabel*>(m_GUIControlManager->GetControl("LabelCPUTeamLock"));
m_StartErrorLabel = dynamic_cast<GUILabel*>(m_GUIControlManager->GetControl("LabelStartError"));
m_StartGameButton = dynamic_cast<GUIButton*>(m_GUIControlManager->GetControl("ButtonStartGame"));

m_TechListFetched = false;
}

void ScenarioActivityConfigGUI::PopulateTechComboBoxes() {
Expand Down
10 changes: 5 additions & 5 deletions Source/Menus/ScenarioActivityConfigGUI.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,16 +65,16 @@ namespace RTE {

GUIControlManager* m_GUIControlManager; //!< The GUIControlManager which holds all the GUIControls of this menu. Not owned by this.

const GameActivity* m_SelectedActivity; //!< The Activity this ScenarioActivityConfigGUI is configuring.
const GameActivity* m_PreviouslySelectedActivity; //!< The Activity this ScenarioActivityConfigGUI was configuring last, before it got was disabled.
Scene* m_SelectedScene; //!< The Scene the selected Activity will be using.
int m_LockedCPUTeam = Activity::Teams::NoTeam; //!< Which team the CPU is locked to, if any.
const GameActivity* m_SelectedActivity {}; //!< The Activity this ScenarioActivityConfigGUI is configuring.
const GameActivity* m_PreviouslySelectedActivity {}; //!< The Activity this ScenarioActivityConfigGUI was configuring last, before it got was disabled.
Scene* m_SelectedScene {}; //!< The Scene the selected Activity will be using.
int m_LockedCPUTeam { Activity::Teams::NoTeam }; //!< Which team the CPU is locked to, if any.

bool m_StartingGoldAdjustedManually {}; //!< Whether the player adjusted the starting gold, meaning it should stop automatically adjusting to the difficulty setting default starting gold where applicable.

Timer m_StartGameButtonBlinkTimer; //!< Timer for blinking the start game button.

bool m_TechListFetched; //!< Whether the tech list was fetched and each team's ComboBox was populated with it, even if no valid tech modules were added.
bool m_TechListFetched {}; //!< Whether the tech list was fetched and each team's ComboBox was populated with it, even if no valid tech modules were added.

/// GUI elements that compose the Activity setup box.
GUICollectionBox* m_ActivityConfigBox;
Expand Down
13 changes: 10 additions & 3 deletions Source/System/PathFinder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -172,9 +172,16 @@ int PathFinder::CalculatePath(Vector start, Vector end, std::list<Vector>& pathR
// Actors capable of jumping/jetpacking can jump upwards.
s_JumpHeight = jumpHeight;

// How high up we can jump from this node
s_JumpHeightVertical = std::max(1, static_cast<int>(jumpHeight / (m_NodeDimension * c_MPP))); // min of 1 so automovers work a bit better
s_JumpHeightDiagonal = std::max(1, static_cast<int>((jumpHeight * 0.7F) / (m_NodeDimension * c_MPP)));
// How high up we can jump from this node.
if(jumpHeight == FLT_MAX) {
// Probably quite high.
s_JumpHeightVertical = INT_MAX;
s_JumpHeightDiagonal = INT_MAX;
} else {
// Assume at least 1 so automovers work a bit better
s_JumpHeightVertical = std::max(1, static_cast<int>(jumpHeight / (m_NodeDimension * c_MPP)));
s_JumpHeightDiagonal = std::max(1, static_cast<int>((jumpHeight * 0.7F) / (m_NodeDimension * c_MPP)));
}

// Actors capable of digging can use s_DigStrength to modify the node adjacency cost.
s_DigStrength = digStrength;
Expand Down