MiniDoom

src/hdwad_builder.ml

Builds MiniDoom HDWAD cache files inside the game executable.

Package
(global)
Reachable
Yes

Imports

Declarations

HD_MAGIC0

const HD_MAGIC0 = 77

Defines hd magic0 for the hdwad builder subsystem.

View source

HD_MAGIC1

const HD_MAGIC1 = 68

Defines hd magic1 for the hdwad builder subsystem.

View source

HD_MAGIC2

const HD_MAGIC2 = 72

Defines hd magic2 for the hdwad builder subsystem.

View source

HD_MAGIC3

const HD_MAGIC3 = 68

Defines hd magic3 for the hdwad builder subsystem.

View source

HDB_BuildImages

function HDB_BuildImages(wadData, lumps, scale)

Loads the palette and patch namespace, then builds the complete HD image set from wall textures, flats, sprites, and remaining patch lumps.

ParameterTypeDefaultDescription
wadDatadynamic—Wad data value supplied to `HDB_BuildImages`.
lumpsdynamic—Lumps value supplied to `HDB_BuildImages`.
scaledynamic—Scale value supplied to `HDB_BuildImages`.

View source

HDB_EstimateImageProgressUnits

function HDB_EstimateImageProgressUnits(wadData, lumps, scale)

Estimates the progress units emitted while HDWAD graphics are built.

ParameterTypeDefaultDescription
wadDatadynamic—Wad data value supplied to `HDB_EstimateImageProgressUnits`.
lumpsdynamic—Lumps value supplied to `HDB_EstimateImageProgressUnits`.
scaledynamic—Scale value supplied to `HDB_EstimateImageProgressUnits`.

View source

HDB_LegacyToolMain

function HDB_LegacyToolMain(args)

Legacy helper kept for manual module testing.

ParameterTypeDefaultDescription
argsdynamic—Args value supplied to `HDB_LegacyToolMain`.

View source

HDB_LoadWadForBuild

function HDB_LoadWadForBuild(path)

Loads and validates the source WAD bytes and directory through the builder's shared WAD parser.

ParameterTypeDefaultDescription
pathdynamic—Filesystem path to process.

View source

HDB_WriteHDWAD

function HDB_WriteHDWAD(path, wadData, lumps, images, extraNames, extraDatas, scale)

Exposes full HDWAD packaging, including synthetic lumps, through the builder module's stable public entry point.

ParameterTypeDefaultDescription
pathdynamic—Filesystem path to process.
wadDatadynamic—Wad data value supplied to `HDB_WriteHDWAD`.
lumpsdynamic—Lumps value supplied to `HDB_WriteHDWAD`.
imagesdynamic—Images value supplied to `HDB_WriteHDWAD`.
extraNamesdynamic—Extra names value supplied to `HDB_WriteHDWAD`.
extraDatasdynamic—Extra datas value supplied to `HDB_WriteHDWAD`.
scaledynamic—Scale value supplied to `HDB_WriteHDWAD`.

View source

UP_AddAllPatchLumps

function UP_AddAllPatchLumps(images, wadData, lumps, scale, pal)

Extracts all remaining Doom patch-format graphics such as HUD, menu, title, finale and fonts.

ParameterTypeDefaultDescription
imagesdynamic—Images value supplied to `UP_AddAllPatchLumps`.
wadDatadynamic—Wad data value supplied to `UP_AddAllPatchLumps`.
lumpsdynamic—Lumps value supplied to `UP_AddAllPatchLumps`.
scaledynamic—Scale value supplied to `UP_AddAllPatchLumps`.
paldynamic—Pal value supplied to `UP_AddAllPatchLumps`.

View source

UP_AddFlatRange

function UP_AddFlatRange(images, wadData, lumps, startName, endName, scale, pal)

Extracts flat images from a marker range.

ParameterTypeDefaultDescription
imagesdynamic—Images value supplied to `UP_AddFlatRange`.
wadDatadynamic—Wad data value supplied to `UP_AddFlatRange`.
lumpsdynamic—Lumps value supplied to `UP_AddFlatRange`.
startNamedynamic—Start name value supplied to `UP_AddFlatRange`.
endNamedynamic—End name value supplied to `UP_AddFlatRange`.
scaledynamic—Scale value supplied to `UP_AddFlatRange`.
paldynamic—Pal value supplied to `UP_AddFlatRange`.

View source

UP_AddPatchRange

function UP_AddPatchRange(images, wadData, lumps, startName, endName, kind, scale, pal)

Extracts Doom patch images from a marker range.

ParameterTypeDefaultDescription
imagesdynamic—Images value supplied to `UP_AddPatchRange`.
wadDatadynamic—Wad data value supplied to `UP_AddPatchRange`.
lumpsdynamic—Lumps value supplied to `UP_AddPatchRange`.
startNamedynamic—Start name value supplied to `UP_AddPatchRange`.
endNamedynamic—End name value supplied to `UP_AddPatchRange`.
kinddynamic—Kind value supplied to `UP_AddPatchRange`.
scaledynamic—Scale value supplied to `UP_AddPatchRange`.
paldynamic—Pal value supplied to `UP_AddPatchRange`.

View source

UP_AddTextureLump

function UP_AddTextureLump(images, wadData, lumps, lumpName, patchLookup, scale, pal)

Adds composited wall textures from TEXTURE1/TEXTURE2.

ParameterTypeDefaultDescription
imagesdynamic—Images value supplied to `UP_AddTextureLump`.
wadDatadynamic—Wad data value supplied to `UP_AddTextureLump`.
lumpsdynamic—Lumps value supplied to `UP_AddTextureLump`.
lumpNamedynamic—Lump name value supplied to `UP_AddTextureLump`.
patchLookupdynamic—Patch lookup value supplied to `UP_AddTextureLump`.
scaledynamic—Scale value supplied to `UP_AddTextureLump`.
paldynamic—Pal value supplied to `UP_AddTextureLump`.

View source

UP_BestEdgeColor

function UP_BestEdgeColor(pal, center, a, b, hasAlpha)

Chooses the closer edge color for a corner blend.

ParameterTypeDefaultDescription
paldynamic—Pal value supplied to `UP_BestEdgeColor`.
centerdynamic—Center value supplied to `UP_BestEdgeColor`.
adynamic—First input operand.
bdynamic—Second input operand.
hasAlphadynamic—Whether has alpha holds.

View source

UP_BestEdgeColorCached

function UP_BestEdgeColorCached(pal, cache, center, a, b, hasAlpha)

Chooses the closer edge color using cached palette distances.

ParameterTypeDefaultDescription
paldynamic—Pal value supplied to `UP_BestEdgeColorCached`.
cachedynamic—Cache value supplied to `UP_BestEdgeColorCached`.
centerdynamic—Center value supplied to `UP_BestEdgeColorCached`.
adynamic—First input operand.
bdynamic—Second input operand.
hasAlphadynamic—Whether has alpha holds.

View source

UP_BlendCorner

function UP_BlendCorner(dst, dw, blockX, blockY, scale, corner, base, edge, pal, cache, hasAlpha)

Applies a triangular xBRZ corner blend inside one scaled block.

ParameterTypeDefaultDescription
dstdynamic—Dst value supplied to `UP_BlendCorner`.
dwdynamic—Dw value supplied to `UP_BlendCorner`.
blockXdynamic—Horizontal coordinate or vector component represented by block x.
blockYdynamic—Vertical coordinate or vector component represented by block y.
scaledynamic—Scale value supplied to `UP_BlendCorner`.
cornerdynamic—Corner value supplied to `UP_BlendCorner`.
basedynamic—Base value supplied to `UP_BlendCorner`.
edgedynamic—Edge value supplied to `UP_BlendCorner`.
paldynamic—Pal value supplied to `UP_BlendCorner`.
cachedynamic—Cache value supplied to `UP_BlendCorner`.
hasAlphadynamic—Whether has alpha holds.

View source

UP_BlendEdgeColumn

function UP_BlendEdgeColumn(dst, dw, blockX, blockY, scale, col, base, edge, pal, cache, hasAlpha, weight)

Blends one vertical edge of a scaled block toward a neighboring edge color.

ParameterTypeDefaultDescription
dstdynamic—Dst value supplied to `UP_BlendEdgeColumn`.
dwdynamic—Dw value supplied to `UP_BlendEdgeColumn`.
blockXdynamic—Horizontal coordinate or vector component represented by block x.
blockYdynamic—Vertical coordinate or vector component represented by block y.
scaledynamic—Scale value supplied to `UP_BlendEdgeColumn`.
coldynamic—Col value supplied to `UP_BlendEdgeColumn`.
basedynamic—Base value supplied to `UP_BlendEdgeColumn`.
edgedynamic—Edge value supplied to `UP_BlendEdgeColumn`.
paldynamic—Pal value supplied to `UP_BlendEdgeColumn`.
cachedynamic—Cache value supplied to `UP_BlendEdgeColumn`.
hasAlphadynamic—Whether has alpha holds.
weightdynamic—Weight value supplied to `UP_BlendEdgeColumn`.

View source

UP_BlendEdgeRow

function UP_BlendEdgeRow(dst, dw, blockX, blockY, scale, row, base, edge, pal, cache, hasAlpha, weight)

Blends one horizontal edge of a scaled block toward a neighboring edge color.

ParameterTypeDefaultDescription
dstdynamic—Dst value supplied to `UP_BlendEdgeRow`.
dwdynamic—Dw value supplied to `UP_BlendEdgeRow`.
blockXdynamic—Horizontal coordinate or vector component represented by block x.
blockYdynamic—Vertical coordinate or vector component represented by block y.
scaledynamic—Scale value supplied to `UP_BlendEdgeRow`.
rowdynamic—Row value supplied to `UP_BlendEdgeRow`.
basedynamic—Base value supplied to `UP_BlendEdgeRow`.
edgedynamic—Edge value supplied to `UP_BlendEdgeRow`.
paldynamic—Pal value supplied to `UP_BlendEdgeRow`.
cachedynamic—Cache value supplied to `UP_BlendEdgeRow`.
hasAlphadynamic—Whether has alpha holds.
weightdynamic—Weight value supplied to `UP_BlendEdgeRow`.

View source

UP_BlendIndex

function UP_BlendIndex(pal, cache, base, edge, edgeWeight, hasAlpha)

Blends two palette indices and quantizes the result.

ParameterTypeDefaultDescription
paldynamic—Pal value supplied to `UP_BlendIndex`.
cachedynamic—Cache value supplied to `UP_BlendIndex`.
basedynamic—Base value supplied to `UP_BlendIndex`.
edgedynamic—Edge value supplied to `UP_BlendIndex`.
edgeWeightdynamic—Edge weight value supplied to `UP_BlendIndex`.
hasAlphadynamic—Whether has alpha holds.

View source

UP_BlendIndexRatio

function UP_BlendIndexRatio(pal, cache, base, edge, ratioCode, hasAlpha)

Controls blend Index Ratio transitions in the HDWAD builder system.

ParameterTypeDefaultDescription
paldynamic—Pal value supplied to `UP_BlendIndexRatio`.
cachedynamic—Cache value supplied to `UP_BlendIndexRatio`.
basedynamic—Base value supplied to `UP_BlendIndexRatio`.
edgedynamic—Edge value supplied to `UP_BlendIndexRatio`.
ratioCodedynamic—Ratio code value supplied to `UP_BlendIndexRatio`.
hasAlphadynamic—Whether has alpha holds.

