common/vector_math: Move Vec[x] types into the Common namespace

These types are within the common library, so they should be using the
Common namespace.
This commit is contained in:
Lioncash 2019-02-26 22:38:34 -05:00 committed by fearlessTobi
parent db58652680
commit 643472e24a
40 changed files with 309 additions and 301 deletions

View file

@ -69,14 +69,14 @@ union ETC1Tile {
BitField<60, 4, u64> r1;
} separate;
const Math::Vec3<u8> GetRGB(unsigned int x, unsigned int y) const {
const Common::Vec3<u8> GetRGB(unsigned int x, unsigned int y) const {
int texel = 4 * x + y;
if (flip)
std::swap(x, y);
// Lookup base value
Math::Vec3<int> ret;
Common::Vec3<int> ret;
if (differential_mode) {
ret.r() = static_cast<int>(differential.r);
ret.g() = static_cast<int>(differential.g);
@ -119,7 +119,7 @@ union ETC1Tile {
} // anonymous namespace
Math::Vec3<u8> SampleETC1Subtile(u64 value, unsigned int x, unsigned int y) {
Common::Vec3<u8> SampleETC1Subtile(u64 value, unsigned int x, unsigned int y) {
ETC1Tile tile{value};
return tile.GetRGB(x, y);
}

View file

@ -9,6 +9,6 @@
namespace Pica::Texture {
Math::Vec3<u8> SampleETC1Subtile(u64 value, unsigned int x, unsigned int y);
Common::Vec3<u8> SampleETC1Subtile(u64 value, unsigned int x, unsigned int y);
} // namespace Pica::Texture

View file

@ -56,8 +56,8 @@ size_t CalculateTileSize(TextureFormat format) {
}
}
Math::Vec4<u8> LookupTexture(const u8* source, unsigned int x, unsigned int y,
const TextureInfo& info, bool disable_alpha) {
Common::Vec4<u8> LookupTexture(const u8* source, unsigned int x, unsigned int y,
const TextureInfo& info, bool disable_alpha) {
// Coordinate in tiles
const unsigned int coarse_x = x / 8;
const unsigned int coarse_y = y / 8;
@ -71,8 +71,8 @@ Math::Vec4<u8> LookupTexture(const u8* source, unsigned int x, unsigned int y,
return LookupTexelInTile(tile, fine_x, fine_y, info, disable_alpha);
}
Math::Vec4<u8> LookupTexelInTile(const u8* source, unsigned int x, unsigned int y,
const TextureInfo& info, bool disable_alpha) {
Common::Vec4<u8> LookupTexelInTile(const u8* source, unsigned int x, unsigned int y,
const TextureInfo& info, bool disable_alpha) {
DEBUG_ASSERT(x < 8);
DEBUG_ASSERT(y < 8);
@ -200,8 +200,8 @@ Math::Vec4<u8> LookupTexelInTile(const u8* source, unsigned int x, unsigned int
u64_le subtile_data;
memcpy(&subtile_data, subtile_ptr, sizeof(u64));
return Math::MakeVec(SampleETC1Subtile(subtile_data, x, y),
disable_alpha ? (u8)255 : alpha);
return Common::MakeVec(SampleETC1Subtile(subtile_data, x, y),
disable_alpha ? (u8)255 : alpha);
}
default:

View file

@ -40,8 +40,8 @@ struct TextureInfo {
* channel.
* @todo Eventually we should get rid of the disable_alpha parameter.
*/
Math::Vec4<u8> LookupTexture(const u8* source, unsigned int x, unsigned int y,
const TextureInfo& info, bool disable_alpha = false);
Common::Vec4<u8> LookupTexture(const u8* source, unsigned int x, unsigned int y,
const TextureInfo& info, bool disable_alpha = false);
/**
* Looks up a texel from a single 8x8 texture tile.
@ -52,7 +52,7 @@ Math::Vec4<u8> LookupTexture(const u8* source, unsigned int x, unsigned int y,
* @param disable_alpha Used for debugging. Sets the result alpha to 255 and either discards the
* real alpha or inserts it in an otherwise unused channel.
*/
Math::Vec4<u8> LookupTexelInTile(const u8* source, unsigned int x, unsigned int y,
const TextureInfo& info, bool disable_alpha);
Common::Vec4<u8> LookupTexelInTile(const u8* source, unsigned int x, unsigned int y,
const TextureInfo& info, bool disable_alpha);
} // namespace Pica::Texture