#pragma once12#include "TransformUnit.h" // for VertexData34// Contains fast-paths for rectangles. Mainly for use in DarkStalkers which requires software5// rendering to work correctly, but will benefit other games as well.6// It also handles a bypass for DarkStalkers to avoid first stretching the image to 480x272.7// This greatly improves image quality and speeds things up a lot. Not happy about the grossness8// of the hack but it's just a huge waste of CPU and image quality not to do it.910// The long term goal is to get rid of the specializations by jitting, but it still makes11// sense to specifically detect rectangles that do 1:1 texture mapping (like a sprite), because12// the JIT will then be able to eliminate UV interpolation.1314class BinManager;15struct BinCoords;1617namespace Rasterizer {18// Returns true if the normal path should be skipped.19bool RectangleFastPath(const VertexData &v0, const VertexData &v1, BinManager &binner);20void DrawSprite(const VertexData &v0, const VertexData &v1, const BinCoords &range, const RasterizerState &state);2122bool DetectRectangleFromStrip(const RasterizerState &state, const ClipVertexData data[4], int *tlIndex, int *brIndex);23bool DetectRectangleFromFan(const RasterizerState &state, const ClipVertexData *data, int *tlIndex, int *brIndex);24bool DetectRectangleFromPair(const RasterizerState &state, const ClipVertexData data[6], int *tlIndex, int *brIndex);25bool DetectRectangleThroughModeSlices(const RasterizerState &state, const ClipVertexData data[4]);26}272829