View source

UP_BuildTextureImage

function UP_BuildTextureImage(tex, wadData, lumps)

Composites a wall texture from its source patch placements.

ParameterTypeDefaultDescription
texdynamic—Texture identifier or texture data to process.
wadDatadynamic—Wad data value supplied to `UP_BuildTextureImage`.
lumpsdynamic—Lumps value supplied to `UP_BuildTextureImage`.

View source

UP_ClampScale

inline function UP_ClampScale(v)

Keeps output scale inside the supported package range.

ParameterTypeDefaultDescription
vdynamic—Value consumed by the operation.

View source

UP_ColorDistance

function UP_ColorDistance(pal, a, b, hasAlpha)

Computes weighted RGB distance for xBRZ edge decisions.

ParameterTypeDefaultDescription
paldynamic—Pal value supplied to `UP_ColorDistance`.
adynamic—First input operand.
bdynamic—Second input operand.
hasAlphadynamic—Whether has alpha holds.

View source

UP_ColorDistanceCached

function UP_ColorDistanceCached(pal, cache, a, b, hasAlpha)

Computes palette distance with a per-image 256x256 cache.

ParameterTypeDefaultDescription
paldynamic—Pal value supplied to `UP_ColorDistanceCached`.
cachedynamic—Cache value supplied to `UP_ColorDistanceCached`.
adynamic—First input operand.
bdynamic—Second input operand.
hasAlphadynamic—Whether has alpha holds.

View source

UP_CopyBytes

function UP_CopyBytes(dst, dstOff, src, srcOff, count)

Copies a byte range.

ParameterTypeDefaultDescription
dstdynamic—Dst value supplied to `UP_CopyBytes`.
dstOffdynamic—Dst off value supplied to `UP_CopyBytes`.
srcdynamic—Src value supplied to `UP_CopyBytes`.
srcOffdynamic—Src off value supplied to `UP_CopyBytes`.
countdynamic—Number of elements or iterations to process.

View source

UP_CornerWeight

inline function UP_CornerWeight(dist, scale)

Returns the local xBRZ corner blend weight for one block coordinate.

ParameterTypeDefaultDescription
distdynamic—Dist value supplied to `UP_CornerWeight`.
scaledynamic—Scale value supplied to `UP_CornerWeight`.

View source

UP_CountMarkerRange

function UP_CountMarkerRange(lumps, startName, endName)

Counts WAD lumps between two marker names for progress estimation.

ParameterTypeDefaultDescription
lumpsdynamic—Lumps value supplied to `UP_CountMarkerRange`.
startNamedynamic—Start name value supplied to `UP_CountMarkerRange`.
endNamedynamic—End name value supplied to `UP_CountMarkerRange`.

View source

UP_DecodePatch

function UP_DecodePatch(name, kind, lumpData)

Converts a Doom patch lump into a palettized rectangular image.

ParameterTypeDefaultDescription
namedynamic—Resource or object name to resolve.
kinddynamic—Kind value supplied to `UP_DecodePatch`.
lumpDatadynamic—Lump data value supplied to `UP_DecodePatch`.

View source

UP_DefaultPalette

function UP_DefaultPalette()

Builds a grayscale fallback palette.

View source

UP_DrawPatchToTexture

function UP_DrawPatchToTexture(patch, canvas, texW, texH, originX, originY)

Draws a decoded patch image into an indexed texture canvas.

ParameterTypeDefaultDescription
patchdynamic—Patch value supplied to `UP_DrawPatchToTexture`.
canvasdynamic—Canvas value supplied to `UP_DrawPatchToTexture`.
texWdynamic—Tex w value supplied to `UP_DrawPatchToTexture`.
texHdynamic—Tex h value supplied to `UP_DrawPatchToTexture`.
originXdynamic—Horizontal coordinate or vector component represented by origin x.
originYdynamic—Vertical coordinate or vector component represented by origin y.

View source

UP_FindLump

function UP_FindLump(lumps, name)

Finds a lump by name.

ParameterTypeDefaultDescription
lumpsdynamic—Lumps value supplied to `UP_FindLump`.
namedynamic—Resource or object name to resolve.

View source

UP_FindMarker

function UP_FindMarker(lumps, name)

Finds the first lump marker with the given name.

ParameterTypeDefaultDescription
lumpsdynamic—Lumps value supplied to `UP_FindMarker`.
namedynamic—Resource or object name to resolve.

View source

UP_FLAG_TRANSPARENT

const UP_FLAG_TRANSPARENT = 1

Defines up flag transparent for the hdwad builder subsystem.

View source

UP_HasImage

function UP_HasImage(images, kind, name)

Checks whether an image with the same kind/name was already emitted.

ParameterTypeDefaultDescription
imagesdynamic—Images value supplied to `UP_HasImage`.
kinddynamic—Kind value supplied to `UP_HasImage`.
namedynamic—Resource or object name to resolve.

View source

up_image_t struct

UP_IsLikelyPatch

function UP_IsLikelyPatch(data)

Performs conservative validation for Doom patch data.

ParameterTypeDefaultDescription
datadynamic—Binary or structured data to process.

View source

UP_IsMarkerName

function UP_IsMarkerName(name)

Avoids trying marker/control lumps as patch images.

ParameterTypeDefaultDescription
namedynamic—Resource or object name to resolve.

View source

UP_IsTransparent

inline function UP_IsTransparent(idx, hasAlpha)

Checks whether an indexed pixel is transparent for patch-like images.

