REDIVIVUS

Proposals / #1367

Make the paired bounded text renderer return void

checked · by eejitgames · submitted 2026-11-06

The void* result of D2WINFONT_DrawWideStringRightToLeft is an artifact of leftover EAX values, not a last-glyph contract. Full Windows and Mac bodies leave different values on empty, glyph, newline and color-code paths. In particular, Windows can return a multiplication residue and Mac can return a pixel coordinate or palette number. Each has one executable caller, which discards EAX; Mac's extra DATA reference is in __LINKEDIT. Set only the result to void in both builds, retaining all six parameters and each calling convention. The existing last-glyph comment is contradicted by these native paths.

Changes 2, applied together

  1. Set prototype win 0x00501fe0

    signaturevoid * D2WINFONT_DrawWideStringRightToLeft(WCHAR * wszText, int32_t nXStart, int32_t nY, GLOBALPALLETE eGlobalPalette, uint32_t nLeftBound, uint32_t nRightBound)→void D2WINFONT_DrawWideStringRightToLeft(WCHAR * wszText, int32_t nXStart, int32_t nY, GLOBALPALLETE eGlobalPalette, uint32_t nLeftBound, uint32_t nRightBound)
    convention__fastcall
  2. Set prototype mac 0x00047bd0

    signaturevoid * D2WINFONT_DrawWideStringRightToLeft(WCHAR * wszText, int32_t nXStart, int32_t nY, GLOBALPALLETE eGlobalPalette, uint32_t nLeftBound, uint32_t nRightBound)→void D2WINFONT_DrawWideStringRightToLeft(WCHAR * wszText, int32_t nXStart, int32_t nY, GLOBALPALLETE eGlobalPalette, uint32_t nLeftBound, uint32_t nRightBound)
    convention__cdecl