diff --git a/config.lib b/config.lib index 3e0ab706f2..2abf190c2d 100644 --- a/config.lib +++ b/config.lib @@ -1407,7 +1407,9 @@ make_cflags_and_ldflags() { # Also make makedepend aware of compiler's built-in defines. if [ "$with_makedepend" != "0" ]; then cflags_makedep="`echo | $cxx_host -E -x c++ -dM - | sed 's@.define @-D@g;s@ .*@ @g;s@(.*)@@g' | tr -d '\r\n'`" - cflags_makedep="$cflags_makedep `echo "$CFLAGS" | sed 's@ /@ -@g;s@-I[ ]*[^ ]*@@g'`" + + # Please escape ALL " within ` because e.g. "" terminates the string in some sh implementations + cflags_makedep="$cflags_makedep `echo \"$CFLAGS\" | sed 's@ /@ -@g;s@-I[ ]*[^ ]*@@g'`" else makedepend="" fi diff --git a/configure b/configure index 710c02163d..1c54a7b44d 100755 --- a/configure +++ b/configure @@ -85,7 +85,7 @@ if [ ! -f "$LANG_DIR/english.txt" ]; then fi # Read the source.list and process it -SRCS="`< $ROOT_DIR/source.list tr '\r' '\n' | $awk ' +AWKCOMMAND=' { } /^( *)#end/ { if (deep == skip) { skip -= 1; } deep -= 1; next; } /^( *)#else/ { if (deep == skip) { skip -= 1; } else if (deep - 1 == skip) { skip += 1; } next; } @@ -130,13 +130,17 @@ SRCS="`< $ROOT_DIR/source.list tr '\r' '\n' | $awk ' print $0; } } -' | $PIPE_SORT`" +' -OBJS_C="` echo \"$SRCS\" | $awk ' { ORS = " " } /\.c$/ { gsub(".c$", ".o", $0); print $0; }'`" -OBJS_CPP="`echo \"$SRCS\" | $awk ' { ORS = " " } /\.cpp$/ { gsub(".cpp$", ".o", $0); print $0; }'`" -OBJS_MM="` echo \"$SRCS\" | $awk ' { ORS = " " } /\.mm$/ { gsub(".mm$", ".o", $0); print $0; }'`" -OBJS_RC="` echo \"$SRCS\" | $awk ' { ORS = " " } /\.rc$/ { gsub(".rc$", ".o", $0); print $0; }'`" -SRCS="` echo \"$SRCS\" | $awk ' { ORS = " " } { print $0; }'`" +# Read the source.list and process it +# Please escape ALL " within ` because e.g. "" terminates the string in some sh implementations +SRCS="`< $ROOT_DIR/source.list tr '\r' '\n' | $awk \"$AWKCOMMAND\" | $PIPE_SORT`" + +OBJS_C="` echo \"$SRCS\" | $awk ' { ORS = \" \" } /\.c$/ { gsub(\".c$\", \".o\", $0); print $0; }'`" +OBJS_CPP="`echo \"$SRCS\" | $awk ' { ORS = \" \" } /\.cpp$/ { gsub(\".cpp$\", \".o\", $0); print $0; }'`" +OBJS_MM="` echo \"$SRCS\" | $awk ' { ORS = \" \" } /\.mm$/ { gsub(\".mm$\", \".o\", $0); print $0; }'`" +OBJS_RC="` echo \"$SRCS\" | $awk ' { ORS = \" \" } /\.rc$/ { gsub(\".rc$\", \".o\", $0); print $0; }'`" +SRCS="` echo \"$SRCS\" | $awk ' { ORS = \" \" } { print $0; }'`" # In makefiles, we always use -u for sort if [ -z "$sort" ]; then diff --git a/readme.txt b/readme.txt index a4103bdd24..aec1296768 100644 --- a/readme.txt +++ b/readme.txt @@ -17,6 +17,7 @@ Table of Contents: 5.0) OpenTTD features 6.0) Configuration File 7.0) Compiling + * 7.1) Required/optional libraries 8.0) Translating * 8.1 Guidelines * 8.2 Translation @@ -319,18 +320,12 @@ Windows: You can also build it using the Makefile with MSYS/MinGW or Cygwin/MinGW. Please read the Makefile for more information. -Solaris 10: - You need g++ (version 3 or higher), together with SDL. Installation of - libpng and zlib is recommended. For the first build it is required - to execute "bash configure" first. Note that ./configure does not work - yet. It is likely that you don't have a strip binary, so use the - --disable-strip option in that case. Fontconfig (>2.3.0) and freetype - are optional. "make run" will then run the program. +Solaris, FreeBSD, OpenBSD: + Use "gmake", but do a "./configure" before the first build. -Unix: +Linux/Unix: OpenTTD can be built with GNU "make". On non-GNU systems it's called "gmake". However, for the first build one has to do a "./configure" first. - Note that you need SDL-devel 1.2.5 (or higher) to compile OpenTTD. MacOS X: Use "make" or Xcode (which will then call make for you) @@ -342,15 +337,6 @@ MacOS X: BeOS: Use "make", but do a "./configure" before the first build. -FreeBSD: - You need the port devel/sdl12 for a non-dedicated build. - graphics/png is optional for screenshots in the PNG format. - Use "gmake", but do a "./configure" before the first build. - -OpenBSD: - Use "gmake", but do a "./configure" before the first build. - Note that you need the port devel/sdl to compile OpenTTD. - MorphOS: Use "make". However, for the first build one has to do a "./configure" first. Note that you need the MorphOS SDK, latest libnix updates (else C++ parts of @@ -371,6 +357,8 @@ DOS: will be generated that does not need cwsdpmi.exe by adding the cswdstub.exe to the created OpenTTD binary. +7.1) Required/optional libraries: +---- ------------------- The following libraries are used by OpenTTD for: - libSDL/liballegro: hardware access (video, sound, mouse) - zlib: (de)compressing of savegames @@ -379,6 +367,11 @@ The following libraries are used by OpenTTD for: - libfontconfig: searching for fonts, resolving font names to actual fonts - libicu: handling of right-to-left scripts (e.g. Arabic and Persian) +OpenTTD does not require any of the libraries to be present, but without +zlib you cannot open most savegames or use the content downloading system. +Without libSDL/liballegro on non-Windows and non-MacOS X machines you have +no graphical user interface; you would be building a dedicated server. + 8.0) Translating: ---- ------------------- See http://www.openttd.org/development for up-to-date information. diff --git a/src/graph_gui.cpp b/src/graph_gui.cpp index 7db4320b4f..0d5e223579 100644 --- a/src/graph_gui.cpp +++ b/src/graph_gui.cpp @@ -99,7 +99,7 @@ static const Widget _graph_legend_widgets[] = { }; static const WindowDesc _graph_legend_desc( - WDP_AUTO, WDP_AUTO, 250, 198, 250, 198, + WDP_AUTO, WDP_AUTO, 250, 196, 250, 196, WC_GRAPH_LEGEND, WC_NONE, WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET, _graph_legend_widgets diff --git a/src/network/core/tcp_content.cpp b/src/network/core/tcp_content.cpp index 7596cced83..870a9d38e0 100644 --- a/src/network/core/tcp_content.cpp +++ b/src/network/core/tcp_content.cpp @@ -38,6 +38,7 @@ bool ContentInfo::IsSelected() const switch (this->state) { case ContentInfo::SELECTED: case ContentInfo::AUTOSELECTED: + case ContentInfo::ALREADY_HERE: return true; default: diff --git a/src/network/network_content.cpp b/src/network/network_content.cpp index 9aa479f011..798f24fd0b 100644 --- a/src/network/network_content.cpp +++ b/src/network/network_content.cpp @@ -245,7 +245,7 @@ void ClientNetworkContentSocketHandler::DownloadSelectedContent(uint &files, uin ContentID *ids = MallocT(infos.Length()); for (ContentIterator iter = infos.Begin(); iter != infos.End(); iter++) { const ContentInfo *ci = *iter; - if (!ci->IsSelected()) continue; + if (!ci->IsSelected() || ci->state == ContentInfo::ALREADY_HERE) continue; ids[files++] = ci->id; bytes += ci->filesize; diff --git a/src/newgrf_house.cpp b/src/newgrf_house.cpp index 3179edbfdf..6e16f964d6 100644 --- a/src/newgrf_house.cpp +++ b/src/newgrf_house.cpp @@ -551,7 +551,7 @@ bool NewHouseTileLoop(TileIndex tile) } TriggerHouse(tile, HOUSE_TRIGGER_TILE_LOOP); - TriggerHouse(tile, HOUSE_TRIGGER_TILE_LOOP_TOP); + if (hs->building_flags & BUILDING_HAS_1_TILE) TriggerHouse(tile, HOUSE_TRIGGER_TILE_LOOP_TOP); if (HasBit(hs->callback_mask, CBM_HOUSE_ANIMATION_START_STOP)) { /* If this house is marked as having a synchronised callback, all the @@ -580,6 +580,7 @@ bool NewHouseTileLoop(TileIndex tile) } SetHouseProcessingTime(tile, hs->processing_time); + MarkTileDirtyByTile(tile); return true; } @@ -615,7 +616,11 @@ static void DoTriggerHouse(TileIndex tile, HouseTrigger trigger, byte base_rando break; case HOUSE_TRIGGER_TILE_LOOP_TOP: - if (!first) break; + if (!first) { + /* The top tile is marked dirty by the usual TileLoop */ + MarkTileDirtyByTile(tile); + break; + } /* Random value of first tile already set. */ if (hs->building_flags & BUILDING_2_TILES_Y) DoTriggerHouse(TILE_ADDXY(tile, 0, 1), trigger, random_bits, false); if (hs->building_flags & BUILDING_2_TILES_X) DoTriggerHouse(TILE_ADDXY(tile, 1, 0), trigger, random_bits, false); diff --git a/src/script/squirrel_helper.hpp b/src/script/squirrel_helper.hpp index ba4069d742..580f49cbd7 100644 --- a/src/script/squirrel_helper.hpp +++ b/src/script/squirrel_helper.hpp @@ -80,8 +80,8 @@ namespace SQConvert { template <> inline int Return (HSQUIRRELVM vm, int64 res) { sq_pushinteger(vm, ClampToI32(res)); return 1; } template <> inline int Return (HSQUIRRELVM vm, Money res) { sq_pushinteger(vm, ClampToI32(res)); return 1; } template <> inline int Return (HSQUIRRELVM vm, bool res) { sq_pushbool (vm, res); return 1; } - template <> inline int Return (HSQUIRRELVM vm, char *res) { if (res == NULL) sq_pushnull(vm); else {sq_pushstring (vm, OTTD2FS(res), strlen(res)); free(res);} return 1; } - template <> inline int Return(HSQUIRRELVM vm, const char *res) { if (res == NULL) sq_pushnull(vm); else {sq_pushstring (vm, OTTD2FS(res), strlen(res));} return 1; } + template <> inline int Return (HSQUIRRELVM vm, char *res) { if (res == NULL) sq_pushnull(vm); else { sq_pushstring(vm, OTTD2FS(res), -1); free(res); } return 1; } + template <> inline int Return(HSQUIRRELVM vm, const char *res) { if (res == NULL) sq_pushnull(vm); else { sq_pushstring(vm, OTTD2FS(res), -1); } return 1; } template <> inline int Return (HSQUIRRELVM vm, void *res) { sq_pushuserpointer(vm, res); return 1; } /**