Rework ChoosePylonPosition to simplify the loop
[openttd/fttd.git] / src / blitter / 32bpp_base.cpp
blob182b9cbbf1386aed7e07d80e5362bc6515592482
1 /* $Id$ */
3 /*
4 * This file is part of OpenTTD.
5 * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
6 * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
7 * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
8 */
10 /** @file 32bpp_base.cpp Implementation of base for 32 bpp blitters. */
12 #include "../stdafx.h"
13 #include "32bpp_base.hpp"
15 void *Blitter_32bppBase::Surface::move (void *video, int x, int y)
17 return this->movep <uint32> (video, x, y);
20 void Blitter_32bppBase::Surface::export_lines (void *dst, uint dst_pitch, uint y, uint height)
22 uint32 *udst = (uint32 *)dst;
23 const uint32 *src = this->movep <const uint32> (this->ptr, 0, y);
25 for (; height > 0; height--) {
26 memcpy(udst, src, width * sizeof(uint32));
27 src += this->pitch;
28 udst += dst_pitch;
32 void Blitter_32bppBase::Surface::scroll (int left, int top, int width, int height, int dx, int dy)
34 this->Blitter::Surface::scroll<uint32> (this->ptr, left, top, width, height, dx, dy);