(svn r27590) [1.6] -Backport from trunk:

- Fix: Memory leak when disabling palette animation [FS#6404] (r27575)
- Fix: [NewGRF] The house id as returned by house variable 66 was incorrect when querying neighboured tiles [FS#6432] (r27574)
- Fix: [Build] Compilation failure with gcc 6.1 due to headers included after safeguards.h [FS#6467] (r27573)
- Fix: Convenience savegame bump to distinguish 1.6 savegames from 1.5 savegames [FS#6442] (r27572)
This commit is contained in:
frosch 2016-05-29 19:01:50 +00:00
parent d0d4a62f8d
commit 8b5936c224
5 changed files with 46 additions and 38 deletions

View File

@ -20,6 +20,11 @@
/** Instantiation of the 32bpp with animation blitter factory. */
static FBlitter_32bppAnim iFBlitter_32bppAnim;
Blitter_32bppAnim::~Blitter_32bppAnim()
{
free(this->anim_buf);
}
template <BlitterMode mode>
inline void Blitter_32bppAnim::Draw(const Blitter::BlitterParams *bp, ZoomLevel zoom)
{

View File

@ -29,6 +29,8 @@ public:
anim_buf_height(0)
{}
~Blitter_32bppAnim();
/* virtual */ void Draw(Blitter::BlitterParams *bp, BlitterMode mode, ZoomLevel zoom);
/* virtual */ void DrawColourMappingRect(void *dst, int width, int height, PaletteID pal);
/* virtual */ void SetPixel(void *video, int x, int y, uint8 colour);

View File

@ -36,6 +36,38 @@
#include <time.h>
#ifdef WITH_ALLEGRO
# include <allegro.h>
#endif /* WITH_ALLEGRO */
#ifdef WITH_FONTCONFIG
# include <fontconfig/fontconfig.h>
#endif /* WITH_FONTCONFIG */
#ifdef WITH_PNG
/* pngconf.h, included by png.h doesn't like something in the
* freetype headers. As such it's not alphabetically sorted. */
# include <png.h>
#endif /* WITH_PNG */
#ifdef WITH_FREETYPE
# include <ft2build.h>
# include FT_FREETYPE_H
#endif /* WITH_FREETYPE */
#if defined(WITH_ICU_LAYOUT) || defined(WITH_ICU_SORT)
# include <unicode/uversion.h>
#endif /* WITH_ICU_SORT || WITH_ICU_LAYOUT */
#ifdef WITH_LZMA
# include <lzma.h>
#endif
#ifdef WITH_LZO
#include <lzo/lzo1x.h>
#endif
#ifdef WITH_SDL
# include "sdl.h"
# include <SDL.h>
#endif /* WITH_SDL */
#ifdef WITH_ZLIB
# include <zlib.h>
#endif
#include "safeguards.h"
/* static */ const char *CrashLog::message = NULL;
@ -180,39 +212,6 @@ char *CrashLog::LogConfiguration(char *buffer, const char *last) const
return buffer;
}
/* Include these here so it's close to where it's actually used. */
#ifdef WITH_ALLEGRO
# include <allegro.h>
#endif /* WITH_ALLEGRO */
#ifdef WITH_FONTCONFIG
# include <fontconfig/fontconfig.h>
#endif /* WITH_FONTCONFIG */
#ifdef WITH_PNG
/* pngconf.h, included by png.h doesn't like something in the
* freetype headers. As such it's not alphabetically sorted. */
# include <png.h>
#endif /* WITH_PNG */
#ifdef WITH_FREETYPE
# include <ft2build.h>
# include FT_FREETYPE_H
#endif /* WITH_FREETYPE */
#if defined(WITH_ICU_LAYOUT) || defined(WITH_ICU_SORT)
# include <unicode/uversion.h>
#endif /* WITH_ICU_SORT || WITH_ICU_LAYOUT */
#ifdef WITH_LZMA
# include <lzma.h>
#endif
#ifdef WITH_LZO
#include <lzo/lzo1x.h>
#endif
#ifdef WITH_SDL
# include "sdl.h"
# include <SDL.h>
#endif /* WITH_SDL */
#ifdef WITH_ZLIB
# include <zlib.h>
#endif
/**
* Writes information (versions) of the used libraries.
* @param buffer The begin where to write at.

View File

@ -399,7 +399,8 @@ static uint32 GetDistanceFromNearbyHouse(uint8 parameter, TileIndex tile, HouseI
case 0x66: {
TileIndex testtile = GetNearbyTile(parameter, this->tile);
if (!IsTileType(testtile, MP_HOUSE)) return 0xFFFFFFFF;
HouseSpec *hs = HouseSpec::Get(GetHouseType(testtile));
HouseID nearby_house_id = GetHouseType(testtile);
HouseSpec *hs = HouseSpec::Get(nearby_house_id);
/* Information about the grf local classid if the house has a class */
uint houseclass = 0;
if (hs->class_id != HOUSE_NO_CLASS) {
@ -408,8 +409,8 @@ static uint32 GetDistanceFromNearbyHouse(uint8 parameter, TileIndex tile, HouseI
}
/* old house type or grf-local houseid */
uint local_houseid = 0;
if (this->house_id < NEW_HOUSE_OFFSET) {
local_houseid = this->house_id;
if (nearby_house_id < NEW_HOUSE_OFFSET) {
local_houseid = nearby_house_id;
} else {
local_houseid = (hs->grf_prop.grffile == this->ro.grffile ? 1 : 2) << 8;
local_houseid |= hs->grf_prop.local_id;

View File

@ -261,9 +261,10 @@
* 191 26646
* 192 26700
* 193 26802
* 194 26881 1.5.x
* 194 26881 1.5.x, 1.6.0
* 195 27572 1.6.x
*/
extern const uint16 SAVEGAME_VERSION = 194; ///< Current savegame version of OpenTTD.
extern const uint16 SAVEGAME_VERSION = 195; ///< Current savegame version of OpenTTD.
SavegameType _savegame_type; ///< type of savegame we are loading