It was drawing the map mirrored. The X flip came from the setup console's picture of Brewer's Bane, which is an illustration and not a screenshot - the game does not draw it that way round. What the game does: L4GaugeImagePrimitive::Draw plots MoveToAbsolute(dest->x, dest->z), so the screen axes are view-space X and Z, and the graphics view's origin is bottom left with Y increasing upward - BackgroundLine draws endpoints.bottomLeft to endpoints.topRight, and the port's zero-degree blit is documented with the origin in the bottom left corner. So +X runs right and +Z runs up. Also added the heading the real display has. NavDisplay centres on the vehicle and turns with it, inverting the viewer's transform and taking yaw only unless rockAndRoll is set; the viewer defaults to heading 0, which is the north-up case, and Q/E/R turn it. Panning and dragging now work in what you see rather than in world axes, so up stays up when the map is turned. TRACKS.html is left following the console pictures on purpose: nine of those cards are the console pictures, so the reconstructed nine have to sit beside them consistently. The two disagree by a mirror and each is right for what it is, which both READMEs now say.
77 lines
3.3 KiB
Smarty
77 lines
3.3 KiB
Smarty
<!doctype html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
<title>Red Planet map viewer</title>
|
|
<style>{css}</style>
|
|
</head>
|
|
<body>
|
|
|
|
<div id="screen">
|
|
<canvas id="view" tabindex="0" aria-label="Track map"></canvas>
|
|
<div id="scale"><span id="barline"></span><span id="bartext"></span></div>
|
|
</div>
|
|
|
|
<aside>
|
|
<div>
|
|
<h1 id="name">—</h1>
|
|
<p id="key"></p>
|
|
</div>
|
|
|
|
<select id="track" aria-label="Track"></select>
|
|
|
|
<dl id="stats"></dl>
|
|
|
|
<div class="note">
|
|
<div class="keys">
|
|
<span><kbd>↑</kbd><kbd>↓</kbd><kbd>←</kbd><kbd>→</kbd></span><span>pan N/S/E/W</span>
|
|
<span><kbd>+</kbd><kbd>-</kbd></span><span>zoom</span>
|
|
<span><kbd>[</kbd><kbd>]</kbd></span><span>previous / next track</span>
|
|
<span><kbd>Q</kbd><kbd>E</kbd></span><span>turn the map ±15°</span>
|
|
<span><kbd>R</kbd></span><span>heading back to zero</span>
|
|
<span><kbd>F</kbd></span><span>fit the course</span>
|
|
<span><kbd>A</kbd></span><span>fit everything, strays included</span>
|
|
<span><kbd>G</kbd></span><span>GPS / NavDisplay LOD</span>
|
|
</div>
|
|
</div>
|
|
|
|
<p class="note"><b>Dropped by LOD</b> counts what the map screen does not draw
|
|
at all. <code>L4GaugeImage::Draw</code> takes the first LOD whose scale is at
|
|
least the LOD value and draws <em>nothing</em> once the value runs past the
|
|
largest, so objects vanish rather than simplify. Worth knowing what the data
|
|
does with that: every placement in every track is the same model,
|
|
<code>cn3</code>, and it carries one LOD at scale 1000. So the count stays at
|
|
zero until you pass 1000 m/px, when the whole track disappears at once. The
|
|
rule is the engine's; this content just never leans on it.</p>
|
|
|
|
<p class="note"><b>NavDisplay</b> sets its LOD from the zoom
|
|
(<code>LODIndex = metersPerPixel</code>), which is the pannable radar screen,
|
|
448×416 in <code>L4GAUGE.CFG</code>. <b>GPS</b> is the little 125×203
|
|
panel whose LOD the config pins at 1.0 however far out it is scaled.</p>
|
|
|
|
<p class="note">Colours are the game's own: palette indices resolved through
|
|
<code>secpal.pcc</code>, the palette the pod's secondary port is configured
|
|
with. The walls are grey because index 51 is grey.</p>
|
|
|
|
<p class="note"><b>+X runs right and +Z runs up</b>, which is the engine's
|
|
projection and not a choice: <code>L4GaugeImagePrimitive::Draw</code> plots
|
|
<code>(dest->x, dest->z)</code>, and the graphics view has its origin at
|
|
the bottom left with Y increasing upward. Note the setup console's own
|
|
pictures of the tracks are <em>mirrored</em> against this — they are
|
|
illustrations, not screenshots. The plans in <code>TRACKS.html</code> follow
|
|
the console pictures so the drawn and reconstructed cards agree with each
|
|
other; this viewer follows the game.</p>
|
|
|
|
<p class="note"><b>Heading.</b> The real nav display centres on your vehicle
|
|
and turns with it — it inverts the viewer's transform, taking yaw only
|
|
unless <code>rockAndRoll</code> is set. Free panning at heading 0 is the
|
|
north-up case; <kbd>Q</kbd> and <kbd>E</kbd> turn the map to see what it looks
|
|
like underway.</p>
|
|
</aside>
|
|
|
|
<script id="data" type="application/json">{data}</script>
|
|
<script>{js}</script>
|
|
</body>
|
|
</html>
|