EXIT GAME on the console screen
,noframe takes the title bar away, and with it the only way out of the game. The console screen now offers its own, bottom left: half width and diagonally opposite LAUNCH GAME, because it is the one button on that screen you cannot undo and it should not sit next to the one everybody is aiming for. It goes through the same door as closing the window - fe.closed, so RPL4FrontEnd_Run returns False and the race loop breaks - rather than opening a second shutdown path. Two things had to move for it to make sense. The saved placement now loads in RPL4.CPP, right after the main window is shown, instead of only when SVGA16 builds the cockpit. That was not until a mission started, so the console screen came up at the default rect with its title bar still on and the window only jumped to the saved placement once a race began - which, for a flag whose whole purpose is to take the title bar off, meant it did nothing on the screen you land on. RPL4.CPP now owns the main window's registration outright and SVGA16's branches only reload; the reload after CockpitShellProc goes on still matters, since its WM_SIZE is what re-fits the canvas. That in turn made the exploded view's position-only registration incoherent - the startup load had already applied the size - so the game window is simply position and size everywhere now. The earlier reasoning that its exploded size IS the -res render size does not hold: the back buffer stretches to the window in either view, exactly as it does for the cockpit. WM_EXITSIZEMOVE moves from the cockpit subclass to RPL4.CPP's own WndProc, which the subclass chains to anyway. In its old home it only existed once a cockpit had been built, so dragging the window on the console screen - the obvious moment to put it where you want it - saved nothing. There is also a save on the way out of WinMain, for a session that never started a race and so never ran SVGA16's teardown save. Verified: on a bare-framed window the console screen comes up at the saved 1280x760 with client == window rect, EXIT GAME ends the process with code 0, and a screenshot shows it clear of the column content. A console-only session dragged to 333,222 900x640 wrote that on the drag, kept it through the exit, and came back to exactly it on relaunch - without a race anywhere in the round trip. The noframe and cockpit round trips still pass unchanged. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
+12
-27
@@ -3839,15 +3839,11 @@ static LRESULT CALLBACK
|
||||
cockpit->LayoutCockpit(LOWORD(lParam), HIWORD(lParam));
|
||||
}
|
||||
}
|
||||
else if (message == WM_EXITSIZEMOVE)
|
||||
{
|
||||
//
|
||||
// The shell was just dragged or resized. Write the arrangement now
|
||||
// rather than trusting teardown, so a hard kill still leaves what
|
||||
// was on screen. No-op unless RP412MFDLAYOUT is save.
|
||||
//
|
||||
RPWindowLayout_Save();
|
||||
}
|
||||
//
|
||||
// WM_EXITSIZEMOVE is not handled here: RPL4.CPP's own WndProc takes
|
||||
// it, and this chains straight through to that, so the shell saves on
|
||||
// every finished drag whether or not a cockpit has been built.
|
||||
//
|
||||
return CallWindowProcA(gCockpitBaseProc, hwnd, message, wParam, lParam);
|
||||
}
|
||||
|
||||
@@ -4467,23 +4463,12 @@ SVGA16::SVGA16(
|
||||
work.left + right_x, work.top + bottom_y);
|
||||
splitView[SplitMap]->SetPosition(work.left + map_x, work.top + map_y);
|
||||
|
||||
//
|
||||
// The game window joins them, position only: here its size is the
|
||||
// render resolution -res asked for, so restoring an old one would
|
||||
// leave a stretched back buffer in a window the wrong size.
|
||||
//
|
||||
{
|
||||
HWND shell = ApplicationManager::GetCurrentManager()->GetHWnd();
|
||||
if (shell != NULL)
|
||||
{
|
||||
RPWindowLayout_Register(shell, "RPL4", False);
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// ...and then let RP412MFDLAYOUT put everything back where it was
|
||||
// dragged to last time. Windows the file does not mention keep the
|
||||
// arrangement just computed above.
|
||||
// arrangement just computed above. The game window is registered
|
||||
// already - RPL4.CPP does that before the console screen ever
|
||||
// shows - so this picks it up alongside the panes.
|
||||
//
|
||||
RPWindowLayout_Load();
|
||||
}
|
||||
@@ -4702,16 +4687,16 @@ SVGA16::SVGA16(
|
||||
// Sticky placement for the shell. Position AND size: nothing
|
||||
// derives that size here - -res only decides how sharp the
|
||||
// scene is - so a window sized to suit a monitor should come
|
||||
// back that way. Registered after the subclass on purpose, so
|
||||
// the restore's WM_SIZE runs LayoutCockpit again and the
|
||||
// canvas re-fits the restored client area.
|
||||
// back that way. RPL4.CPP registered it before the console
|
||||
// screen; this reload undoes the sizing just done above, and
|
||||
// runs after the subclass on purpose so its WM_SIZE puts
|
||||
// LayoutCockpit over the restored client area.
|
||||
//
|
||||
// -fit sits it borderless over the whole monitor, so there is
|
||||
// no placement of the player's to remember.
|
||||
//
|
||||
if (!fit_display)
|
||||
{
|
||||
RPWindowLayout_Register(cockpit, "RPL4", True);
|
||||
RPWindowLayout_Load();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user