openttd updated to 1.5.0-beta2

--HG--
branch : openttd
This commit is contained in:
Pavel Stupnikov
2015-03-01 00:30:53 +03:00
parent 0abb47ce90
commit d201932121
682 changed files with 26103 additions and 16553 deletions

View File

@@ -1,4 +1,4 @@
/* $Id: spritecache.cpp 26209 2014-01-02 22:41:58Z rubidium $ */
/* $Id: spritecache.cpp 27016 2014-10-14 16:09:21Z peter1138 $ */
/*
* This file is part of OpenTTD.
@@ -24,6 +24,8 @@
#include "table/strings.h"
#include "table/palette_convert.h"
#include "safeguards.h"
/* Default of 4MB spritecache */
uint _sprite_cache_size = 4;
@@ -436,12 +438,20 @@ static void *ReadSprite(const SpriteCache *sc, SpriteID id, SpriteType sprite_ty
return s;
}
if (sprite_type == ST_NORMAL) {
if (!ResizeSprites(sprite, sprite_avail, file_slot, sc->id)) {
if (id == SPR_IMG_QUERY) usererror("Okay... something went horribly wrong. I couldn't resize the fallback sprite. What should I do?");
return (void*)GetRawSprite(SPR_IMG_QUERY, ST_NORMAL, allocator);
}
if (!ResizeSprites(sprite, sprite_avail, file_slot, sc->id)) {
if (id == SPR_IMG_QUERY) usererror("Okay... something went horribly wrong. I couldn't resize the fallback sprite. What should I do?");
return (void*)GetRawSprite(SPR_IMG_QUERY, ST_NORMAL, allocator);
}
if (sprite->type == ST_FONT && ZOOM_LVL_GUI != ZOOM_LVL_NORMAL) {
/* Make ZOOM_LVL_GUI be ZOOM_LVL_NORMAL */
sprite[ZOOM_LVL_NORMAL].width = sprite[ZOOM_LVL_GUI].width;
sprite[ZOOM_LVL_NORMAL].height = sprite[ZOOM_LVL_GUI].height;
sprite[ZOOM_LVL_NORMAL].x_offs = sprite[ZOOM_LVL_GUI].x_offs;
sprite[ZOOM_LVL_NORMAL].y_offs = sprite[ZOOM_LVL_GUI].y_offs;
sprite[ZOOM_LVL_NORMAL].data = sprite[ZOOM_LVL_GUI].data;
}
return BlitterFactory::GetCurrentBlitter()->Encode(sprite, allocator);
}