summaryrefslogtreecommitdiff
path: root/video
diff options
context:
space:
mode:
authortron <tron@openttd.org>2005-09-08 12:48:26 +0000
committertron <tron@openttd.org>2005-09-08 12:48:26 +0000
commitc20b5883bd7e917dee83367eeea9e795d16bfc63 (patch)
tree3f41cacc0471e60af369fc95349585751ff00335 /video
parent0f08a1c69421f2d0ec718d8b53404c53fb65606a (diff)
downloadopenttd-c20b5883bd7e917dee83367eeea9e795d16bfc63.tar.xz
(svn r2924) Introduce the ALIGN() macro which aligns values to multiples of a power of 2, for exact semantics see the commment in macros.h
Diffstat (limited to 'video')
-rw-r--r--video/win32_v.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/video/win32_v.c b/video/win32_v.c
index 3656e66ad..90997804a 100644
--- a/video/win32_v.c
+++ b/video/win32_v.c
@@ -536,7 +536,7 @@ static bool AllocateDibSection(int w, int h)
return false;
_screen.width = w;
- _screen.pitch = (w + 3) & ~0x3;
+ _screen.pitch = ALIGN(w, 4);
_screen.height = h;
if (_wnd.alloced_bits) {
@@ -549,7 +549,7 @@ static bool AllocateDibSection(int w, int h)
bi->bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
if (_wnd.double_size) {
- w = (w + 3) & ~0x3;
+ w = ALIGN(w, 4);
_wnd.alloced_bits = _wnd.buffer_bits = malloc(w * h);
w *= 2;
h *= 2;