ParameterTypeDefaultDescription
idxdynamic—Zero-based element or table index.
hasAlphadynamic—Whether has alpha holds.

View source

UP_LoadingPulse

inline function UP_LoadingPulse()

Pumps the host window while HDWAD generation performs long CPU-bound work.

View source

UP_LoadPalette

function UP_LoadPalette(wadData, lumps)

Extracts the first PLAYPAL palette from the WAD.

ParameterTypeDefaultDescription
wadDatadynamic—Wad data value supplied to `UP_LoadPalette`.
lumpsdynamic—Lumps value supplied to `UP_LoadPalette`.

View source

UP_LoadWad

function UP_LoadWad(path)

Reads a WAD and returns [data, lumps].

ParameterTypeDefaultDescription
pathdynamic—Filesystem path to process.

View source

up_lump_t struct

UP_LumpBytes

function UP_LumpBytes(wadData, lumps, idx)

Returns a lump payload or void.

ParameterTypeDefaultDescription
wadDatadynamic—Wad data value supplied to `UP_LumpBytes`.
lumpsdynamic—Lumps value supplied to `UP_LumpBytes`.
idxdynamic—Zero-based element or table index.

View source

UP_MAGIC0

const UP_MAGIC0 = 77

Defines up magic0 for the hdwad builder subsystem.

View source

UP_MAGIC1

const UP_MAGIC1 = 68

Defines up magic1 for the hdwad builder subsystem.

View source

UP_MAGIC2

const UP_MAGIC2 = 85

Defines up magic2 for the hdwad builder subsystem.

View source

UP_MAGIC3

const UP_MAGIC3 = 80

Defines up magic3 for the hdwad builder subsystem.

View source

UP_Name8

function UP_Name8(b)

Decodes a WAD name.

ParameterTypeDefaultDescription
bdynamic—Second input operand.

View source

UP_NearestPaletteIndex

function UP_NearestPaletteIndex(pal, r, g, b, hasAlpha)

Quantizes an RGB color back to the Doom palette.

ParameterTypeDefaultDescription
paldynamic—Pal value supplied to `UP_NearestPaletteIndex`.
rdynamic—R value supplied to `UP_NearestPaletteIndex`.
gdynamic—G value supplied to `UP_NearestPaletteIndex`.
bdynamic—Second input operand.
hasAlphadynamic—Whether has alpha holds.

View source

UP_OPAQUE_255_REMAP

const UP_OPAQUE_255_REMAP = 254

Defines up opaque 255 remap for the hdwad builder subsystem.

View source

UP_ParsePnames

function UP_ParsePnames(wadData, lumps)

Builds PNAMES patch-name to lump-index mapping.

ParameterTypeDefaultDescription
wadDatadynamic—Wad data value supplied to `UP_ParsePnames`.
lumpsdynamic—Lumps value supplied to `UP_ParsePnames`.

View source

UP_ParseTextureLump

function UP_ParseTextureLump(wadData, lumps, lumpName, patchLookup)

Parses TEXTURE1/TEXTURE2 wall texture definitions.

ParameterTypeDefaultDescription
wadDatadynamic—Wad data value supplied to `UP_ParseTextureLump`.
lumpsdynamic—Lumps value supplied to `UP_ParseTextureLump`.
lumpNamedynamic—Lump name value supplied to `UP_ParseTextureLump`.
patchLookupdynamic—Patch lookup value supplied to `UP_ParseTextureLump`.

View source

UP_PixelAt

inline function UP_PixelAt(src, w, h, x, y)

Reads a clamped source pixel.

ParameterTypeDefaultDescription
srcdynamic—Src value supplied to `UP_PixelAt`.
wdynamic—W value supplied to `UP_PixelAt`.
hdynamic—H value supplied to `UP_PixelAt`.
xdynamic—Horizontal map- or screen-space coordinate.
ydynamic—Vertical map- or screen-space coordinate.

View source

UP_ReadS16

inline function UP_ReadS16(b, off)

Reads a little-endian s16.

ParameterTypeDefaultDescription
bdynamic—Second input operand.
offdynamic—Zero-based byte or element offset.

View source

UP_ReadS32

inline function UP_ReadS32(b, off)

Reads a little-endian s32.

ParameterTypeDefaultDescription
bdynamic—Second input operand.
offdynamic—Zero-based byte or element offset.

View source

UP_ReadU16

inline function UP_ReadU16(b, off)

Reads a little-endian u16.

ParameterTypeDefaultDescription
bdynamic—Second input operand.
offdynamic—Zero-based byte or element offset.

View source

UP_ReadU32

inline function UP_ReadU32(b, off)

Reads a little-endian u32.

ParameterTypeDefaultDescription
bdynamic—Second input operand.
offdynamic—Zero-based byte or element offset.

View source

UP_ReportProgress

inline function UP_ReportProgress(units)

Reports one or more HDWAD generation units to the frontend progress display.

ParameterTypeDefaultDescription
unitsdynamic—Units value supplied to `UP_ReportProgress`.

View source

UP_SimilarColor

inline function UP_SimilarColor(pal, a, b, hasAlpha)

Evaluates xBRZ-style color equality with a distance threshold.

ParameterTypeDefaultDescription
paldynamic—Pal value supplied to `UP_SimilarColor`.
adynamic—First input operand.
bdynamic—Second input operand.
hasAlphadynamic—Whether has alpha holds.

View source

UP_SimilarColorCached

inline function UP_SimilarColorCached(pal, cache, a, b, hasAlpha)

Evaluates xBRZ-style equality using the per-image distance cache.

ParameterTypeDefaultDescription
paldynamic—Pal value supplied to `UP_SimilarColorCached`.
cachedynamic—Cache value supplied to `UP_SimilarColorCached`.
adynamic—First input operand.
bdynamic—Second input operand.
hasAlphadynamic—Whether has alpha holds.

