WinMain now wraps the engine block in a loop: when a front-end-launched mission ends under the local console, the setup screen comes back in the same process instead of exiting (the arcade relaunch-per-mission model). Replaces the CreateProcess self-respawn - required for Steam, where the lobby and sockets must survive across races. Second-cycle re-init crash fixed: d3d_OBJECT kept a static texture cache keyed by filename, so race 2 got IDirect3DTexture9 pointers created on race 1 destroyed device and died at first draw (DrawMesh AV). The cache is now flushed in ~DPLRenderer before the device is released, and ParticleEngine::Initialize drops particles left over from the previous mission. Verified: three consecutive 30s races in one PID, each stopped on time by the console with final scores collected. Also: L4CONSOLELEN env override for test-length races, and the console exposes MissionCompleted() for the loop. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
28 lines
1.1 KiB
C
28 lines
1.1 KiB
C
#pragma once
|
|
|
|
#include "..\munga\style.h"
|
|
|
|
//########################################################################
|
|
//########################## RPL4 Local Console ##########################
|
|
//########################################################################
|
|
//
|
|
// The single-player marshal. Hand-fed eggs are a developer shortcut: a
|
|
// mission only ends on a console command, so without one the timer hits
|
|
// 00:00 and just counts up forever. This is the in-process console for
|
|
// front-end-launched games - it watches the mission, dispatches the
|
|
// same StopMissionMessage TeslaConsole sent when the selected length
|
|
// expires, and when the pod returns to WaitingForEgg it brings the race
|
|
// setup back up and feeds the next egg (or quits if the player closes
|
|
// the menu).
|
|
//
|
|
// Installs itself as the application manager's per-frame hook.
|
|
//
|
|
void
|
|
RPL4LocalConsole_Install(int mission_seconds);
|
|
|
|
// True when the last mission ended under the console's control (timer
|
|
// stop or pilot exit). WinMain's single-binary race loop then cycles
|
|
// back to the setup screen for the next race in the same process.
|
|
Logical
|
|
RPL4LocalConsole_MissionCompleted();
|