Skip to content
This repository was archived by the owner on Apr 11, 2026. It is now read-only.
/ GLKeeper Public archive

Commit aab159d

Browse files
committed
-
1 parent 7008935 commit aab159d

4 files changed

Lines changed: 24 additions & 3 deletions

File tree

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ clean:
2121
make -C .build clean
2222

2323
run:
24-
./bin/glkeeper-debug -gamedir ../games/dk2
24+
./bin/glkeeper-debug $(ARGS)
2525

2626
builddir:
2727
test -d .build || mkdir .build

src/GameMain.cpp

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,17 @@ bool GameMain::Initialize()
3333

3434
// set initial gamestate
3535
//SwitchToGameState(&mMeshViewGamestate);
36-
gGameWorld.LoadScenario("null");
37-
SwitchToGameState(&mGameplayGamestate);
36+
if (!gSystem.mStartupParams.mStartupMapName.empty())
37+
{
38+
if (gGameWorld.LoadScenario(gSystem.mStartupParams.mStartupMapName))
39+
{
40+
SwitchToGameState(&mGameplayGamestate);
41+
}
42+
}
43+
else
44+
{
45+
gConsole.LogMessage(eLogMessage_Info, "Startup map is not specified");
46+
}
3847

3948
//SwitchToGameState(&mGuiTestGamestate);
4049

src/SystemSettings.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,14 @@ bool SystemStartupParams::ParseStartupParams(int argc, char *argv[])
6464
continue;
6565
}
6666

67+
if (cxx_stricmp(argv[iarg], "-mapname") == 0 && (argc > iarg + 1))
68+
{
69+
mStartupMapName.assign(argv[iarg + 1]);
70+
71+
iarg += 2;
72+
continue;
73+
}
74+
6775
++iarg;
6876
}
6977

@@ -74,4 +82,5 @@ void SystemStartupParams::Clear()
7482
{
7583
mCustomConfigFileName.clear();
7684
mDungeonKeeperGamePath.clear();
85+
mStartupMapName.clear();
7786
}

src/SystemSettings.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ struct SystemStartupParams
3030
// full path to dungeon keeper game folder
3131
std::string mDungeonKeeperGamePath;
3232

33+
// custom map name to load
34+
std::string mStartupMapName;
35+
3336
public:
3437
SystemStartupParams() = default;
3538

0 commit comments

Comments
 (0)