isle-portable/LEGO1/lego/sources
Christian Semmler 5d9f92a029
Rescale save-loaded textures to runtime texture dimensions
`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.
2026-05-14 18:12:36 -07:00
..
3dmanager Merge remote-tracking branch 'isle/master' 2026-03-14 16:48:49 -07:00
anim Anim presenters (#1719) 2026-01-13 21:54:44 +01:00
geom Beta matches on LegoEdge and others, LegoPathActor improvements (#1743) 2026-02-14 17:50:15 +01:00
misc Rescale save-loaded textures to runtime texture dimensions 2026-05-14 18:12:36 -07:00
roi Merge remote-tracking branch 'isle/master' 2026-01-07 16:39:54 -07:00
shape Merge remote-tracking branch 'isle/master' 2026-01-07 16:39:54 -07:00