(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
This commit is contained in:
		
							
								
								
									
										13
									
								
								landscape.c
									
									
									
									
									
								
							
							
						
						
									
										13
									
								
								landscape.c
									
									
									
									
									
								
							@@ -474,12 +474,13 @@ static void GenerateTerrain(int type, int flag)
 | 
				
			|||||||
	uint y;
 | 
						uint y;
 | 
				
			||||||
	uint w;
 | 
						uint w;
 | 
				
			||||||
	uint h;
 | 
						uint h;
 | 
				
			||||||
 | 
						const Sprite* template;
 | 
				
			||||||
	const byte *p;
 | 
						const byte *p;
 | 
				
			||||||
	byte *tile;
 | 
						byte *tile;
 | 
				
			||||||
	byte direction;
 | 
						byte direction;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	r = Random();
 | 
						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();
 | 
						x = r & MapMaxX();
 | 
				
			||||||
	y = (r >> MapLogX()) & MapMaxY();
 | 
						y = (r >> MapLogX()) & MapMaxY();
 | 
				
			||||||
@@ -490,13 +491,13 @@ static void GenerateTerrain(int type, int flag)
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
	direction = (r >> 22) & 3;
 | 
						direction = (r >> 22) & 3;
 | 
				
			||||||
	if (direction & 1) {
 | 
						if (direction & 1) {
 | 
				
			||||||
		w = p[1];
 | 
							w = template->height;
 | 
				
			||||||
		h = p[2];
 | 
							h = template->width;
 | 
				
			||||||
	} else {
 | 
						} else {
 | 
				
			||||||
		w = p[2];
 | 
							w = template->width;
 | 
				
			||||||
		h = p[1];
 | 
							h = template->height;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	p += 8;
 | 
						p = template->data;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (flag & 4) {
 | 
						if (flag & 4) {
 | 
				
			||||||
		uint xw = x * MapSizeY();
 | 
							uint xw = x * MapSizeY();
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user