mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-06-17 04:37:49 +00:00
Compare commits
4 Commits
6a79d05bfe
...
15f5765efb
Author | SHA1 | Date | |
---|---|---|---|
![]() |
15f5765efb | ||
![]() |
a163877413 | ||
![]() |
417badc55c | ||
![]() |
a327466771 |
@ -2010,9 +2010,14 @@ void MainWindow::ShowAchievementSettings()
|
|||||||
|
|
||||||
void MainWindow::OnHardcoreChanged()
|
void MainWindow::OnHardcoreChanged()
|
||||||
{
|
{
|
||||||
if (AchievementManager::GetInstance().IsHardcoreModeActive())
|
bool hardcore_active = AchievementManager::GetInstance().IsHardcoreModeActive();
|
||||||
|
if (hardcore_active)
|
||||||
Settings::Instance().SetDebugModeEnabled(false);
|
Settings::Instance().SetDebugModeEnabled(false);
|
||||||
|
// EmulationStateChanged causes several dialogs to redraw, including anything affected by hardcore
|
||||||
|
// mode. Every dialog that depends on hardcore mode is redrawn by EmulationStateChanged.
|
||||||
|
if (hardcore_active != m_former_hardcore_setting)
|
||||||
emit Settings::Instance().EmulationStateChanged(Core::GetState(Core::System::GetInstance()));
|
emit Settings::Instance().EmulationStateChanged(Core::GetState(Core::System::GetInstance()));
|
||||||
|
m_former_hardcore_setting = hardcore_active;
|
||||||
}
|
}
|
||||||
#endif // USE_RETRO_ACHIEVEMENTS
|
#endif // USE_RETRO_ACHIEVEMENTS
|
||||||
|
|
||||||
|
@ -267,6 +267,7 @@ private:
|
|||||||
#ifdef USE_RETRO_ACHIEVEMENTS
|
#ifdef USE_RETRO_ACHIEVEMENTS
|
||||||
AchievementsWindow* m_achievements_window = nullptr;
|
AchievementsWindow* m_achievements_window = nullptr;
|
||||||
Config::ConfigChangedCallbackID m_config_changed_callback_id;
|
Config::ConfigChangedCallbackID m_config_changed_callback_id;
|
||||||
|
bool m_former_hardcore_setting = false;
|
||||||
#endif // USE_RETRO_ACHIEVEMENTS
|
#endif // USE_RETRO_ACHIEVEMENTS
|
||||||
|
|
||||||
AssemblerWidget* m_assembler_widget;
|
AssemblerWidget* m_assembler_widget;
|
||||||
|
@ -1,26 +1,20 @@
|
|||||||
#! /usr/bin/env python
|
#! /usr/bin/env python3
|
||||||
|
|
||||||
'''
|
'''
|
||||||
Run this script from Source/Core/ to find all the #include cycles.
|
Run this script from Source/Core/ to find all the #include cycles.
|
||||||
'''
|
'''
|
||||||
|
|
||||||
import subprocess
|
from typing import Iterator
|
||||||
|
from pathlib import Path
|
||||||
|
|
||||||
def get_local_includes_for(path):
|
def get_local_includes_for(path: Path) -> Iterator[str]:
|
||||||
lines = open(path).read().split('\n')
|
with path.open() as file:
|
||||||
includes = [l.strip() for l in lines if l.strip().startswith('#include')]
|
for line in file:
|
||||||
return [i.split()[1][1:-1] for i in includes if '"' in i.split()[1]]
|
line = line.strip()
|
||||||
|
if line.startswith("#include") and '"' in line:
|
||||||
|
yield line.split()[1].strip(' "')
|
||||||
|
|
||||||
def find_all_files():
|
def strongly_connected_components(graph: dict[str, list[str]]) -> list[tuple[str, ...]]:
|
||||||
'''Could probably use os.walk, but meh.'''
|
|
||||||
f = subprocess.check_output(['find', '.', '-name', '*.h'],
|
|
||||||
universal_newlines=True).strip().split('\n')
|
|
||||||
return [p[2:] for p in f]
|
|
||||||
|
|
||||||
def make_include_graph():
|
|
||||||
return { f: get_local_includes_for(f) for f in find_all_files() }
|
|
||||||
|
|
||||||
def strongly_connected_components(graph):
|
|
||||||
"""
|
"""
|
||||||
Tarjan's Algorithm (named for its discoverer, Robert Tarjan) is a graph theory algorithm
|
Tarjan's Algorithm (named for its discoverer, Robert Tarjan) is a graph theory algorithm
|
||||||
for finding the strongly connected components of a graph.
|
for finding the strongly connected components of a graph.
|
||||||
@ -34,7 +28,7 @@ def strongly_connected_components(graph):
|
|||||||
index = {}
|
index = {}
|
||||||
result = []
|
result = []
|
||||||
|
|
||||||
def strongconnect(node):
|
def strongconnect(node: str) -> None:
|
||||||
# set the depth index for this node to the smallest unused index
|
# set the depth index for this node to the smallest unused index
|
||||||
index[node] = index_counter[0]
|
index[node] = index_counter[0]
|
||||||
lowlinks[node] = index_counter[0]
|
lowlinks[node] = index_counter[0]
|
||||||
@ -74,7 +68,12 @@ def strongly_connected_components(graph):
|
|||||||
return result
|
return result
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
comp = strongly_connected_components(make_include_graph())
|
paths = Path(".").glob("**/*.h")
|
||||||
for c in comp:
|
graph = {
|
||||||
if len(c) != 1:
|
path.as_posix(): list(get_local_includes_for(path))
|
||||||
print(c)
|
for path in paths
|
||||||
|
}
|
||||||
|
components = strongly_connected_components(graph)
|
||||||
|
for component in components:
|
||||||
|
if len(component) != 1:
|
||||||
|
print(component)
|
||||||
|
Loading…
Reference in New Issue
Block a user