Fixed the glitch which would occur on some maps...

...in the top right corner and bottom left corner, these tiles were
rendered as void instead of a normal terrain.
This commit is contained in:
Mark de Wever 2007-08-14 07:31:48 +00:00
parent 72eac609b0
commit 599e80f039
3 changed files with 27 additions and 2 deletions

View file

@ -47,6 +47,9 @@ Version 1.3.6+svn:
incorrect scale update when zooming.
* improve footsteps : better beginning, angles and end, reduce
cpu cost, fix incorrect left-right sequences and clean some images
* fixed the glitch which would occur on some maps in the top right
corner and bottom left corner, these tiles were rendered as void
instead of a normal terrain.
* map editor:
* the grid is scaled properly again and no longer shown in the offmap area
* user interface:

View file

@ -11,6 +11,7 @@ Version 1.3.6+svn:
* Fixed bug in Anita's death event where Tallin speaks instead of her.
* Fixed bug in 'Old Friend' where Rakshas' portrait doesn't appear.
* Balancing and text changes in 'Old Friend'
* Multiplayer
* New map: Mokena Prairie.
* Revised maps: Hamlets, Meteor Lake, 4p Hamlets.
@ -34,6 +35,7 @@ Version 1.3.6+svn:
end-of-turn ends the linger and takes you out.
* The 'more' and 'help' button in the title screen now have a tooltip.
* Added a hotkey for clearing the chat messages.
* Fixed the black corners on some maps.
* Miscellaneous
* Isle of Anduin renamed to Isle of Alduin to avoid copyright problems.

View file

@ -289,8 +289,8 @@ void gamemap::read(const std::string& data)
// post processing on the map
const int width = tiles_.size();
const int height = width > 0 ? tiles_[0].size() : 0;
w_ = width;
h_ = height;
w_ = width;
h_ = height;
for(int x = 0; x < width; ++x) {
for(int y = 0; y < height; ++y) {
@ -430,7 +430,27 @@ t_translation::t_letter gamemap::get_terrain(const gamemap::location& loc) const
if(on_board(adj[n])) {
items[nitems] = tiles_[adj[n].x][adj[n].y];
++nitems;
} else {
// if the terrain is off map but already in the border cache this
// will be used to determine the terrain. This avoids glitches
// * on map with an even width in the top right corner
// * on map with an odd height in the bottom left corner
// It might also change the result on other map and become random
// but the border tiles will be deterimined in the future so then
// this will no longer be used in the game (the editor will use
// this feature to expand maps in a better way).
std::map<location, t_translation::t_letter>::const_iterator itor =
borderCache_.find(adj[n]);
// only add if it's in the cache and a valid terrain
if(itor != borderCache_.end() &&
itor->second != t_translation::NONE_TERRAIN) {
items[nitems] = itor->second;
++nitems;
}
}
}
//count all the terrain types found, and see which one