Formatting cleanup for VideoCommon.

Block braces on new lines.

Also killed off trailing whitespace and dangling elses.

Spaced some things out to make them more readable (only in places where it looked like a bit of a clusterfuck).
This commit is contained in:
Lioncash
2013-04-24 09:21:54 -04:00
parent c118c71eac
commit 8da425b008
35 changed files with 559 additions and 258 deletions

View File

@ -62,23 +62,30 @@ public:
_PIXELSHADERUID(const _PIXELSHADERUID& r)
{
num_values = r.num_values;
if (safe) memcpy(values, r.values, PIXELSHADERUID_MAX_VALUES_SAFE);
else memcpy(values, r.values, r.GetNumValues() * sizeof(values[0]));
if (safe)
memcpy(values, r.values, PIXELSHADERUID_MAX_VALUES_SAFE);
else
memcpy(values, r.values, r.GetNumValues() * sizeof(values[0]));
}
int GetNumValues() const
{
if (safe) return (sizeof(values) / sizeof(u32));
else return num_values;
if (safe)
return (sizeof(values) / sizeof(u32));
else
return num_values;
}
bool operator <(const _PIXELSHADERUID& _Right) const
{
int N = GetNumValues();
if (N < _Right.GetNumValues())
return true;
else if (N > _Right.GetNumValues())
return false;
for (int i = 0; i < N; ++i)
{
if (values[i] < _Right.values[i])
@ -86,22 +93,27 @@ public:
else if (values[i] > _Right.values[i])
return false;
}
return false;
}
bool operator ==(const _PIXELSHADERUID& _Right) const
{
int N = GetNumValues();
if (N != _Right.GetNumValues())
return false;
for (int i = 0; i < N; ++i)
{
if (values[i] != _Right.values[i])
return false;
}
return true;
}
};
typedef _PIXELSHADERUID<false> PIXELSHADERUID;
typedef _PIXELSHADERUID<true> PIXELSHADERUIDSAFE;