Re: Freeform map edges (in trunk since 15190)
Posted: 21 Jan 2009 12:33
congratulations
The place to talk about Transport Tycoon
https://www.tt-forums.net/
uhm... huh?Sapphire united wrote:push through to 6.4!
Poor you... You still fail to understand how it worksSapphire united wrote:push through to 6.4!
Code: Select all
static inline uint TileHeightOutsideMap(int x, int y)
{
if (x < 1) {
if (y < 1) {
return TileHeight(TileXY(1, 1));
} else if (y < (int)MapMaxY()) {
return TileHeight(TileXY(1, y));
} else {
return TileHeight(TileXY(1, (int)MapMaxY()));
}
} else if (x < (int)MapMaxX()) {
if (y < 1) {
return TileHeight(TileXY(x, 1));
} else if (y < (int)MapMaxY()) {
return TileHeight(TileXY(x, y));
} else {
return TileHeight(TileXY(x, (int)MapMaxY()));
}
} else {
if (y < 1) {
return TileHeight(TileXY((int)MapMaxX(), 1));
} else if (y < (int)MapMaxY()) {
return TileHeight(TileXY((int)MapMaxX(), y));
} else {
return TileHeight(TileXY((int)MapMaxX(), (int)MapMaxY()));
}
}
}
Code: Select all
} else {
// We are outside the map => paint black
tile_info.tile = 0;
tile_info.tileh = GetTileSlopeOutsideMap(tile_info.x, tile_info.y, &tile_info.z);
tile_type = MP_VOID;
}
Code: Select all
} else {
if (!_settings_game.construction.freeform_edges || (TileX(tile) != 0 && TileY(tile) != 0)) {
if (x_cur == ((int)MapMaxX() - 1) * TILE_SIZE || y_cur == ((int)MapMaxY() - 1) * TILE_SIZE) {
uint maxh = max<uint>(TileHeight(tile), 1);
for (uint h = 0; h < maxh; h++) {
DrawGroundSpriteAt(SPR_SHADOW_CELL, PAL_NONE, ti.x, ti.y, h * TILE_HEIGHT);
}
}
ti.tile = tile;
ti.tileh = GetTileSlope(tile, &ti.z);
tt = GetTileType(tile);
}
}
Have you already tried if this works? It would by far be the simplest solution.ic111 wrote:So you simply paint: For each tile in the black area, one black tile per height level of that tile. I don't think that painting that many images is resonable with more height levels.
Unfortunatly I don't think I can, the code to fix this in the freeform map edges patch was written by SmatZ.So: Can anyone help solving the problem I described above?
I thought it only does that for the tiles at the south edge, so only for tiles with coordinates (MaxX, ?) and (?, MaxY). If that's true, it isn't a problem at all to do that for some more heightlevels.ic111 wrote:First thanks for your answer, although you couldn't give me the informations I need.
Well, I mainly meant resonable in terms of efficiency. If I get it right, the freeform edges algorithm would paint <heightlevel> images for each black tile?
Code: Select all
10 * 3 05 18 01
11 * 257 00 99 99 99 99 99 . . . 99 (256 times "99")