OpenTTD

null.cpp
Go to the documentation of this file.
1 /* $Id: null.cpp 26482 2014-04-23 20:13:33Z rubidium $ */
2
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 */
9
12 #include "../stdafx.h"
13 #include "null.hpp"
14
15 #include "../safeguards.h"
16
18 static FBlitter_Null iFBlitter_Null;
19
20 Sprite *Blitter_Null::Encode(const SpriteLoader::Sprite *sprite, AllocatorProc *allocator)
21 {
22 Sprite *dest_sprite;
23 dest_sprite = (Sprite *)allocator(sizeof(*dest_sprite));
24
25 dest_sprite->height = sprite->height;
26 dest_sprite->width = sprite->width;
27 dest_sprite->x_offs = sprite->x_offs;
28 dest_sprite->y_offs = sprite->y_offs;
29
30 return dest_sprite;
31 }
iFBlitter_Null
static FBlitter_Null iFBlitter_Null
Instantiation of the null blitter factory.
Definition: null.cpp:18
Sprite
Data structure describing a sprite.
Definition: spritecache.h:18
Sprite::y_offs
int16 y_offs
Number of pixels to shift the sprite downwards.
Definition: spritecache.h:22
SpriteLoader::Sprite::x_offs
int16 x_offs
The x-offset of where the sprite will be drawn.
Definition: spriteloader.hpp:39
SpriteLoader::Sprite
Structure for passing information from the sprite loader to the blitter.
Definition: spriteloader.hpp:36
Sprite::height
uint16 height
Height of the sprite.
Definition: spritecache.h:19
SpriteLoader::Sprite::width
uint16 width
Width of the sprite.
Definition: spriteloader.hpp:38
Sprite::width
uint16 width
Width of the sprite.
Definition: spritecache.h:20
Blitter_Null::Encode
Sprite * Encode(const SpriteLoader::Sprite *sprite, AllocatorProc *allocator)
Convert a sprite from the loader to our own format.
Definition: null.cpp:20
SpriteLoader::Sprite::height
uint16 height
Height of the sprite.
Definition: spriteloader.hpp:37
Sprite::x_offs
int16 x_offs
Number of pixels to shift the sprite to the right.
Definition: spritecache.h:21
null.hpp
The blitter that doesn&#39;t blit.
SpriteLoader::Sprite::y_offs
int16 y_offs
The y-offset of where the sprite will be drawn.
Definition: spriteloader.hpp:40
FBlitter_Null
Factory for the blitter that does nothing.
Definition: null.hpp:41