Skip to content

Commit 20ca728

Browse files
committed
PowerMode: added cmd line & ini parsing
1 parent cb4ec6f commit 20ca728

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

src/game_config_game.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ void Game_ConfigGame::LoadFromArgs(CmdlineParser& cp) {
8787
patch_rpg2k3_commands.Lock(false);
8888
patch_anti_lag_switch.Lock(0);
8989
patch_direct_menu.Lock(0);
90+
patch_powermode.Lock(0);
9091

9192
RuntimePatches::LockPatchesAsDiabled();
9293
patch_override = true;
@@ -156,6 +157,11 @@ void Game_ConfigGame::LoadFromArgs(CmdlineParser& cp) {
156157
}
157158
continue;
158159
}
160+
if (cp.ParseNext(arg, 0, { "--patch-powermode", "--no-patch-powermode" })) {
161+
patch_powermode.Set(arg.ArgIsOn());
162+
patch_override = true;
163+
continue;
164+
}
159165
if (RuntimePatches::ParseFromCommandLine(cp)) {
160166
patch_override = true;
161167
continue;
@@ -235,6 +241,10 @@ void Game_ConfigGame::LoadFromStream(Filesystem_Stream::InputStream& is) {
235241
patch_override = true;
236242
}
237243

244+
if (patch_powermode.FromIni(ini)) {
245+
patch_override = true;
246+
}
247+
238248
if (RuntimePatches::ParseFromIni(ini)) {
239249
patch_override = true;
240250
}

src/player.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -829,8 +829,6 @@ void Player::CreateGameObjects() {
829829
game_config.patch_destiny.Set(true);
830830
}
831831

832-
// PowerMode2003 can be detected via the existence of the files "hvm.dll", "fmodex.dll" &
833-
// "warp.dll", but some games seem to only ship with the latter of the three.
834832
if (!FileFinder::Game().FindFile("warp.dll").empty()) {
835833
game_config.patch_powermode.Set(true);
836834
}
@@ -1477,6 +1475,7 @@ Engine options:
14771475
version of the engine.
14781476
--patch-rpg2k3-cmds Support all RPG Maker 2003 event commands in any version
14791477
of the engine.
1478+
--patch-powermode Enable PowerMode 2003 Patch by Firesta.
14801479
--no-patch Disable all engine patches. To disable a single patch,
14811480
prefix any of the patch options with --no-
14821481
--project-path PATH Instead of using the working directory, the game in PATH

0 commit comments

Comments
 (0)