View source

UP_StrongEdgeWeight

inline function UP_StrongEdgeWeight(pal, base, edge, hasAlpha)

Chooses a slightly stronger blend for hard pixel-art edges.

ParameterTypeDefaultDescription
paldynamic—Pal value supplied to `UP_StrongEdgeWeight`.
basedynamic—Base value supplied to `UP_StrongEdgeWeight`.
edgedynamic—Edge value supplied to `UP_StrongEdgeWeight`.
hasAlphadynamic—Whether has alpha holds.

View source

UP_StrongEdgeWeightCached

inline function UP_StrongEdgeWeightCached(pal, cache, base, edge, hasAlpha)

Chooses blend strength using cached palette distances.

ParameterTypeDefaultDescription
paldynamic—Pal value supplied to `UP_StrongEdgeWeightCached`.
cachedynamic—Cache value supplied to `UP_StrongEdgeWeightCached`.
basedynamic—Base value supplied to `UP_StrongEdgeWeightCached`.
edgedynamic—Edge value supplied to `UP_StrongEdgeWeightCached`.
hasAlphadynamic—Whether has alpha holds.

View source

up_texpatch_t struct

up_texture_t struct

UP_ToIntOr

function UP_ToIntOr(v, fallback)

Converts a value to int with fallback.

ParameterTypeDefaultDescription
vdynamic—Value consumed by the operation.
fallbackdynamic—Value returned when the requested conversion or lookup is unavailable.

View source

UP_TRANSPARENT_INDEX

const UP_TRANSPARENT_INDEX = 255

Defines up transparent index for the hdwad builder subsystem.

View source

UP_TYPE_FLAT

const UP_TYPE_FLAT = 2

Defines up type flat for the hdwad builder subsystem.

View source

UP_TYPE_PATCH

const UP_TYPE_PATCH = 1

Defines up type patch for the hdwad builder subsystem.

View source

UP_TYPE_SPRITE

const UP_TYPE_SPRITE = 4

Defines up type sprite for the hdwad builder subsystem.

View source

UP_TYPE_TEXTURE

const UP_TYPE_TEXTURE = 3

Defines up type texture for the hdwad builder subsystem.

View source

UP_VERSION

const UP_VERSION = 6

Defines up version for the hdwad builder subsystem.

View source

UP_WriteHDWADPackage

function UP_WriteHDWADPackage(path, wadData, lumps, images, scale)

Emits a complete HDWAD containing original lumps and upscaled images by delegating with no synthetic lumps.

ParameterTypeDefaultDescription
pathdynamic—Filesystem path to process.
wadDatadynamic—Wad data value supplied to `UP_WriteHDWADPackage`.
lumpsdynamic—Lumps value supplied to `UP_WriteHDWADPackage`.
imagesdynamic—Images value supplied to `UP_WriteHDWADPackage`.
scaledynamic—Scale value supplied to `UP_WriteHDWADPackage`.

View source

UP_WriteHDWADPackageWithExtraLumps

function UP_WriteHDWADPackageWithExtraLumps(path, wadData, lumps, images, extraNames, extraDatas, scale)

Lays out an HDWAD header, original and synthetic lump payloads, image payloads, and both directories before saving atomically.

ParameterTypeDefaultDescription
pathdynamic—Filesystem path to process.
wadDatadynamic—Wad data value supplied to `UP_WriteHDWADPackageWithExtraLumps`.
lumpsdynamic—Lumps value supplied to `UP_WriteHDWADPackageWithExtraLumps`.
imagesdynamic—Images value supplied to `UP_WriteHDWADPackageWithExtraLumps`.
extraNamesdynamic—Extra names value supplied to `UP_WriteHDWADPackageWithExtraLumps`.
extraDatasdynamic—Extra datas value supplied to `UP_WriteHDWADPackageWithExtraLumps`.
scaledynamic—Scale value supplied to `UP_WriteHDWADPackageWithExtraLumps`.

View source

UP_WritePackage

function UP_WritePackage(path, images, scale)

Writes extracted images as a MiniDoom upscaled package.

ParameterTypeDefaultDescription
pathdynamic—Filesystem path to process.
imagesdynamic—Images value supplied to `UP_WritePackage`.
scaledynamic—Scale value supplied to `UP_WritePackage`.

View source

UP_WriteU32

inline function UP_WriteU32(b, off, value)

Writes a little-endian u32.

ParameterTypeDefaultDescription
bdynamic—Second input operand.
offdynamic—Zero-based byte or element offset.
valuedynamic—Value consumed by the operation.

View source

UP_XBRZ_BLEND_DOMINANT

const UP_XBRZ_BLEND_DOMINANT = 2

Defines up xbrz blend dominant for the hdwad builder subsystem.

View source

UP_XBRZ_BLEND_NONE

const UP_XBRZ_BLEND_NONE = 0

Defines up xbrz blend none for the hdwad builder subsystem.

View source

UP_XBRZ_BLEND_NORMAL

const UP_XBRZ_BLEND_NORMAL = 1

Defines up xbrz blend normal for the hdwad builder subsystem.

View source

UP_XBRZ_DIST_LIMIT

const UP_XBRZ_DIST_LIMIT = 4200

Defines up xbrz dist limit for the hdwad builder subsystem.

View source

UP_XBRZ_DOMINANT_DIRECTION_THRESHOLD

const UP_XBRZ_DOMINANT_DIRECTION_THRESHOLD = 3.6

Defines up xbrz dominant direction threshold for the hdwad builder subsystem.

View source

UP_XBRZ_EQUAL_COLOR_TOLERANCE

