jak1/speedruns: Some final touches for speedrunning in jak 1 (#1830)

* jak1: put common speedrunning code into it's own file

* jak1: enforce `60` fps while in speedrunning mode

* jak1: when speedrunning, display the version until you get the first powercell

* jak1: add an explicit option for skipping cutscenes

* jak1: extend `game-option` to allow any menu option to be disabled

* tests/jak1: allow whitelisting types to be redefined to satisfy typeconsistency checks

* jak1: add file headers

* jak1: cleanup bool checking

* test: delete the es substitle file

* test: add it back

* jak1: missed one cleanup spot related to bool comparisons
This commit is contained in:
Tyler Wilding
2022-09-02 18:15:42 -04:00
committed by GitHub
parent f1f18e7e05
commit 0896bef2bf
21 changed files with 2556 additions and 2504 deletions
+4 -1
View File
@@ -59,7 +59,10 @@ Type* TypeSystem::add_type(const std::string& name, std::unique_ptr<Type> type)
if (*kv->second != *type) {
// exists, and we are trying to change it!
if (m_allow_redefinition) {
// Check if the type is allowed to be redefined
if (m_allow_redefinition ||
std::find(m_types_allowed_to_be_redefined.begin(), m_types_allowed_to_be_redefined.end(),
kv->second->get_name()) != m_types_allowed_to_be_redefined.end()) {
fmt::print("[TypeSystem] Type {} was originally\n{}\nand is redefined as\n{}\n",
kv->second->get_name(), kv->second->print(), type->print());
// extra dangerous, we have allowed type redefinition!
+5
View File
@@ -259,6 +259,10 @@ class TypeSystem {
int get_size_in_type(const Field& field) const;
void add_type_to_allowed_redefinition_list(const std::string& type_name) {
m_types_allowed_to_be_redefined.push_back(type_name);
}
private:
std::string lca_base(const std::string& a, const std::string& b) const;
bool typecheck_base_types(const std::string& expected,
@@ -284,6 +288,7 @@ class TypeSystem {
std::vector<std::unique_ptr<Type>> m_old_types;
std::vector<std::string> m_types_allowed_to_be_redefined;
bool m_allow_redefinition = false;
};