Replace EFBRectangle/TargetRectangle with MathUtil::Rectangle

This commit is contained in:
Stenzek
2019-04-16 00:47:46 +10:00
parent 6ea43235d5
commit f8c1ba409c
27 changed files with 106 additions and 124 deletions

View File

@ -3,11 +3,6 @@
// Refer to the license.txt file included.
#pragma once
#ifdef _WIN32
#include <windows.h>
#endif
#include "Common/CommonTypes.h"
#include "Common/MathUtil.h"
@ -31,34 +26,6 @@ const u32 MAX_XFB_WIDTH = 720;
// that are next to each other in memory (TODO: handle that situation).
const u32 MAX_XFB_HEIGHT = 576;
// This structure should only be used to represent a rectangle in EFB
// coordinates, where the origin is at the upper left and the frame dimensions
// are 640 x 528.
typedef MathUtil::Rectangle<int> EFBRectangle;
// This structure should only be used to represent a rectangle in standard target
// coordinates, where the origin is at the lower left and the frame dimensions
// depend on the resolution settings. Use Renderer::ConvertEFBRectangle to
// convert an EFBRectangle to a TargetRectangle.
struct TargetRectangle : public MathUtil::Rectangle<int>
{
#ifdef _WIN32
// Only used by D3D backend.
const RECT* AsRECT() const
{
// The types are binary compatible so this works.
return (const RECT*)this;
}
RECT* AsRECT()
{
// The types are binary compatible so this works.
return (RECT*)this;
}
#endif
TargetRectangle(const MathUtil::Rectangle<int>& other) : MathUtil::Rectangle<int>(other) {}
TargetRectangle() = default;
};
#ifdef _WIN32
#define PRIM_LOG(...) DEBUG_LOG(VIDEO, __VA_ARGS__)
#else