From e271463efa84bce96b60acf8cdab497720e07bf9 Mon Sep 17 00:00:00 2001 From: truebrain Date: Wed, 23 Nov 2011 19:36:11 +0000 Subject: [PATCH] (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 --- projects/openttd_vs100.vcxproj | 2 - projects/openttd_vs100.vcxproj.filters | 6 --- projects/openttd_vs80.vcproj | 8 ---- projects/openttd_vs90.vcproj | 8 ---- source.list | 2 - src/blitter/8bpp_debug.cpp | 62 -------------------------- src/blitter/8bpp_debug.hpp | 35 --------------- 7 files changed, 123 deletions(-) delete mode 100644 src/blitter/8bpp_debug.cpp delete mode 100644 src/blitter/8bpp_debug.hpp diff --git a/projects/openttd_vs100.vcxproj b/projects/openttd_vs100.vcxproj index 8731a072e7..ae342e584f 100644 --- a/projects/openttd_vs100.vcxproj +++ b/projects/openttd_vs100.vcxproj @@ -965,8 +965,6 @@ - - diff --git a/projects/openttd_vs100.vcxproj.filters b/projects/openttd_vs100.vcxproj.filters index 19200a0cfd..7414553d0a 100644 --- a/projects/openttd_vs100.vcxproj.filters +++ b/projects/openttd_vs100.vcxproj.filters @@ -2115,12 +2115,6 @@ Blitters - - Blitters - - - Blitters - Blitters diff --git a/projects/openttd_vs80.vcproj b/projects/openttd_vs80.vcproj index f12f562614..a91958de86 100644 --- a/projects/openttd_vs80.vcproj +++ b/projects/openttd_vs80.vcproj @@ -3190,14 +3190,6 @@ RelativePath=".\..\src\blitter\8bpp_base.hpp" > - - - - diff --git a/projects/openttd_vs90.vcproj b/projects/openttd_vs90.vcproj index 082206aa2e..b0ff55897f 100644 --- a/projects/openttd_vs90.vcproj +++ b/projects/openttd_vs90.vcproj @@ -3187,14 +3187,6 @@ RelativePath=".\..\src\blitter\8bpp_base.hpp" > - - - - diff --git a/source.list b/source.list index 7c63b528a8..5b10f43c5f 100644 --- a/source.list +++ b/source.list @@ -745,8 +745,6 @@ blitter/32bpp_simple.cpp blitter/32bpp_simple.hpp blitter/8bpp_base.cpp blitter/8bpp_base.hpp -blitter/8bpp_debug.cpp -blitter/8bpp_debug.hpp blitter/8bpp_optimized.cpp blitter/8bpp_optimized.hpp blitter/8bpp_simple.cpp diff --git a/src/blitter/8bpp_debug.cpp b/src/blitter/8bpp_debug.cpp deleted file mode 100644 index a79eccbd9f..0000000000 --- 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 . - */ - -/** @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 b020d3b007..0000000000 --- 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 . - */ - -/** @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 { -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 */