Skip to content
Open
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
1 change: 1 addition & 0 deletions CREDITS.md
Original file line number Diff line number Diff line change
Expand Up @@ -586,6 +586,7 @@ This page lists all the individual contributions to the project by their author.
- Skip target scanning function calling for unarmed technos (code)
- Force techno targeting in distributed frames to improve performance
- Use `SkipCrushSlowdown=true` to avoid the bug related to `Accelerates=true` and `MovementZone=CrushAll`
- Skip drawing frame to improve performance
- **solar-III (凤九歌)**
- Target scanning delay customization (documentation)
- Skip target scanning function calling for unarmed technos (documentation)
Expand Down
11 changes: 11 additions & 0 deletions docs/User-Interface.md
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,17 @@ In `RA2MD.INI`:
ShowDesignatorRange=false ; boolean
```

### Skip drawing frame to improve performance

- Now you can make the game skip the drawing by 1 frame every `SkipFrameDelay` when the frame rate is lower than the vanilla defined `DetailMinFrameRateNormal`. This helps alleviate the frame rate drop caused by drawing.
- This logic only takes effect when `SkipFrameDelay` is greater than or equal to 2.

In `RA2MD.INI`:
```ini
[Phobos]
SkipFrameDelay=0 ; integer
```

### SuperWeapon ShowTimer sorting

- You can now sort the timers of superweapons in ascending order from top to bottom according to a given priority value.
Expand Down
1 change: 1 addition & 0 deletions docs/Whats-New.md
Original file line number Diff line number Diff line change
Expand Up @@ -438,6 +438,7 @@ Vanilla fixes:
- Fixed an issue where airstrike flare line drawn to target at lower elevation would clip (by Starkku)
- Fixed the bug that damaged particle dont disappear after building has repaired by engineer (by NetsuNegi)
- Projectiles with `Vertical=true` now drop straight down if fired off by AircraftTypes instead of behaving erratically (by Starkku)
- Skip drawing frame to improve performance (by TaranDahl)

Phobos fixes:
- Fixed the bug that `AllowAirstrike=no` cannot completely prevent air strikes from being launched against it (by NetsuNegi)
Expand Down
8 changes: 8 additions & 0 deletions src/Misc/Hooks.UI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include <PreviewClass.h>
#include <Surface.h>
#include <ThemeClass.h>
#include <FPSCounter.h>

#include <Ext/House/Body.h>
#include <Ext/Side/Body.h>
Expand Down Expand Up @@ -428,3 +429,10 @@

return 0x69A325;
}

DEFINE_HOOK(0x4F4480, GScreenClass_Render_FrameSkip, 0x8)
{
enum { retn = 0x4F45A8 };
int delay = Phobos::Config::SkipFrameDelay;
return delay && FPSCounter::CurrentFrameRate < RulesClass::Instance->DetailMinFrameRateNormal && !(Unsorted::CurrentFrame % delay) ? retn : 0;

Check warning on line 437 in src/Misc/Hooks.UI.cpp

View workflow job for this annotation

GitHub Actions / build

'<': signed/unsigned mismatch [D:\a\Phobos\Phobos\Phobos.vcxproj]
}
4 changes: 4 additions & 0 deletions src/Phobos.INI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ bool Phobos::Config::HideLightFlashEffects = true;
bool Phobos::Config::ShowFlashOnSelecting = false;
bool Phobos::Config::UnitPowerDrain = false;
int Phobos::Config::SuperWeaponSidebar_RequiredSignificance = 0;
int Phobos::Config::SkipFrameDelay = 0;

bool Phobos::Misc::CustomGS = false;
int Phobos::Misc::CustomGS_ChangeInterval[7] = { -1, -1, -1, -1, -1, -1, -1 };
Expand Down Expand Up @@ -98,6 +99,9 @@ DEFINE_HOOK(0x5FACDF, OptionsClass_LoadSettings_LoadPhobosSettings, 0x5)
Phobos::Config::HideLightFlashEffects = CCINIClass::INI_RA2MD.ReadBool(phobosSection, "HideLightFlashEffects", false);
Phobos::Config::ShowFlashOnSelecting = CCINIClass::INI_RA2MD.ReadBool(phobosSection, "ShowFlashOnSelecting", false);
Phobos::Config::SuperWeaponSidebar_RequiredSignificance = CCINIClass::INI_RA2MD.ReadInteger(phobosSection, "SuperWeaponSidebar.RequiredSignificance", 0);
Phobos::Config::SkipFrameDelay = CCINIClass::INI_RA2MD.ReadInteger("Phobos", "SkipFrameDelay", 0);
if (Phobos::Config::SkipFrameDelay < 2)
Phobos::Config::SkipFrameDelay = 0;

// Custom game speeds, 6 - i so that GS6 is index 0, just like in the engine
Phobos::Config::CampaignDefaultGameSpeed = 6 - CCINIClass::INI_RA2MD.ReadInteger(phobosSection, "CampaignDefaultGameSpeed", 4);
Expand Down
1 change: 1 addition & 0 deletions src/Phobos.h
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ class Phobos
static bool ShowFlashOnSelecting;
static bool UnitPowerDrain;
static int SuperWeaponSidebar_RequiredSignificance;
static int SkipFrameDelay;
};

class Misc
Expand Down
Loading