@@ -75,6 +75,44 @@ std::string CommandLine::GetWorldName() {
7575 return (it != s_values.end ()) ? it->second : " " ;
7676}
7777
78+ int CommandLine::GetSeed () {
79+ auto it = s_values.find (" -seed" );
80+ if (it != s_values.end () && !it->second .empty ()) {
81+ try { return std::stoi (it->second ); } catch (...) {}
82+ }
83+ return 0 ;
84+ }
85+
86+ int CommandLine::GetRenderDistance () {
87+ auto it = s_values.find (" -rd" );
88+ if (it != s_values.end () && !it->second .empty ()) {
89+ try { return std::stoi (it->second ); } catch (...) {}
90+ }
91+ return 0 ;
92+ }
93+
94+ int CommandLine::GetMSAA () {
95+ auto it = s_values.find (" -msaa" );
96+ if (it != s_values.end () && !it->second .empty ()) {
97+ try { return std::stoi (it->second ); } catch (...) {}
98+ }
99+ return 0 ;
100+ }
101+
102+ int CommandLine::GetVSync () {
103+ if (s_flags.count (" --vsync" )) return 1 ;
104+ if (s_flags.count (" --no-vsync" )) return -1 ;
105+ return 0 ;
106+ }
107+
108+ bool CommandLine::StartFullscreen () {
109+ return s_flags.count (" --fullscreen" ) > 0 ;
110+ }
111+
112+ bool CommandLine::StartFlyMode () {
113+ return s_flags.count (" --fly" ) > 0 ;
114+ }
115+
78116bool CommandLine::AutoBenchmark () {
79117 return s_flags.count (" --bench" ) || s_flags.count (" --benchmark" );
80118}
@@ -100,19 +138,28 @@ void CommandLine::PrintHelp(const char* exe) {
100138 << " -r d3d12 Use DirectX 12\n "
101139 << " -r opengl Use OpenGL\n "
102140 << " \n Window\n "
103- << " -w <pixels> Window width (default: 1200)\n "
104- << " -h <pixels> Window height (default: 800)\n "
105- << " -t <name> Window title (use _ for spaces)\n "
141+ << " -w <pixels> Window width (default: 1200)\n "
142+ << " -h <pixels> Window height (default: 800)\n "
143+ << " -t <name> Window title (use _ for spaces)\n "
144+ << " --fullscreen Start in fullscreen\n "
106145 << " \n World\n "
107146 << " -world <name> Load world if save exists, create new otherwise\n "
147+ << " -seed <n> Seed for new world creation (default: random)\n "
148+ << " -rd <n> Initial render distance in chunks (default: 8)\n "
149+ << " --fly Start in fly mode\n "
150+ << " \n Graphics\n "
151+ << " -msaa <n> MSAA sample count: 1, 2, 4, 8 (default: 1)\n "
152+ << " --vsync Enable VSync on launch\n "
153+ << " --no-vsync Disable VSync on launch\n "
108154 << " \n Benchmark\n "
109155 << " --bench Start benchmark recording immediately on launch\n "
110156 << " \n Misc\n "
111157 << " --help Show this message\n "
112158 << " \n Examples\n "
113159 << " SleakCraft -r vulkan -world MyWorld\n "
114160 << " SleakCraft -r d3d11 -world TestWorld --bench\n "
115- << " SleakCraft -w 1920 -h 1080 -t My_Game\n\n " ;
161+ << " SleakCraft -r d3d12 -world Perf -rd 16 -msaa 4 --bench\n "
162+ << " SleakCraft -w 1920 -h 1080 --fullscreen --vsync\n\n " ;
116163}
117164
118165} // namespace Sleak
0 commit comments