mirror of https://github.com/OpenTTD/OpenTTD
(svn r51) Yet another slope graphics fix
parent
b7e14169f8
commit
b3cdae2af1
11
landscape.c
11
landscape.c
|
@ -246,14 +246,17 @@ bool hasFoundation(TileInfo *ti, bool direction)
|
||||||
{
|
{
|
||||||
bool south, other; // southern corner and east/west corner
|
bool south, other; // southern corner and east/west corner
|
||||||
uint slope = _tile_type_procs[ti->type]->get_slope_tileh_proc(ti);
|
uint slope = _tile_type_procs[ti->type]->get_slope_tileh_proc(ti);
|
||||||
south = ((ti->tileh) & 2) != (slope & 2);
|
uint tileh = ti->tileh;
|
||||||
|
|
||||||
|
if(slope==0 && slope!=tileh) tileh=15;
|
||||||
|
south = (tileh & 2) != (slope & 2);
|
||||||
|
|
||||||
if(direction)
|
if(direction)
|
||||||
other = ((ti->tileh) & 4) != (slope & 4);
|
other = (tileh & 4) != (slope & 4);
|
||||||
else
|
else
|
||||||
other = ((ti->tileh) & 1) != (slope & 1);
|
other = (tileh & 1) != (slope & 1);
|
||||||
|
|
||||||
return south || other;
|
return south || other;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void DrawFoundation(TileInfo *ti, uint f)
|
void DrawFoundation(TileInfo *ti, uint f)
|
||||||
|
|
|
@ -132,28 +132,32 @@ static const SpriteID _landscape_spriteindexes_3[] = {
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/* Slope graphics indexes temperate climate */
|
/* Slope graphics indexes temperate climate
|
||||||
|
Skip first 3 sprites and only load the proper set */
|
||||||
static const SpriteID _slopes_spriteindexes_0[] = {
|
static const SpriteID _slopes_spriteindexes_0[] = {
|
||||||
0xfffe, 3,
|
0xfffe, 3,
|
||||||
SPR_SLOPES_BASE, SPR_SLOPES_BASE+73,
|
SPR_SLOPES_BASE, SPR_SLOPES_BASE+73,
|
||||||
0xffff,
|
0xffff,
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Slope graphics indexes arctic climate */
|
/* Slope graphics indexes arctic climate
|
||||||
|
Skip first 79 sprites and only load the proper set */
|
||||||
static const SpriteID _slopes_spriteindexes_1[] = {
|
static const SpriteID _slopes_spriteindexes_1[] = {
|
||||||
0xfffe, 79,
|
0xfffe, 79,
|
||||||
SPR_SLOPES_BASE, SPR_SLOPES_BASE+73,
|
SPR_SLOPES_BASE, SPR_SLOPES_BASE+73,
|
||||||
0xffff,
|
0xffff,
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Slope graphics indexes tropical climate */
|
/* Slope graphics indexes tropical climate
|
||||||
|
Skip first 155 sprites and only load the proper set */
|
||||||
static const SpriteID _slopes_spriteindexes_2[] = {
|
static const SpriteID _slopes_spriteindexes_2[] = {
|
||||||
0xfffe, 155,
|
0xfffe, 155,
|
||||||
SPR_SLOPES_BASE, SPR_SLOPES_BASE+73,
|
SPR_SLOPES_BASE, SPR_SLOPES_BASE+73,
|
||||||
0xffff,
|
0xffff,
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Slope graphics indexes toyland climate */
|
/* Slope graphics indexes toyland climate
|
||||||
|
Skip first 231 sprites and only load the proper set */
|
||||||
static const SpriteID _slopes_spriteindexes_3[] = {
|
static const SpriteID _slopes_spriteindexes_3[] = {
|
||||||
0xfffe, 231,
|
0xfffe, 231,
|
||||||
SPR_SLOPES_BASE, SPR_SLOPES_BASE+73,
|
SPR_SLOPES_BASE, SPR_SLOPES_BASE+73,
|
||||||
|
|
Loading…
Reference in New Issue