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"
|
BUNDLE_DIR = "$(ROOT_DIR)/bundle"
|
||||||
BUNDLES_DIR = "$(ROOT_DIR)/bundles"
|
BUNDLES_DIR = "$(ROOT_DIR)/bundles"
|
||||||
TTD = openttd.exe
|
TTD = openttd.exe
|
||||||
|
PDB = openttd.pdb
|
||||||
|
MODE = Release
|
||||||
TARGET := $(shell echo $(PLATFORM) | sed "s@win64@x64@;s@win32@Win32@")
|
TARGET := $(shell echo $(PLATFORM) | sed "s@win64@x64@;s@win32@Win32@")
|
||||||
|
|
||||||
all:
|
all:
|
||||||
$(Q)cp objs/$(TARGET)/Release/$(TTD) $(BIN_DIR)/$(TTD)
|
$(Q)cp objs/$(TARGET)/$(MODE)/$(TTD) $(BIN_DIR)/$(TTD)
|
||||||
|
|
||||||
include Makefile.bundle.in
|
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
|
./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
|
fi
|
||||||
|
|
||||||
|
ret=0
|
||||||
if [ -z "$gdb" ]; then
|
if [ -z "$gdb" ]; then
|
||||||
res="`diff -ub ai/regression/regression.txt tmp.regression`"
|
res="`diff -ub ai/regression/regression.txt tmp.regression`"
|
||||||
if [ -z "$res" ]; then
|
if [ -z "$res" ]; then
|
||||||
|
@ -35,6 +36,7 @@ if [ -z "$gdb" ]; then
|
||||||
else
|
else
|
||||||
echo "Regression test failed! Difference:"
|
echo "Regression test failed! Difference:"
|
||||||
echo "$res"
|
echo "$res"
|
||||||
|
ret=1
|
||||||
fi
|
fi
|
||||||
echo ""
|
echo ""
|
||||||
echo "Regression test done"
|
echo "Regression test done"
|
||||||
|
@ -49,3 +51,5 @@ fi
|
||||||
if [ "$1" != "-k" ]; then
|
if [ "$1" != "-k" ]; then
|
||||||
rm -f tmp.regression
|
rm -f tmp.regression
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
exit $ret
|
||||||
|
|
|
@ -13,6 +13,7 @@
|
||||||
#include "bmp.h"
|
#include "bmp.h"
|
||||||
#include "core/bitmath_func.hpp"
|
#include "core/bitmath_func.hpp"
|
||||||
#include "core/alloc_func.hpp"
|
#include "core/alloc_func.hpp"
|
||||||
|
#include "core/mem_func.hpp"
|
||||||
|
|
||||||
void BmpInitializeBuffer(BmpBuffer *buffer, FILE *file)
|
void BmpInitializeBuffer(BmpBuffer *buffer, FILE *file)
|
||||||
{
|
{
|
||||||
|
@ -287,6 +288,7 @@ bool BmpReadHeader(BmpBuffer *buffer, BmpInfo *info, BmpData *data)
|
||||||
{
|
{
|
||||||
uint32 header_size;
|
uint32 header_size;
|
||||||
assert(info != NULL);
|
assert(info != NULL);
|
||||||
|
MemSetT(info, 0);
|
||||||
|
|
||||||
/* Reading BMP header */
|
/* Reading BMP header */
|
||||||
if (ReadWord(buffer) != 0x4D42) return false; // signature should be 'BM'
|
if (ReadWord(buffer) != 0x4D42) return false; // signature should be 'BM'
|
||||||
|
|
|
@ -1005,12 +1005,9 @@ struct NewGRFWindow : public QueryStringBaseWindow {
|
||||||
this->preset = index;
|
this->preset = index;
|
||||||
|
|
||||||
if (index != -1) {
|
if (index != -1) {
|
||||||
GRFConfig *c = LoadGRFPresetFromConfig(_grf_preset_list[index]);
|
this->actives = LoadGRFPresetFromConfig(_grf_preset_list[index]);
|
||||||
|
|
||||||
this->active_sel = NULL;
|
|
||||||
this->actives = c;
|
|
||||||
this->avails.ForceRebuild();
|
|
||||||
}
|
}
|
||||||
|
this->avails.ForceRebuild();
|
||||||
|
|
||||||
DeleteWindowByClass(WC_GRF_PARAMETERS);
|
DeleteWindowByClass(WC_GRF_PARAMETERS);
|
||||||
this->active_sel = NULL;
|
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)
|
int DrawStationCoverageAreaText(int left, int right, int top, StationCoverageType sct, int rad, bool supplies)
|
||||||
{
|
{
|
||||||
TileIndex tile = TileVirtXY(_thd.pos.x, _thd.pos.y);
|
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;
|
CargoArray cargos;
|
||||||
if (supplies) {
|
if (supplies) {
|
||||||
cargos = GetProductionAroundTiles(tile, _thd.size.x / TILE_SIZE, _thd.size.y / TILE_SIZE, rad);
|
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. */
|
/* 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++) {
|
for (CargoID i = 0; i < NUM_CARGO; i++) {
|
||||||
switch (sct) {
|
switch (sct) {
|
||||||
case SCT_PASSENGERS_ONLY: if (!IsCargoInClass(i, CC_PASSENGERS)) continue; break;
|
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);
|
if (cargos[i] >= (supplies ? 1U : 8U)) SetBit(cargo_mask, i);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
Rect r = {left, top, right, INT32_MAX};
|
Rect r = {left, top, right, INT32_MAX};
|
||||||
return DrawCargoListText(cargo_mask, r, supplies ? STR_STATION_BUILD_SUPPLIES_CARGO : STR_STATION_BUILD_ACCEPTS_CARGO);
|
return DrawCargoListText(cargo_mask, r, supplies ? STR_STATION_BUILD_SUPPLIES_CARGO : STR_STATION_BUILD_ACCEPTS_CARGO);
|
||||||
}
|
|
||||||
|
|
||||||
return top;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue