bigger commits
This commit is contained in:
@@ -83,6 +83,7 @@
|
||||
#include "SoundSystem.h"
|
||||
#include "ResourceManager.h"
|
||||
#include "Net.h"
|
||||
#include "Camera.h"
|
||||
|
||||
// Asks in the console whether to host, join or play offline (before the window opens,
|
||||
// so the window isn't frozen while waiting for typing).
|
||||
@@ -115,8 +116,29 @@ static void PromptNetworkMode() {
|
||||
}
|
||||
}
|
||||
|
||||
// Mouse sensitivity as cm of mouse travel per 360 degree turn. Enter keeps the default.
|
||||
static void PromptSensitivity() {
|
||||
auto ask = [](const char* label, float& target) {
|
||||
std::cout << label;
|
||||
std::string line;
|
||||
std::getline(std::cin, line);
|
||||
try {
|
||||
const float v = std::stof(line);
|
||||
if (v > 0.0f) target = v;
|
||||
}
|
||||
catch (...) {} // empty / not a number: keep the default
|
||||
};
|
||||
std::cout << "\n=== MOUSE ===\n";
|
||||
float cm = 0.0f, dpi = 800.0f;
|
||||
ask("Sensitivity in cm per 360 degrees [default]: ", cm);
|
||||
if (cm > 0.0f) ask("Mouse DPI [800]: ", dpi);
|
||||
StartupCmPer360 = cm;
|
||||
StartupMouseDpi = dpi;
|
||||
}
|
||||
|
||||
int main() {
|
||||
PromptNetworkMode();
|
||||
PromptSensitivity();
|
||||
glfwInit();
|
||||
|
||||
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
|
||||
|
||||
Reference in New Issue
Block a user