fix compilation problems
This commit is contained in:
parent
2a866ca9a1
commit
c906029bdb
4 changed files with 68 additions and 18 deletions
|
@ -65,6 +65,7 @@ wesnoth_SOURCES = \
|
|||
key.cpp \
|
||||
language.cpp \
|
||||
leader_list.cpp \
|
||||
loadscreen.cpp \
|
||||
map_create.cpp \
|
||||
map_label.cpp \
|
||||
mapgen.cpp \
|
||||
|
@ -163,6 +164,7 @@ wesnoth_editor_SOURCES = \
|
|||
image.cpp \
|
||||
key.cpp \
|
||||
language.cpp \
|
||||
loadscreen.cpp \
|
||||
map_create.cpp \
|
||||
map_label.cpp \
|
||||
mapgen.cpp \
|
||||
|
@ -222,6 +224,7 @@ wesnothd_SOURCES = \
|
|||
server/server.cpp \
|
||||
network.cpp \
|
||||
network_worker.cpp \
|
||||
loadscreen_empty.cpp \
|
||||
serialization/parser.cpp
|
||||
|
||||
wesnothd_LDADD = -L. -lwesnoth-core @SDL_NET_LIBS@ @SDL_LIBS@ $(LIBZIPIOS) $(LIBINTL)
|
||||
|
@ -416,7 +419,6 @@ libwesnoth_core_a_SOURCES = \
|
|||
color_range.cpp \
|
||||
game_config.cpp \
|
||||
gettext.cpp \
|
||||
loadscreen.cpp \
|
||||
log.cpp \
|
||||
map.cpp \
|
||||
pathutils.cpp \
|
||||
|
|
|
@ -1066,14 +1066,7 @@ bool event_handler::handle_event_command(const queued_event& event_info,
|
|||
|
||||
//creating a mask of the terrain
|
||||
else if(cmd == "terrain_mask") {
|
||||
gamemap::location loc = cfg_to_loc(cfg);
|
||||
if(loc.x == -1) {
|
||||
loc.x = 0;
|
||||
}
|
||||
|
||||
if(loc.y == -1) {
|
||||
loc.y = 0;
|
||||
}
|
||||
gamemap::location loc = cfg_to_loc(cfg, 1, 1);
|
||||
|
||||
gamemap mask(*game_map);
|
||||
|
||||
|
|
47
src/loadscreen_empty.cpp
Normal file
47
src/loadscreen_empty.cpp
Normal file
|
@ -0,0 +1,47 @@
|
|||
/*
|
||||
Copyright (C) 2005 by Joeri Melis <joeri_melis@hotmail.com>
|
||||
Part of the Battle for Wesnoth Project http://www.wesnoth.org/
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License.
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY.
|
||||
|
||||
See the COPYING file for more details.
|
||||
*/
|
||||
|
||||
#include "loadscreen.hpp"
|
||||
|
||||
#include "font.hpp"
|
||||
#include "marked-up_text.hpp"
|
||||
|
||||
//#include <iostream>
|
||||
|
||||
#define MIN_PERCENTAGE 0
|
||||
#define MAX_PERCENTAGE 100
|
||||
|
||||
void loadscreen::set_progress(const int /*percentage*/, const std::string &/*text*/, const bool /*commit*/)
|
||||
{}
|
||||
|
||||
void loadscreen::increment_progress(const int /*percentage*/, const std::string &/*text*/, const bool /*commit*/) {}
|
||||
|
||||
void loadscreen::clear_screen(const bool /*commit*/) {}
|
||||
|
||||
loadscreen *loadscreen::global_loadscreen = 0;
|
||||
|
||||
#define CALLS_TO_FILESYSTEM 112
|
||||
#define PRCNT_BY_FILESYSTEM 20
|
||||
#define CALLS_TO_BINARYWML 9561
|
||||
#define PRCNT_BY_BINARYWML 20
|
||||
#define CALLS_TO_SETCONFIG 306
|
||||
#define PRCNT_BY_SETCONFIG 30
|
||||
#define CALLS_TO_PARSER 50448
|
||||
#define PRCNT_BY_PARSER 20
|
||||
|
||||
void increment_filesystem_progress () {}
|
||||
|
||||
void increment_binary_wml_progress () {}
|
||||
|
||||
void increment_set_config_progress () {}
|
||||
|
||||
void increment_parser_progress () {}
|
26
src/map.cpp
26
src/map.cpp
|
@ -361,12 +361,20 @@ void gamemap::overlay(const gamemap& m, const config& rules_cfg, const int xpos,
|
|||
{
|
||||
const config::child_list& rules = rules_cfg.get_children("rule");
|
||||
|
||||
const int xend = minimum<int>(xpos+m.x(),x());
|
||||
const int yend = minimum<int>(ypos+m.y(),y());
|
||||
for(int x = xpos; x < xend; ++x) {
|
||||
for(int y = ypos; y < yend; ++y) {
|
||||
const TERRAIN t = m[x-xpos][y-ypos];
|
||||
const TERRAIN current = (*this)[x][y];
|
||||
const int xstart = maximum<int>(0, -xpos);
|
||||
const int ystart = maximum<int>(0, -ypos-((xpos & 1) ? 1 : 0));
|
||||
const int xend = minimum<int>(m.x(),x()-xpos);
|
||||
const int yend = minimum<int>(m.y(),y()-ypos);
|
||||
for(int x1 = xstart; x1 < xend; ++x1) {
|
||||
for(int y1 = ystart; y1 < yend; ++y1) {
|
||||
const int x2 = x1 + xpos;
|
||||
const int y2 = y1 + ypos +
|
||||
((xpos & 1) && (x1 & 1) ? 1 : 0);
|
||||
if (y2 < 0 || y2 >= y()) {
|
||||
continue;
|
||||
}
|
||||
const TERRAIN t = m[x1][y1];
|
||||
const TERRAIN current = (*this)[x2][y2];
|
||||
|
||||
if(t == FOGGED || t == VOID_TERRAIN) {
|
||||
continue;
|
||||
|
@ -406,12 +414,12 @@ void gamemap::overlay(const gamemap& m, const config& rules_cfg, const int xpos,
|
|||
const config& cfg = **rule;
|
||||
const std::string& terrain = cfg["terrain"];
|
||||
if(terrain != "") {
|
||||
set_terrain(location(x,y),terrain[0]);
|
||||
set_terrain(location(x2,y2),terrain[0]);
|
||||
} else if(cfg["use_old"] != "yes") {
|
||||
set_terrain(location(x,y),t);
|
||||
set_terrain(location(x2,y2),t);
|
||||
}
|
||||
} else {
|
||||
set_terrain(location(x,y),t);
|
||||
set_terrain(location(x2,y2),t);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue