# HG changeset patch # User tron # Date 1108761655 0 # Node ID 06ef4fb5bb1aa6ee7a72274fb611eac58e21a80c # Parent ea1505a974f99594ba9de4a00c888a7bb5d8a5fd (svn r1888) The landscape template sprites are ordinary sprites, treating them as non-sprites resulted in yet another endianess issue. This fixes the problem introduced in r1855 diff -r ea1505a974f9 -r 06ef4fb5bb1a landscape.c --- a/landscape.c Fri Feb 18 08:49:04 2005 +0000 +++ b/landscape.c Fri Feb 18 21:20:55 2005 +0000 @@ -474,12 +474,13 @@ uint y; uint w; uint h; + const Sprite* template; const byte *p; byte *tile; byte direction; r = Random(); - p = GetNonSprite((((r >> 24) * _genterrain_tbl_1[type]) >> 8) + _genterrain_tbl_2[type] + 4845); + template = GetSprite((((r >> 24) * _genterrain_tbl_1[type]) >> 8) + _genterrain_tbl_2[type] + 4845); x = r & MapMaxX(); y = (r >> MapLogX()) & MapMaxY(); @@ -490,13 +491,13 @@ direction = (r >> 22) & 3; if (direction & 1) { - w = p[1]; - h = p[2]; + w = template->height; + h = template->width; } else { - w = p[2]; - h = p[1]; + w = template->width; + h = template->height; } - p += 8; + p = template->data; if (flag & 4) { uint xw = x * MapSizeY();