Single-binary race loop: menu -> race -> menu in one process

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>
This commit is contained in:
Cyd
2026-07-12 18:48:56 -05:00
co-authored by Claude Fable 5
parent 9f79508257
commit 570eb3aceb
7 changed files with 88 additions and 39 deletions
+4
View File
@@ -3495,6 +3495,10 @@ DPLRenderer::~DPLRenderer()
delete mAux2Index;
}
// device-bound resources living in static caches would dangle into
// the next race of the single-binary loop - drop them with the device
d3d_OBJECT::FlushTextureCache();
SAFE_RELEASE(mDevice);
SAFE_RELEASE(gD3D);
//STUBBED: DPL RB 1/14/07