diff --git a/Makefile.msvc b/Makefile.msvc index 8ee1e7088d..0a02c8cf95 100644 --- a/Makefile.msvc +++ b/Makefile.msvc @@ -27,9 +27,21 @@ SRC_DIR = "$(ROOT_DIR)/src" BUNDLE_DIR = "$(ROOT_DIR)/bundle" BUNDLES_DIR = "$(ROOT_DIR)/bundles" TTD = openttd.exe +PDB = openttd.pdb +MODE = Release TARGET := $(shell echo $(PLATFORM) | sed "s@win64@x64@;s@win32@Win32@") all: - $(Q)cp objs/$(TARGET)/Release/$(TTD) $(BIN_DIR)/$(TTD) + $(Q)cp objs/$(TARGET)/$(MODE)/$(TTD) $(BIN_DIR)/$(TTD) include Makefile.bundle.in + +bundle_pdb: + @echo '[BUNDLE] Creating $(BUNDLE_NAME).pdb.xz' + $(Q)mkdir -p "$(BUNDLES_DIR)" + $(Q)cp objs/$(TARGET)/Release/$(PDB) $(BUNDLES_DIR)/$(BUNDLE_NAME).pdb + $(Q)xz -9 $(BUNDLES_DIR)/$(BUNDLE_NAME).pdb + +regression: all + $(Q)cp bin/$(TTD) bin/openttd + $(Q)cd bin && sh ai/regression/run.sh diff --git a/bin/ai/regression/run.sh b/bin/ai/regression/run.sh index 2e86f3b87f..1da1ad2ce2 100755 --- a/bin/ai/regression/run.sh +++ b/bin/ai/regression/run.sh @@ -28,6 +28,7 @@ else ./openttd -x -c ai/regression/regression.cfg $params -g ai/regression/regression.sav -d ai=2 2>&1 | awk '{ gsub("0x(\\(nil\\)|0+)(x0)?", "0x00000000", $0); gsub("^dbg: \\[ai\\]", "", $0); gsub("^ ", "ERROR: ", $0); gsub("ERROR: \\[1\\] ", "", $0); gsub("\\[P\\] ", "", $0); print $0; }' > tmp.regression fi +ret=0 if [ -z "$gdb" ]; then res="`diff -ub ai/regression/regression.txt tmp.regression`" if [ -z "$res" ]; then @@ -35,6 +36,7 @@ if [ -z "$gdb" ]; then else echo "Regression test failed! Difference:" echo "$res" + ret=1 fi echo "" echo "Regression test done" @@ -49,3 +51,5 @@ fi if [ "$1" != "-k" ]; then rm -f tmp.regression fi + +exit $ret diff --git a/src/bmp.cpp b/src/bmp.cpp index 64b3f14eaf..2c85c768b4 100644 --- a/src/bmp.cpp +++ b/src/bmp.cpp @@ -13,6 +13,7 @@ #include "bmp.h" #include "core/bitmath_func.hpp" #include "core/alloc_func.hpp" +#include "core/mem_func.hpp" void BmpInitializeBuffer(BmpBuffer *buffer, FILE *file) { @@ -287,6 +288,7 @@ bool BmpReadHeader(BmpBuffer *buffer, BmpInfo *info, BmpData *data) { uint32 header_size; assert(info != NULL); + MemSetT(info, 0); /* Reading BMP header */ if (ReadWord(buffer) != 0x4D42) return false; // signature should be 'BM' diff --git a/src/newgrf_gui.cpp b/src/newgrf_gui.cpp index e901721fa2..37f644dbc0 100644 --- a/src/newgrf_gui.cpp +++ b/src/newgrf_gui.cpp @@ -1005,12 +1005,9 @@ struct NewGRFWindow : public QueryStringBaseWindow { this->preset = index; if (index != -1) { - GRFConfig *c = LoadGRFPresetFromConfig(_grf_preset_list[index]); - - this->active_sel = NULL; - this->actives = c; - this->avails.ForceRebuild(); + this->actives = LoadGRFPresetFromConfig(_grf_preset_list[index]); } + this->avails.ForceRebuild(); DeleteWindowByClass(WC_GRF_PARAMETERS); this->active_sel = NULL; diff --git a/src/station_gui.cpp b/src/station_gui.cpp index e55c03226c..1f71a4104b 100644 --- a/src/station_gui.cpp +++ b/src/station_gui.cpp @@ -84,7 +84,8 @@ static int DrawCargoListText(uint32 cargo_mask, const Rect &r, StringID prefix) int DrawStationCoverageAreaText(int left, int right, int top, StationCoverageType sct, int rad, bool supplies) { TileIndex tile = TileVirtXY(_thd.pos.x, _thd.pos.y); - if (tile < MapSize()) { + uint32 cargo_mask = 0; + if (_thd.drawstyle == HT_RECT && tile < MapSize()) { CargoArray cargos; if (supplies) { cargos = GetProductionAroundTiles(tile, _thd.size.x / TILE_SIZE, _thd.size.y / TILE_SIZE, rad); @@ -93,7 +94,6 @@ int DrawStationCoverageAreaText(int left, int right, int top, StationCoverageTyp } /* Convert cargo counts to a set of cargo bits, and draw the result. */ - uint32 cargo_mask = 0; for (CargoID i = 0; i < NUM_CARGO; i++) { switch (sct) { case SCT_PASSENGERS_ONLY: if (!IsCargoInClass(i, CC_PASSENGERS)) continue; break; @@ -103,11 +103,9 @@ int DrawStationCoverageAreaText(int left, int right, int top, StationCoverageTyp } if (cargos[i] >= (supplies ? 1U : 8U)) SetBit(cargo_mask, i); } - Rect r = {left, top, right, INT32_MAX}; - return DrawCargoListText(cargo_mask, r, supplies ? STR_STATION_BUILD_SUPPLIES_CARGO : STR_STATION_BUILD_ACCEPTS_CARGO); } - - return top; + Rect r = {left, top, right, INT32_MAX}; + return DrawCargoListText(cargo_mask, r, supplies ? STR_STATION_BUILD_SUPPLIES_CARGO : STR_STATION_BUILD_ACCEPTS_CARGO); } /**