diff options
author | truebrain <truebrain@openttd.org> | 2011-11-23 19:36:11 +0000 |
---|---|---|
committer | truebrain <truebrain@openttd.org> | 2011-11-23 19:36:11 +0000 |
commit | ecbe29ecb7940a50c631acbae58934537b302e48 (patch) | |
tree | 1ded5d52c95b9c5ab06d3c02f2ffea7a70cf08cd /src | |
parent | b9192bdc4cc56f9d5e046766ca3d589d7cb6ad4d (diff) | |
download | openttd-ecbe29ecb7940a50c631acbae58934537b302e48.tar.xz |
(svn r23311) -Remove: removed the silly blitter called 8bpp-debug. You can find him at the same place as you can find CTRL+D. Sorry for those who liked to trip while playing OpenTTD; I truly am sorry :D
Diffstat (limited to 'src')
-rw-r--r-- | src/blitter/8bpp_debug.cpp | 62 | ||||
-rw-r--r-- | src/blitter/8bpp_debug.hpp | 35 |
2 files changed, 0 insertions, 97 deletions
diff --git a/src/blitter/8bpp_debug.cpp b/src/blitter/8bpp_debug.cpp deleted file mode 100644 index a79eccbd9..000000000 --- a/src/blitter/8bpp_debug.cpp +++ /dev/null @@ -1,62 +0,0 @@ -/* $Id$ */ - -/* - * This file is part of OpenTTD. - * 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. - * 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. - * 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/>. - */ - -/** @file 8bpp_debug.cpp Implementation of 8 bpp debug blitter. */ - -#include "../stdafx.h" -#include "../zoom_func.h" -#include "../core/random_func.hpp" -#include "8bpp_debug.hpp" - -/** Instantiation of the 8bpp debug blitter factory. */ -static FBlitter_8bppDebug iFBlitter_8bppDebug; - -void Blitter_8bppDebug::Draw(Blitter::BlitterParams *bp, BlitterMode mode, ZoomLevel zoom) -{ - const uint8 *src, *src_line; - uint8 *dst, *dst_line; - - /* Find where to start reading in the source sprite */ - src_line = (const uint8 *)bp->sprite + (bp->skip_top * bp->sprite_width + bp->skip_left) * ScaleByZoom(1, zoom); - dst_line = (uint8 *)bp->dst + bp->top * bp->pitch + bp->left; - - for (int y = 0; y < bp->height; y++) { - dst = dst_line; - dst_line += bp->pitch; - - src = src_line; - src_line += bp->sprite_width * ScaleByZoom(1, zoom); - - for (int x = 0; x < bp->width; x++) { - if (*src != 0) *dst = *src; - dst++; - src += ScaleByZoom(1, zoom); - } - assert(src <= src_line); - } -} - -Sprite *Blitter_8bppDebug::Encode(SpriteLoader::Sprite *sprite, AllocatorProc *allocator) -{ - Sprite *dest_sprite; - dest_sprite = (Sprite *)allocator(sizeof(*dest_sprite) + sprite->height * sprite->width); - - dest_sprite->height = sprite->height; - dest_sprite->width = sprite->width; - dest_sprite->x_offs = sprite->x_offs; - dest_sprite->y_offs = sprite->y_offs; - - /* Write a random colour as sprite; this makes debugging really easy */ - uint colour = InteractiveRandom() % 150 + 2; - for (int i = 0; i < sprite->height * sprite->width; i++) { - dest_sprite->data[i] = (sprite->data[i].m == 0) ? 0 : colour; - } - - return dest_sprite; -} diff --git a/src/blitter/8bpp_debug.hpp b/src/blitter/8bpp_debug.hpp deleted file mode 100644 index b020d3b00..000000000 --- a/src/blitter/8bpp_debug.hpp +++ /dev/null @@ -1,35 +0,0 @@ -/* $Id$ */ - -/* - * This file is part of OpenTTD. - * 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. - * 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. - * 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/>. - */ - -/** @file 8bpp_debug.hpp A 8 bpp blitter that uses random colours to show the drawn sprites. */ - -#ifndef BLITTER_8BPP_DEBUG_HPP -#define BLITTER_8BPP_DEBUG_HPP - -#include "8bpp_base.hpp" -#include "factory.hpp" - -/** 8bpp debug blitter; colours each sprite differently. */ -class Blitter_8bppDebug : public Blitter_8bppBase { -public: - /* virtual */ void Draw(Blitter::BlitterParams *bp, BlitterMode mode, ZoomLevel zoom); - /* virtual */ Sprite *Encode(SpriteLoader::Sprite *sprite, AllocatorProc *allocator); - - /* virtual */ const char *GetName() { return "8bpp-debug"; } -}; - -/** Factory for the 8bpp debug blitter. */ -class FBlitter_8bppDebug: public BlitterFactory<FBlitter_8bppDebug> { -public: - /* virtual */ const char *GetName() { return "8bpp-debug"; } - /* virtual */ const char *GetDescription() { return "8bpp Debug Blitter (testing only)"; } - /* virtual */ Blitter *CreateInstance() { return new Blitter_8bppDebug(); } -}; - -#endif /* BLITTER_8BPP_DEBUG_HPP */ |