mirror of https://github.com/OpenTTD/OpenTTD
(svn r22601) [1.1] -Backport from trunk:
- Add: Makefile support for bundling pdb and running regressions with the MSVC makefile (r22581, r22580, r22576) - Fix: Do not show cargo accepted/produced in the new station window when no tiles are selected (mouse hovering a window or toolbar) [FS#4647] (r22595, r22593) - Fix: Add active NewGRFs to the list of available ones when selecting the empty preset [FS#4644] (r22594) - Fix: Reading of heightmaps with uncommon BMP formats failed due to uninitialised variables [FS#4645] (r22592)release/1.1
parent
0b02b285a8
commit
725d00630f
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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'
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue