summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authortruelight <truelight@openttd.org>2007-06-21 13:31:41 +0000
committertruelight <truelight@openttd.org>2007-06-21 13:31:41 +0000
commite8f9332af940685e735bfdd9ae1f945a06a5a00e (patch)
tree933320e886eda6d3177383debf4805ff14f0b394 /src
parentedf68a04b043bcdd027f9a463ea52ef66c3afa6a (diff)
downloadopenttd-e8f9332af940685e735bfdd9ae1f945a06a5a00e.tar.xz
(svn r10244) -Fix: make sure to let 32bpp-anim report the increased buffer-size it needs
Diffstat (limited to 'src')
-rw-r--r--src/blitter/32bpp_anim.cpp5
-rw-r--r--src/blitter/32bpp_anim.hpp1
-rw-r--r--src/texteff.cpp2
3 files changed, 7 insertions, 1 deletions
diff --git a/src/blitter/32bpp_anim.cpp b/src/blitter/32bpp_anim.cpp
index 1ccd2b7a9..578f0d35b 100644
--- a/src/blitter/32bpp_anim.cpp
+++ b/src/blitter/32bpp_anim.cpp
@@ -244,6 +244,11 @@ void Blitter_32bppAnim::ScrollBuffer(void *video, int &left, int &top, int &widt
Blitter_32bppBase::ScrollBuffer(video, left, top, width, height, scroll_x, scroll_y);
}
+int Blitter_32bppAnim::BufferSize(int width, int height)
+{
+ return width * height * (sizeof(uint32) + sizeof(uint8));
+}
+
void Blitter_32bppAnim::PaletteAnimate(uint start, uint count)
{
uint8 *anim = this->anim_buf;
diff --git a/src/blitter/32bpp_anim.hpp b/src/blitter/32bpp_anim.hpp
index 426434d9b..c40db1828 100644
--- a/src/blitter/32bpp_anim.hpp
+++ b/src/blitter/32bpp_anim.hpp
@@ -29,6 +29,7 @@ public:
/* virtual */ void CopyFromBuffer(void *video, const void *src, int width, int height);
/* virtual */ void CopyToBuffer(const void *video, void *dst, int width, int height);
/* virtual */ void ScrollBuffer(void *video, int &left, int &top, int &width, int &height, int scroll_x, int scroll_y);
+ /* virtual */ int BufferSize(int width, int height);
/* virtual */ void PaletteAnimate(uint start, uint count);
/* virtual */ Blitter::PaletteAnimation UsePaletteAnimation();
};
diff --git a/src/texteff.cpp b/src/texteff.cpp
index af89f30b3..0a35973e1 100644
--- a/src/texteff.cpp
+++ b/src/texteff.cpp
@@ -55,7 +55,7 @@ static bool _textmessage_visible = false;
/* The chatbox grows from the bottom so the coordinates are pixels from
* the left and pixels from the bottom. The height is the maximum height */
static const Oblong _textmsg_box = {10, 30, 500, 150};
-static uint8 _textmessage_backup[150 * 500 * 5]; // (height * width)
+static uint8 _textmessage_backup[150 * 500 * 6]; // (height * width)
static inline uint GetTextMessageCount()
{