const UP_XBRZ_EQUAL_COLOR_TOLERANCE = 30.

Defines the Doom palette selection for up xbrz equal color tolerance.

View source

UP_XBRZ_STEEP_DIRECTION_THRESHOLD

const UP_XBRZ_STEEP_DIRECTION_THRESHOLD = 2.2

Defines up xbrz steep direction threshold for the hdwad builder subsystem.

View source

UP_XbrzBlendCorner3

function UP_XbrzBlendCorner3(dst, dw, blockX, blockY, rot, col, pal, blendCache, hasAlpha)

Controls xbrz Blend Corner3 transitions in the HDWAD builder system.

ParameterTypeDefaultDescription
dstdynamic—Dst value supplied to `UP_XbrzBlendCorner3`.
dwdynamic—Dw value supplied to `UP_XbrzBlendCorner3`.
blockXdynamic—Horizontal coordinate or vector component represented by block x.
blockYdynamic—Vertical coordinate or vector component represented by block y.
rotdynamic—Rot value supplied to `UP_XbrzBlendCorner3`.
coldynamic—Col value supplied to `UP_XbrzBlendCorner3`.
paldynamic—Pal value supplied to `UP_XbrzBlendCorner3`.
blendCachedynamic—Blend cache value supplied to `UP_XbrzBlendCorner3`.
hasAlphadynamic—Whether has alpha holds.

View source

UP_XbrzBlendLineDiagonal3

function UP_XbrzBlendLineDiagonal3(dst, dw, blockX, blockY, rot, col, pal, blendCache, hasAlpha)

Applies the xBRZ 3x diagonal-edge weights to the two adjacent cells and corner cell.

ParameterTypeDefaultDescription
dstdynamic—Dst value supplied to `UP_XbrzBlendLineDiagonal3`.
dwdynamic—Dw value supplied to `UP_XbrzBlendLineDiagonal3`.
blockXdynamic—Horizontal coordinate or vector component represented by block x.
blockYdynamic—Vertical coordinate or vector component represented by block y.
rotdynamic—Rot value supplied to `UP_XbrzBlendLineDiagonal3`.
coldynamic—Col value supplied to `UP_XbrzBlendLineDiagonal3`.
paldynamic—Pal value supplied to `UP_XbrzBlendLineDiagonal3`.
blendCachedynamic—Blend cache value supplied to `UP_XbrzBlendLineDiagonal3`.
hasAlphadynamic—Whether has alpha holds.

View source

UP_XbrzBlendLineShallow3

function UP_XbrzBlendLineShallow3(dst, dw, blockX, blockY, rot, col, pal, blendCache, hasAlpha)

Applies the xBRZ 3x shallow-edge coverage pattern with weighted blends and one fully replaced corner pixel.

ParameterTypeDefaultDescription
dstdynamic—Dst value supplied to `UP_XbrzBlendLineShallow3`.
dwdynamic—Dw value supplied to `UP_XbrzBlendLineShallow3`.
blockXdynamic—Horizontal coordinate or vector component represented by block x.
blockYdynamic—Vertical coordinate or vector component represented by block y.
rotdynamic—Rot value supplied to `UP_XbrzBlendLineShallow3`.
coldynamic—Col value supplied to `UP_XbrzBlendLineShallow3`.
paldynamic—Pal value supplied to `UP_XbrzBlendLineShallow3`.
blendCachedynamic—Blend cache value supplied to `UP_XbrzBlendLineShallow3`.
hasAlphadynamic—Whether has alpha holds.

View source

UP_XbrzBlendLineSteep3

function UP_XbrzBlendLineSteep3(dst, dw, blockX, blockY, rot, col, pal, blendCache, hasAlpha)

Applies the rotated xBRZ 3x steep-edge coverage pattern to the current destination block.

ParameterTypeDefaultDescription
dstdynamic—Dst value supplied to `UP_XbrzBlendLineSteep3`.
dwdynamic—Dw value supplied to `UP_XbrzBlendLineSteep3`.
blockXdynamic—Horizontal coordinate or vector component represented by block x.
blockYdynamic—Vertical coordinate or vector component represented by block y.
rotdynamic—Rot value supplied to `UP_XbrzBlendLineSteep3`.
coldynamic—Col value supplied to `UP_XbrzBlendLineSteep3`.
paldynamic—Pal value supplied to `UP_XbrzBlendLineSteep3`.
blendCachedynamic—Blend cache value supplied to `UP_XbrzBlendLineSteep3`.
hasAlphadynamic—Whether has alpha holds.

View source

UP_XbrzBlendLineSteepAndShallow3

function UP_XbrzBlendLineSteepAndShallow3(dst, dw, blockX, blockY, rot, col, pal, blendCache, hasAlpha)

Applies the combined xBRZ 3x corner pattern when both steep and shallow edge tests succeed.

ParameterTypeDefaultDescription
dstdynamic—Dst value supplied to `UP_XbrzBlendLineSteepAndShallow3`.
dwdynamic—Dw value supplied to `UP_XbrzBlendLineSteepAndShallow3`.
blockXdynamic—Horizontal coordinate or vector component represented by block x.
blockYdynamic—Vertical coordinate or vector component represented by block y.
rotdynamic—Rot value supplied to `UP_XbrzBlendLineSteepAndShallow3`.
coldynamic—Col value supplied to `UP_XbrzBlendLineSteepAndShallow3`.
paldynamic—Pal value supplied to `UP_XbrzBlendLineSteepAndShallow3`.
blendCachedynamic—Blend cache value supplied to `UP_XbrzBlendLineSteepAndShallow3`.
hasAlphadynamic—Whether has alpha holds.

View source

UP_XbrzBlendPixel3

