Tiles can now have their own image in the editor,

...defaults to the minimap image. 

Added some placeholder art.
Renamed symbol_image to minimap_image.
This commit is contained in:
Mark de Wever 2007-08-18 08:42:44 +00:00
parent 5636ddb228
commit 6c309aa7db
13 changed files with 35 additions and 18 deletions

View file

@ -60,6 +60,8 @@ Version 1.3.6+svn:
* the resize option can now also use the surrounding tiles to expand the
map in a smart way, this is the default.
* the map editor can now also shift the origin of the map when resizing.
* tiles can now have their own image in the editor, defaults to the minimap
image. Also added some placeholder art.
* user interface:
* Enable "Save Game" and "View Chat Log" menu entries in replay mode.
* Add an additional line below the minimap in the "Multiplayer->Create game"

Binary file not shown.

After

Width:  |  Height:  |  Size: 455 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.2 KiB

View file

@ -8,6 +8,7 @@
[terrain]
symbol_image=void
editor_image=off-map/offmap-editor
id=off_map
name= _ "None"
string=_off^_usr
@ -890,6 +891,7 @@
[terrain]
symbol_image=cave/wall-rough1
editor_image=cave/wall-editor
id=cavewall
name= _ "Cave Wall"
string=Xu

View file

@ -17,6 +17,7 @@ Version 1.3.6+svn:
* The resize option can now use the current tiles to expand the map
instead of the background tile.
* When resizing the map, the origin can also be modified.
* Tiles can now have their image independant from the minimap image.
* Language and translations
* Updated translations: Danish, Finnish, French, German, Greek, Japanese,

View file

@ -207,7 +207,7 @@ void terrain_builder::rebuild_terrain(const gamemap::location &loc)
btile.images_foreground.clear();
btile.images_background.clear();
const std::string filename =
map_.get_terrain_info(map_.get_terrain(loc)).symbol_image();
map_.get_terrain_info(map_.get_terrain(loc)).minimap_image();
animated<image::locator> img_loc;
img_loc.add_frame(100,image::locator("terrain/" + filename + ".png"));
img_loc.start_animation(0, true);

View file

@ -450,7 +450,7 @@ std::vector<std::string> display::get_fog_shroud_graphics(const gamemap::locatio
// stream << "void";
//else
// stream << "fog";
stream << "terrain/" << map_.get_terrain_info(*terrain).symbol_image();
stream << "terrain/" << map_.get_terrain_info(*terrain).minimap_image();
for(int n = 0; *terrain == tiles[i] && n != 6; i = (i+1)%6, ++n) {
stream << get_direction(i);

View file

@ -963,10 +963,10 @@ void map_editor::clear_highlighted_hexes_in_gui() {
void map_editor::set_mouseover_overlay()
{
surface image_fg(image::get_image("terrain/" + map_.get_terrain_info(
palette_.selected_fg_terrain()).symbol_image() +
palette_.selected_fg_terrain()).editor_image() +
".png"));
surface image_bg(image::get_image("terrain/" + map_.get_terrain_info(
palette_.selected_bg_terrain()).symbol_image() +
palette_.selected_bg_terrain()).editor_image() +
".png"));
// For efficiency the size of the tile is cached.

View file

@ -365,7 +365,7 @@ void terrain_palette::draw(bool force) {
int y = terrain_start_;
for(unsigned int counter = starting; counter < ending; counter++){
const t_translation::t_letter terrain = terrains_[counter];
const std::string filename = "terrain/" + map_.get_terrain_info(terrain).symbol_image() + ".png";
const std::string filename = "terrain/" + map_.get_terrain_info(terrain).editor_image() + ".png";
surface image(image::get_image(filename));
if(image == NULL) {
std::cerr << "image for terrain " << counter << ": '" << filename << "' not found\n";

View file

@ -255,9 +255,9 @@ void game_display::draw(bool update,bool force)
const time_of_day& tod = status_.get_time_of_day();
const std::string shroud_image = "terrain/" +
map_.get_terrain_info(t_translation::VOID_TERRAIN).symbol_image() + ".png";
map_.get_terrain_info(t_translation::VOID_TERRAIN).minimap_image() + ".png";
const std::string fog_image = "terrain/" +
map_.get_terrain_info(t_translation::FOGGED).symbol_image() + ".png";
map_.get_terrain_info(t_translation::FOGGED).minimap_image() + ".png";
SDL_Rect clip_rect = map_area();
surface const dst(screen_.getSurface());

View file

@ -62,7 +62,7 @@ surface getMinimap(int w, int h, const gamemap& map, const viewpoint* vw)
cache_map::iterator i = cache.find(terrain);
if(i == cache.end()) {
surface tile(get_image("terrain/" + map.get_terrain_info(terrain).symbol_image() + ".png",image::HEXED));
surface tile(get_image("terrain/" + map.get_terrain_info(terrain).minimap_image() + ".png",image::HEXED));
if(tile == NULL) {
ERR_DP << "could not get image for terrrain '"

View file

@ -27,18 +27,24 @@
#include <iostream>
terrain_type::terrain_type() : symbol_image_("void"),
number_(t_translation::VOID_TERRAIN),
mvt_type_(1, t_translation::VOID_TERRAIN),
def_type_(1, t_translation::VOID_TERRAIN),
union_type_(1, t_translation::VOID_TERRAIN),
height_adjust_(0), submerge_(0.0), light_modification_(0),
heals_(0), village_(false), castle_(false), keep_(false)
terrain_type::terrain_type() :
minimap_image_("void"), editor_image_("void"),
number_(t_translation::VOID_TERRAIN),
mvt_type_(1, t_translation::VOID_TERRAIN),
def_type_(1, t_translation::VOID_TERRAIN),
union_type_(1, t_translation::VOID_TERRAIN),
height_adjust_(0), submerge_(0.0), light_modification_(0),
heals_(0), village_(false), castle_(false), keep_(false)
{}
terrain_type::terrain_type(const config& cfg)
{
symbol_image_ = cfg["symbol_image"];
minimap_image_ = cfg["symbol_image"];
editor_image_ = cfg["editor_image"];
if(editor_image_.empty()) {
editor_image_ = minimap_image_;
}
name_ = cfg["name"];
id_ = cfg["id"];

View file

@ -29,7 +29,8 @@ public:
terrain_type();
terrain_type(const config& cfg);
const std::string& symbol_image() const { return symbol_image_; }
const std::string& minimap_image() const { return minimap_image_; }
const std::string& editor_image() const { return editor_image_; }
const t_string& name() const { return name_; }
const std::string& id() const { return id_; }
@ -63,7 +64,12 @@ public:
const std::string& editor_group() const { return editor_group_; }
private:
std::string symbol_image_;
//! The image used in the minimap
std::string minimap_image_;
//! The image used in the editor pallete if not defined in WML it will
//! be initialized with the value of minimap_image_
std::string editor_image_;
std::string id_;
t_string name_;