From 1d98e1c317fa19687ae6bc3cb8e550ef7531bf02 Mon Sep 17 00:00:00 2001 From: aliaspider Date: Wed, 29 Oct 2014 05:28:04 +0100 Subject: cleanups (cont.) --- source/tile.cpp | 238 -------------------------------------------------------- 1 file changed, 238 deletions(-) (limited to 'source/tile.cpp') diff --git a/source/tile.cpp b/source/tile.cpp index 332580a..3dcab74 100644 --- a/source/tile.cpp +++ b/source/tile.cpp @@ -217,244 +217,6 @@ static uint8 ConvertTile (uint8 *pCache, uint32 TileAddr) } #define PLOT_PIXEL(screen, pixel) (pixel) -#ifndef FOREVER_16_BIT -static void WRITE_4PIXELS (int32 Offset, uint8 *Pixels, uint16 *ScreenColors) -{ - uint8 Pixel; - uint8 *Screen = GFX.S + Offset; - uint8 *Depth = GFX.DB + Offset; - - for (uint8 N = 0; N < 4; N++) - { - if (GFX.Z1 > Depth [N] && (Pixel = Pixels[N])) - { - Screen [N] = (uint8) ScreenColors [Pixel]; - Depth [N] = GFX.Z2; - } - } -} - -static void WRITE_4PIXELS_FLIPPED (int32 Offset, uint8 *Pixels, uint16 *ScreenColors) -{ - uint8 Pixel; - uint8 *Screen = GFX.S + Offset; - uint8 *Depth = GFX.DB + Offset; - - for (uint8 N = 0; N < 4; N++) - { - if (GFX.Z1 > Depth [N] && (Pixel = Pixels[3 - N])) - { - Screen [N] = (uint8) ScreenColors [Pixel]; - Depth [N] = GFX.Z2; - } - } -} -static void WRITE_4PIXELS_HALFWIDTH (int32 Offset, uint8 *Pixels, uint16 *ScreenColors) -{ - uint8 Pixel; - uint8 *Screen = GFX.S + Offset; - uint8 *Depth = GFX.DB + Offset; - - for (uint8 N = 0; N < 4; N += 2) - { - if (GFX.Z1 > Depth [N] && (Pixel = Pixels[N])) - { - Screen [N >> 1] = (uint8) ScreenColors [Pixel]; - Depth [N >> 1] = GFX.Z2; - } - } -} - -static void WRITE_4PIXELS_FLIPPED_HALFWIDTH (int32 Offset, uint8 *Pixels, uint16 *ScreenColors) -{ - uint8 Pixel; - uint8 *Screen = GFX.S + Offset; - uint8 *Depth = GFX.DB + Offset; - - for (uint8 N = 0; N < 4; N += 2) - { - if (GFX.Z1 > Depth [N] && (Pixel = Pixels[2 - N])) - { - Screen [N >> 1] = (uint8) ScreenColors [Pixel]; - Depth [N >> 1] = GFX.Z2; - } - } -} - -static void WRITE_4PIXELSx2 (int32 Offset, uint8 *Pixels, uint16 *ScreenColors) -{ - uint8 Pixel; - uint8 *Screen = GFX.S + Offset; - uint8 *Depth = GFX.DB + Offset; - - for (uint8 N = 0; N < 4; N++) - { - if (GFX.Z1 > Depth [N * 2] && (Pixel = Pixels[N])) - { - Screen [N * 2] = Screen [N * 2 + 1] = (uint8) ScreenColors [Pixel]; - Depth [N * 2] = Depth [N * 2 + 1] = GFX.Z2; - } - } -} - -static void WRITE_4PIXELS_FLIPPEDx2 (int32 Offset, uint8 *Pixels, uint16 *ScreenColors) -{ - uint8 Pixel; - uint8 *Screen = GFX.S + Offset; - uint8 *Depth = GFX.DB + Offset; - - for (uint8 N = 0; N < 4; N++) - { - if (GFX.Z1 > Depth [N * 2] && (Pixel = Pixels[3 - N])) - { - Screen [N * 2] = Screen [N * 2 + 1] = (uint8) ScreenColors [Pixel]; - Depth [N * 2] = Depth [N * 2 + 1] = GFX.Z2; - } - } -} - -static void WRITE_4PIXELSx2x2 (int32 Offset, uint8 *Pixels, uint16 *ScreenColors) -{ - uint8 Pixel; - uint8 *Screen = GFX.S + Offset; - uint8 *Depth = GFX.DB + Offset; - - for (uint8 N = 0; N < 4; N++) - { - if (GFX.Z1 > Depth [N * 2] && (Pixel = Pixels[N])) - { - Screen [N * 2] = Screen [N * 2 + 1] = Screen [GFX.RealPitch + N * 2] = Screen [GFX.RealPitch + N * 2 + 1] = (uint8) ScreenColors [Pixel]; - Depth [N * 2] = Depth [N * 2 + 1] = Depth [GFX.RealPitch + N * 2] = Depth [GFX.RealPitch + N * 2 + 1] = GFX.Z2; - } - } -} - -static void WRITE_4PIXELS_FLIPPEDx2x2 (int32 Offset, uint8 *Pixels, uint16 *ScreenColors) -{ - uint8 Pixel; - uint8 *Screen = GFX.S + Offset; - uint8 *Depth = GFX.DB + Offset; - - for (uint8 N = 0; N < 4; N++) - { - if (GFX.Z1 > Depth [N * 2] && (Pixel = Pixels[3 - N])) - { - Screen [N * 2] = Screen [N * 2 + 1] = Screen [GFX.RealPitch + N * 2] = Screen [GFX.RealPitch + N * 2 + 1] = (uint8) ScreenColors [Pixel]; - Depth [N * 2] = Depth [N * 2 + 1] = Depth [GFX.RealPitch + N * 2] = Depth [GFX.RealPitch + N * 2 + 1] = GFX.Z2; - } - } -} - -void DrawTile (uint32 Tile, int32 Offset, uint32 StartLine, - uint32 LineCount) -{ - TILE_PREAMBLE - - register uint8 *bp; - - RENDER_TILE(WRITE_4PIXELS, WRITE_4PIXELS_FLIPPED, 4) -} - -void DrawClippedTile (uint32 Tile, int32 Offset, - uint32 StartPixel, uint32 Width, - uint32 StartLine, uint32 LineCount) -{ - TILE_PREAMBLE - register uint8 *bp; - - TILE_CLIP_PREAMBLE - RENDER_CLIPPED_TILE(WRITE_4PIXELS, WRITE_4PIXELS_FLIPPED, 4) -} - -void DrawTileHalfWidth (uint32 Tile, int32 Offset, uint32 StartLine, - uint32 LineCount) -{ - TILE_PREAMBLE - - register uint8 *bp; - - RENDER_TILE(WRITE_4PIXELS_HALFWIDTH, WRITE_4PIXELS_FLIPPED_HALFWIDTH, 2) -} - -void DrawClippedTileHalfWidth (uint32 Tile, int32 Offset, - uint32 StartPixel, uint32 Width, - uint32 StartLine, uint32 LineCount) -{ - TILE_PREAMBLE - register uint8 *bp; - - TILE_CLIP_PREAMBLE - RENDER_CLIPPED_TILE(WRITE_4PIXELS_HALFWIDTH, WRITE_4PIXELS_FLIPPED_HALFWIDTH, 2) -} - -void DrawTilex2 (uint32 Tile, int32 Offset, uint32 StartLine, - uint32 LineCount) -{ - TILE_PREAMBLE - - register uint8 *bp; - - RENDER_TILE(WRITE_4PIXELSx2, WRITE_4PIXELS_FLIPPEDx2, 8) -} - -void DrawClippedTilex2 (uint32 Tile, int32 Offset, - uint32 StartPixel, uint32 Width, - uint32 StartLine, uint32 LineCount) -{ - TILE_PREAMBLE - register uint8 *bp; - - TILE_CLIP_PREAMBLE - RENDER_CLIPPED_TILE(WRITE_4PIXELSx2, WRITE_4PIXELS_FLIPPEDx2, 8) -} - -void DrawTilex2x2 (uint32 Tile, int32 Offset, uint32 StartLine, - uint32 LineCount) -{ - TILE_PREAMBLE - - register uint8 *bp; - - RENDER_TILE(WRITE_4PIXELSx2x2, WRITE_4PIXELS_FLIPPEDx2x2, 8) -} - -void DrawClippedTilex2x2 (uint32 Tile, int32 Offset, - uint32 StartPixel, uint32 Width, - uint32 StartLine, uint32 LineCount) -{ - TILE_PREAMBLE - register uint8 *bp; - - TILE_CLIP_PREAMBLE - RENDER_CLIPPED_TILE(WRITE_4PIXELSx2x2, WRITE_4PIXELS_FLIPPEDx2x2, 8) -} - -void DrawLargePixel (uint32 Tile, int32 Offset, - uint32 StartPixel, uint32 Pixels, - uint32 StartLine, uint32 LineCount) -{ - TILE_PREAMBLE - - register uint8 *sp = GFX.S + Offset; - uint8 *Depth = GFX.DB + Offset; - uint8 pixel; - - RENDER_TILE_LARGE (((uint8) ScreenColors [pixel]), PLOT_PIXEL) -} - -void DrawLargePixelHalfWidth (uint32 Tile, int32 Offset, - uint32 StartPixel, uint32 Pixels, - uint32 StartLine, uint32 LineCount) -{ - TILE_PREAMBLE - - register uint8 *sp = GFX.S + Offset; - uint8 *Depth = GFX.DB + Offset; - uint8 pixel; - - RENDER_TILE_LARGE_HALFWIDTH (((uint8) ScreenColors [pixel]), PLOT_PIXEL) -} -#endif static void WRITE_4PIXELS16 (int32 Offset, uint8 *Pixels, uint16 *ScreenColors) { -- cgit v1.2.3