Merge branch 'main' into main

This commit is contained in:
Jeod 2024-04-27 19:28:16 -04:00 committed by GitHub
commit 53f3015ad2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 20 additions and 29 deletions

View File

@ -1671,6 +1671,14 @@ void InitIOSystems(bool editor) {
Descent->set_defer_handler(D3DeferHandler);
if (!editor && !FindArg("-windowed")) {
if (Dedicated_server) {
ddio_MouseMode(MOUSE_STANDARD_MODE);
} else {
ddio_MouseMode(MOUSE_EXCLUSIVE_MODE);
}
}
// do io init stuff
io_info.obj = Descent;
io_info.use_lo_res_time = (bool)(FindArg("-lorestimer") != 0);
@ -1680,14 +1688,6 @@ void InitIOSystems(bool editor) {
Error("I/O initialization failed.");
}
if (!editor && !FindArg("-windowed")) {
if (Dedicated_server) {
ddio_MouseMode(MOUSE_STANDARD_MODE);
} else {
ddio_MouseMode(MOUSE_EXCLUSIVE_MODE);
}
}
int rocknride_arg = FindArg("-rocknride");
if (rocknride_arg) {
int comm_port = atoi(GameArgs[rocknride_arg + 1]);
@ -2544,6 +2544,14 @@ void RestartD3() {
mprintf((0, "Restarting D3...\n"));
if (!FindArg("-windowed")) {
if (Dedicated_server) {
ddio_MouseMode(MOUSE_STANDARD_MODE);
} else {
ddio_MouseMode(MOUSE_EXCLUSIVE_MODE);
}
}
// startup io
io_info.obj = Descent;
io_info.use_lo_res_time = (bool)(FindArg("-lorestimer") != 0);
@ -2553,14 +2561,6 @@ void RestartD3() {
Error("I/O initialization failed.");
}
if (!FindArg("-windowed")) {
if (Dedicated_server) {
ddio_MouseMode(MOUSE_STANDARD_MODE);
} else {
ddio_MouseMode(MOUSE_EXCLUSIVE_MODE);
}
}
// startup screen.
ddvid_Init(Descent, App_ddvid_subsystem);
ddio_KeyFlush();

View File

@ -110,15 +110,6 @@ void DDIOShowCursor(BOOL show) {
}
void ddio_MouseMode(int mode) {
if (mode == MOUSE_EXCLUSIVE_MODE) {
DDIOShowCursor(FALSE);
} else if (mode == MOUSE_STANDARD_MODE) {
DDIOShowCursor(TRUE);
} else {
Int3();
return;
}
DDIO_mouse_state.mode = mode;
}
@ -392,10 +383,10 @@ bool InitNewMouse() {
//TODO: This code should be renabled when some solution for mouse capturing is decided on.
// The game should free the capture when the cursor is visible, and recapture it when it isn't visible.
// Account for the original mode.
//if (DDIO_mouse_state.mode == MOUSE_EXCLUSIVE_MODE)
if (DDIO_mouse_state.mode == MOUSE_EXCLUSIVE_MODE)
rawInputDevice.dwFlags = RIDEV_CAPTUREMOUSE | RIDEV_NOLEGACY;
//else
// rawInputDevice.dwFlags = 0;
else
rawInputDevice.dwFlags = 0;
rawInputDevice.hwndTarget = DInputData.hwnd;
@ -446,7 +437,7 @@ bool ddio_MouseInit() {
DDIO_mouse_state.cursor_count = ShowCursor(FALSE);
}
ddio_MouseMode(MOUSE_STANDARD_MODE);
DDIOShowCursor(DDIO_mouse_state.mode == MOUSE_EXCLUSIVE_MODE ? FALSE : TRUE);
DDIO_mouse_state.suspended = false;
ddio_MouseReset();