diff options
-rw-r--r-- | projects/openttd_vs100.vcxproj | 2 | ||||
-rw-r--r-- | projects/openttd_vs100.vcxproj.filters | 6 | ||||
-rw-r--r-- | projects/openttd_vs80.vcproj | 8 | ||||
-rw-r--r-- | projects/openttd_vs90.vcproj | 8 | ||||
-rw-r--r-- | source.list | 2 | ||||
-rw-r--r-- | src/blitter/8bpp_debug.cpp | 62 | ||||
-rw-r--r-- | src/blitter/8bpp_debug.hpp | 35 |
7 files changed, 0 insertions, 123 deletions
diff --git a/projects/openttd_vs100.vcxproj b/projects/openttd_vs100.vcxproj index 8731a072e..ae342e584 100644 --- a/projects/openttd_vs100.vcxproj +++ b/projects/openttd_vs100.vcxproj @@ -965,8 +965,6 @@ <ClInclude Include="..\src\blitter\32bpp_simple.hpp" /> <ClCompile Include="..\src\blitter\8bpp_base.cpp" /> <ClInclude Include="..\src\blitter\8bpp_base.hpp" /> - <ClCompile Include="..\src\blitter\8bpp_debug.cpp" /> - <ClInclude Include="..\src\blitter\8bpp_debug.hpp" /> <ClCompile Include="..\src\blitter\8bpp_optimized.cpp" /> <ClInclude Include="..\src\blitter\8bpp_optimized.hpp" /> <ClCompile Include="..\src\blitter\8bpp_simple.cpp" /> diff --git a/projects/openttd_vs100.vcxproj.filters b/projects/openttd_vs100.vcxproj.filters index 19200a0cf..7414553d0 100644 --- a/projects/openttd_vs100.vcxproj.filters +++ b/projects/openttd_vs100.vcxproj.filters @@ -2115,12 +2115,6 @@ <ClInclude Include="..\src\blitter\8bpp_base.hpp"> <Filter>Blitters</Filter> </ClInclude> - <ClCompile Include="..\src\blitter\8bpp_debug.cpp"> - <Filter>Blitters</Filter> - </ClCompile> - <ClInclude Include="..\src\blitter\8bpp_debug.hpp"> - <Filter>Blitters</Filter> - </ClInclude> <ClCompile Include="..\src\blitter\8bpp_optimized.cpp"> <Filter>Blitters</Filter> </ClCompile> diff --git a/projects/openttd_vs80.vcproj b/projects/openttd_vs80.vcproj index f12f56261..a91958de8 100644 --- a/projects/openttd_vs80.vcproj +++ b/projects/openttd_vs80.vcproj @@ -3191,14 +3191,6 @@ > </File> <File - RelativePath=".\..\src\blitter\8bpp_debug.cpp" - > - </File> - <File - RelativePath=".\..\src\blitter\8bpp_debug.hpp" - > - </File> - <File RelativePath=".\..\src\blitter\8bpp_optimized.cpp" > </File> diff --git a/projects/openttd_vs90.vcproj b/projects/openttd_vs90.vcproj index 082206aa2..b0ff55897 100644 --- a/projects/openttd_vs90.vcproj +++ b/projects/openttd_vs90.vcproj @@ -3188,14 +3188,6 @@ > </File> <File - RelativePath=".\..\src\blitter\8bpp_debug.cpp" - > - </File> - <File - RelativePath=".\..\src\blitter\8bpp_debug.hpp" - > - </File> - <File RelativePath=".\..\src\blitter\8bpp_optimized.cpp" > </File> diff --git a/source.list b/source.list index 7c63b528a..5b10f43c5 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 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 */ |