Correctly render all four objects for every cell in a map

This commit is contained in:
2018-03-25 00:36:23 +00:00
parent c8238f1853
commit 6a90bb16cf
3 changed files with 27 additions and 4 deletions

View File

@@ -375,7 +375,7 @@ Press "U" to get to the screen!
![Debug screen](img/cell-information-debug.png)
I've added a `view-map` command to explore the data graphically. Each of the 16
I've added a `view-minimap` command to explore the data graphically. Each of the 16
bytes in a cell row must have a function; comparing a known map to how it looks
in WH40K_TD.exe can help me to unravel that function.
@@ -431,7 +431,20 @@ maps.Cell{
So `CellIdx == 9` points to the center object's Area, looked up in the set file!
![Pinning down cell index 9](img/chapter01_cell_index_9.png
![Pinning down cell index 9](img/chapter01_cell_index_9.png)
It seems the area numbers are absolute indexes into the set, rather than having
a new set of indices for each type.
With this information, we can render a given Z index for a map quite easily,
using the new `view-map` binary. It draws the four objects for every cell, and
gives results like this:
![Rendering all map objects](img/chapter01-rendering-objects.png)
Some colours are off, but I've verified that I'm using the correct palette, so
this must be due to other things. Perhaps `Data/Cycle.cyc` is the culprit, or
maybe I need to revisit .obj file parsing a few more times!
## Trailer