mirror of
https://github.com/isledecomp/isle-portable.git
synced 2026-06-17 15:14:09 +00:00
`LegoTextureInfo::LoadBits` sized its memcpy from the destination DirectDraw surface and assumed the source bits matched. They don't when the save was made under a different renderer than the current one: HW mode squares non-square assets in `LegoImage::Read` (e.g. 128x32 -> 128x128 via row duplication), SW mode keeps the original dimensions, and `ReadNamedTexture` always loads with `p_square=0`, so saved bits keep whatever size they had at save time. SW save loaded under HW caused an OOB read in `LoadBits`; HW save loaded under SW silently truncated the source and rendered a distorted texture. Add `LegoImage::Resize(width, height)` (nearest-neighbor, handles both up- and down-scale) and call it in `LoadFromNamedTexture` to match the runtime `LegoTextureInfo` surface dimensions before binding. Save format unchanged; `LoadBits` signature unchanged. Square textures and matching-mode loads short-circuit on the fast-path. |
||
|---|---|---|
| .. | ||
| lego | ||
| modeldb | ||
| mxdirectx | ||
| mxgeometry | ||
| mxstl | ||
| omni | ||
| realtime | ||
| res | ||
| tgl | ||
| viewmanager | ||
| cursor.h | ||
| define.cpp | ||
| define.h | ||
| lego1_export.h | ||
| lego1_pch.h | ||
| library_msvc.h | ||
| library_smack.h | ||
| library_smartheap.h | ||
| main.cpp | ||