Made several variables/parameters unsigned in the DX9, DX11 and OGL plugins. They make more sense like this (given their names).

This also gets rid of some more typecasts in some cases.
This commit is contained in:
lioncash
2013-01-16 09:42:51 -05:00
parent 7e5d877858
commit 8743166663
16 changed files with 98 additions and 104 deletions

View File

@ -17,7 +17,7 @@ struct XFBSourceBase
// TODO: only DX9 uses the width/height params
virtual void Draw(const MathUtil::Rectangle<float> &sourcerc,
const MathUtil::Rectangle<float> &drawrc, int width, int height) const = 0;
const MathUtil::Rectangle<float> &drawrc, u32 width, u32 height) const = 0;
virtual void DecodeToTexture(u32 xfbAddr, u32 fbWidth, u32 fbHeight) = 0;

View File

@ -60,12 +60,12 @@ std::string Renderer::s_sScreenshotName;
volatile bool Renderer::s_bScreenshot;
// The framebuffer size
int Renderer::s_target_width;
int Renderer::s_target_height;
unsigned int Renderer::s_target_width;
unsigned int Renderer::s_target_height;
// TODO: Add functionality to reinit all the render targets when the window is resized.
int Renderer::s_backbuffer_width;
int Renderer::s_backbuffer_height;
unsigned int Renderer::s_backbuffer_width;
unsigned int Renderer::s_backbuffer_height;
TargetRectangle Renderer::target_rc;
@ -163,7 +163,7 @@ int Renderer::EFBToScaledY(int y)
};
}
void Renderer::CalculateTargetScale(int x, int y, int &scaledX, int &scaledY)
void Renderer::CalculateTargetScale(unsigned int x, unsigned int y, unsigned int &scaledX, unsigned int &scaledY)
{
if (g_ActiveConfig.iEFBScale == 0 || g_ActiveConfig.iEFBScale == 1)
{
@ -172,15 +172,15 @@ void Renderer::CalculateTargetScale(int x, int y, int &scaledX, int &scaledY)
}
else
{
scaledX = x * (int)efb_scale_numeratorX / (int)efb_scale_denominatorX;
scaledY = y * (int)efb_scale_numeratorY / (int)efb_scale_denominatorY;
scaledX = x * (efb_scale_numeratorX / efb_scale_denominatorX);
scaledY = y * (efb_scale_numeratorY / efb_scale_denominatorY);
}
}
// return true if target size changed
bool Renderer::CalculateTargetSize(unsigned int framebuffer_width, unsigned int framebuffer_height, int multiplier)
bool Renderer::CalculateTargetSize(unsigned int framebuffer_width, unsigned int framebuffer_height, unsigned int multiplier)
{
int newEFBWidth, newEFBHeight;
u32 newEFBWidth, newEFBHeight;
// TODO: Ugly. Clean up
switch (s_LastEFBScale)
@ -374,7 +374,7 @@ void Renderer::DrawDebugText()
// TODO: remove
extern bool g_aspect_wide;
void Renderer::UpdateDrawRectangle(int backbuffer_width, int backbuffer_height)
void Renderer::UpdateDrawRectangle(u32 backbuffer_width, u32 backbuffer_height)
{
float FloatGLWidth = (float)backbuffer_width;
float FloatGLHeight = (float)backbuffer_height;
@ -492,7 +492,7 @@ void Renderer::UpdateDrawRectangle(int backbuffer_width, int backbuffer_height)
target_rc.bottom = YOffset + iHeight;
}
void Renderer::SetWindowSize(int width, int height)
void Renderer::SetWindowSize(u32 width, u32 height)
{
if (width < 1)
width = 1;

View File

@ -67,14 +67,14 @@ public:
virtual void RestoreState() = 0;
// Ideal internal resolution - determined by display resolution (automatic scaling) and/or a multiple of the native EFB resolution
static int GetTargetWidth() { return s_target_width; }
static int GetTargetHeight() { return s_target_height; }
static u32 GetTargetWidth() { return s_target_width; }
static u32 GetTargetHeight() { return s_target_height; }
// Display resolution
static int GetBackbufferWidth() { return s_backbuffer_width; }
static int GetBackbufferHeight() { return s_backbuffer_height; }
static u32 GetBackbufferWidth() { return s_backbuffer_width; }
static u32 GetBackbufferHeight() { return s_backbuffer_height; }
static void SetWindowSize(int width, int height);
static void SetWindowSize(u32 width, u32 height);
// EFB coordinate conversion functions
@ -82,7 +82,7 @@ public:
virtual TargetRectangle ConvertEFBRectangle(const EFBRectangle& rc) = 0;
static const TargetRectangle& GetTargetRectangle() { return target_rc; }
static void UpdateDrawRectangle(int backbuffer_width, int backbuffer_height);
static void UpdateDrawRectangle(u32 backbuffer_width, u32 backbuffer_height);
// Use this to upscale native EFB coordinates to IDEAL internal resolution
@ -132,8 +132,8 @@ public:
protected:
static void CalculateTargetScale(int x, int y, int &scaledX, int &scaledY);
static bool CalculateTargetSize(unsigned int framebuffer_width, unsigned int framebuffer_height, int multiplier = 1);
static void CalculateTargetScale(unsigned int x, unsigned int y, unsigned int &scaledX, unsigned int &scaledY);
static bool CalculateTargetSize(unsigned int framebuffer_width, unsigned int framebuffer_height, unsigned int multiplier = 1);
static void CheckFifoRecording();
static void RecordVideoMemory();
@ -151,12 +151,12 @@ protected:
bool bLastFrameDumped;
// The framebuffer size
static int s_target_width;
static int s_target_height;
static u32 s_target_width;
static u32 s_target_height;
// TODO: Add functionality to reinit all the render targets when the window is resized.
static int s_backbuffer_width;
static int s_backbuffer_height;
static u32 s_backbuffer_width;
static u32 s_backbuffer_height;
static TargetRectangle target_rc;