function UP_XbrzBlendPixel3(dst, dw, blockX, blockY, blendInfo, rot, pal, distCache, blendCache, hasAlpha, a0, b0, c0, d0, e0, f0, g0, h0, i0)

Controls xbrz Blend Pixel3 transitions in the HDWAD builder system.

ParameterTypeDefaultDescription
dstdynamic—Dst value supplied to `UP_XbrzBlendPixel3`.
dwdynamic—Dw value supplied to `UP_XbrzBlendPixel3`.
blockXdynamic—Horizontal coordinate or vector component represented by block x.
blockYdynamic—Vertical coordinate or vector component represented by block y.
blendInfodynamic—Blend info value supplied to `UP_XbrzBlendPixel3`.
rotdynamic—Rot value supplied to `UP_XbrzBlendPixel3`.
paldynamic—Pal value supplied to `UP_XbrzBlendPixel3`.
distCachedynamic—Dist cache value supplied to `UP_XbrzBlendPixel3`.
blendCachedynamic—Blend cache value supplied to `UP_XbrzBlendPixel3`.
hasAlphadynamic—Whether has alpha holds.
a0dynamic—A0 value supplied to `UP_XbrzBlendPixel3`.
b0dynamic—B0 value supplied to `UP_XbrzBlendPixel3`.
c0dynamic—C0 value supplied to `UP_XbrzBlendPixel3`.
d0dynamic—D0 value supplied to `UP_XbrzBlendPixel3`.
e0dynamic—E0 value supplied to `UP_XbrzBlendPixel3`.
f0dynamic—F0 value supplied to `UP_XbrzBlendPixel3`.
g0dynamic—G0 value supplied to `UP_XbrzBlendPixel3`.
h0dynamic—H0 value supplied to `UP_XbrzBlendPixel3`.
i0dynamic—I0 value supplied to `UP_XbrzBlendPixel3`.

View source

UP_XbrzBlendRef3

function UP_XbrzBlendRef3(dst, dw, blockX, blockY, rot, i, j, col, pal, blendCache, hasAlpha, ratioCode)

Controls xbrz Blend Ref3 transitions in the HDWAD builder system.

ParameterTypeDefaultDescription
dstdynamic—Dst value supplied to `UP_XbrzBlendRef3`.
dwdynamic—Dw value supplied to `UP_XbrzBlendRef3`.
blockXdynamic—Horizontal coordinate or vector component represented by block x.
blockYdynamic—Vertical coordinate or vector component represented by block y.
rotdynamic—Rot value supplied to `UP_XbrzBlendRef3`.
idynamic—Zero-based iteration index.
jdynamic—Secondary zero-based iteration index.
coldynamic—Col value supplied to `UP_XbrzBlendRef3`.
paldynamic—Pal value supplied to `UP_XbrzBlendRef3`.
blendCachedynamic—Blend cache value supplied to `UP_XbrzBlendRef3`.
hasAlphadynamic—Whether has alpha holds.
ratioCodedynamic—Ratio code value supplied to `UP_XbrzBlendRef3`.

View source

UP_XbrzDistanceCached

function UP_XbrzDistanceCached(pal, cache, a, b, hasAlpha)

Computes the palette distance used by the original xBRZ rules.

ParameterTypeDefaultDescription
paldynamic—Pal value supplied to `UP_XbrzDistanceCached`.
cachedynamic—Cache value supplied to `UP_XbrzDistanceCached`.
adynamic—First input operand.
bdynamic—Second input operand.
hasAlphadynamic—Whether has alpha holds.

View source

UP_XbrzEq

inline function UP_XbrzEq(pal, cache, a, b, hasAlpha)

Tests palette equality using xBRZ's perceptual tolerance.

ParameterTypeDefaultDescription
paldynamic—Pal value supplied to `UP_XbrzEq`.
cachedynamic—Cache value supplied to `UP_XbrzEq`.
adynamic—First input operand.
bdynamic—Second input operand.
hasAlphadynamic—Whether has alpha holds.

View source

UP_XbrzGetBottomL

inline function UP_XbrzGetBottomL(b)

Extracts the two-bit bottom-left corner blend classification from a packed xBRZ blend byte.

ParameterTypeDefaultDescription
bdynamic—Second input operand.

View source

UP_XbrzGetBottomR

inline function UP_XbrzGetBottomR(b)

Extracts the two-bit bottom-right corner blend classification from a packed xBRZ blend byte.

ParameterTypeDefaultDescription
bdynamic—Second input operand.

View source

UP_XbrzGetTopL

inline function UP_XbrzGetTopL(b)

Extracts the two-bit top-left corner blend classification from a packed xBRZ blend byte.

ParameterTypeDefaultDescription
bdynamic—Second input operand.

View source

UP_XbrzGetTopR

inline function UP_XbrzGetTopR(b)

Extracts the two-bit top-right corner blend classification from a packed xBRZ blend byte.

ParameterTypeDefaultDescription
bdynamic—Second input operand.

View source

UP_XbrzPreProcessCorners

function UP_XbrzPreProcessCorners(pal, cache, a, b, c, d, e, f, g, h, ii, j, k, l, m, n, o, p, hasAlpha)

Compares color-distance paths through a 4x4 neighborhood and classifies normal or dominant edge blends for the central corners.

