Patches¶
Masked objects in the WAD comprise all actors and sprites. They can be found as weapons, objects, actors etc. They use the following headers and structures:
patch_t :: struct {
origsize: i16le, // the orig size of "grabbed" gfx
width: i16le, // bounding box size
height: i16le,
leftoffset: i16le, // pixels to the left of origin
topoffset: i16le, // pixels above the origin
collumnofs: [320]u16le, // only [width] used, the [0] is &collumnofs[width]
}
Example of loading patches in Odin
These are extremely similar to the patches used in another game (that rhymes with, erm, Tomb, except for the addition of the origsize parameter.
Certain objects in the game like masked walls and touch plates will use the second type of patch which acts like a translucent patch.
transpatch_t :: struct {
origsize: i16le, // the orig size of "grabbed" gfx
width: i16le, // bounding box size
height: i16le,
leftoffset: i16le, // pixels to the left of origin
topoffset: i16le, // pixels above the origin
translevel: i16le,
collumnofs: [320]i16le, // only [width] used, the [0] is &collumnofs[width]
}