ParameterTypeDefaultDescription
paldynamic—Pal value supplied to `UP_XbrzPreProcessCorners`.
cachedynamic—Cache value supplied to `UP_XbrzPreProcessCorners`.
adynamic—First input operand.
bdynamic—Second input operand.
cdynamic—C value supplied to `UP_XbrzPreProcessCorners`.
ddynamic—Divisor or direction value used by the operation.
edynamic—E value supplied to `UP_XbrzPreProcessCorners`.
fdynamic—F value supplied to `UP_XbrzPreProcessCorners`.
gdynamic—G value supplied to `UP_XbrzPreProcessCorners`.
hdynamic—H value supplied to `UP_XbrzPreProcessCorners`.
iidynamic—Ii value supplied to `UP_XbrzPreProcessCorners`.
jdynamic—Secondary zero-based iteration index.
kdynamic—K value supplied to `UP_XbrzPreProcessCorners`.
ldynamic—L value supplied to `UP_XbrzPreProcessCorners`.
mdynamic—M value supplied to `UP_XbrzPreProcessCorners`.
ndynamic—Number of values to process.
odynamic—O value supplied to `UP_XbrzPreProcessCorners`.
pdynamic—Object or data record consumed by the operation.
hasAlphadynamic—Whether has alpha holds.

View source

UP_XbrzRefIndex3

function UP_XbrzRefIndex3(dw, blockX, blockY, rot, i, j)

Rotates a 3x3 xBRZ neighbor coordinate and returns its linear index in the source image.

ParameterTypeDefaultDescription
dwdynamic—Dw value supplied to `UP_XbrzRefIndex3`.
blockXdynamic—Horizontal coordinate or vector component represented by block x.
blockYdynamic—Vertical coordinate or vector component represented by block y.
rotdynamic—Rot value supplied to `UP_XbrzRefIndex3`.
idynamic—Zero-based iteration index.
jdynamic—Secondary zero-based iteration index.

View source

UP_XbrzRotateBlendInfo

function UP_XbrzRotateBlendInfo(b, rot)

Controls xbrz Rotate Blend Info transitions in the HDWAD builder system.

ParameterTypeDefaultDescription
bdynamic—Second input operand.
rotdynamic—Rot value supplied to `UP_XbrzRotateBlendInfo`.

View source

UP_XbrzRotGet

function UP_XbrzRotGet(rot, pos, a, b, c, d, e, f, g, h, ii)

Returns a 3x3 neighborhood sample through a requested quarter-turn so one blend kernel handles all four orientations.

ParameterTypeDefaultDescription
rotdynamic—Rot value supplied to `UP_XbrzRotGet`.
posdynamic—Pos value supplied to `UP_XbrzRotGet`.
adynamic—First input operand.
bdynamic—Second input operand.
cdynamic—C value supplied to `UP_XbrzRotGet`.
ddynamic—Divisor or direction value used by the operation.
edynamic—E value supplied to `UP_XbrzRotGet`.
fdynamic—F value supplied to `UP_XbrzRotGet`.
gdynamic—G value supplied to `UP_XbrzRotGet`.
hdynamic—H value supplied to `UP_XbrzRotGet`.
iidynamic—Ii value supplied to `UP_XbrzRotGet`.

View source

UP_XbrzScaleIndexed

function UP_XbrzScaleIndexed(img, scale, pal)

Scales an indexed image with palette-aware xBRZ-style edge reconstruction.

ParameterTypeDefaultDescription
imgdynamic—Img value supplied to `UP_XbrzScaleIndexed`.
scaledynamic—Scale value supplied to `UP_XbrzScaleIndexed`.
paldynamic—Pal value supplied to `UP_XbrzScaleIndexed`.

View source

UP_XbrzScaleIndexed3

function UP_XbrzScaleIndexed3(img, pal)

Upscales one indexed image by exactly 3x using cached palette distances, preclassified corners, and rotation-invariant xBRZ edge blending.

ParameterTypeDefaultDescription
imgdynamic—Img value supplied to `UP_XbrzScaleIndexed3`.
paldynamic—Pal value supplied to `UP_XbrzScaleIndexed3`.

View source

UP_XbrzSetBottomL

inline function UP_XbrzSetBottomL(b, bt)

Adds a bottom-left two-bit classification to a packed xBRZ blend byte.

ParameterTypeDefaultDescription
bdynamic—Second input operand.
btdynamic—Bt value supplied to `UP_XbrzSetBottomL`.

View source

UP_XbrzSetBottomR

inline function UP_XbrzSetBottomR(b, bt)

Adds a bottom-right two-bit classification to a packed xBRZ blend byte.

ParameterTypeDefaultDescription
bdynamic—Second input operand.
btdynamic—Bt value supplied to `UP_XbrzSetBottomR`.

View source

UP_XbrzSetRef3

inline function UP_XbrzSetRef3(dst, dw, blockX, blockY, rot, i, j, col)

Writes one output color to a rotation-relative cell of the current 3x3 destination block.

ParameterTypeDefaultDescription
dstdynamic—Dst value supplied to `UP_XbrzSetRef3`.
dwdynamic—Dw value supplied to `UP_XbrzSetRef3`.
blockXdynamic—Horizontal coordinate or vector component represented by block x.
blockYdynamic—Vertical coordinate or vector component represented by block y.
rotdynamic—Rot value supplied to `UP_XbrzSetRef3`.
idynamic—Zero-based iteration index.
jdynamic—Secondary zero-based iteration index.
coldynamic—Col value supplied to `UP_XbrzSetRef3`.

View source

UP_XbrzSetTopL

inline function UP_XbrzSetTopL(b, bt)

Adds a top-left two-bit classification to a packed xBRZ blend byte.

ParameterTypeDefaultDescription
bdynamic—Second input operand.
btdynamic—Bt value supplied to `UP_XbrzSetTopL`.

View source

UP_XbrzSetTopR

inline function UP_XbrzSetTopR(b, bt)

Adds a top-right two-bit classification to a packed xBRZ blend byte.

ParameterTypeDefaultDescription
bdynamic—Second input operand.
btdynamic—Bt value supplied to `UP_XbrzSetTopR`.

View source