diff options
| author | hrydgard <hrydgard@gmail.com> | 2008-10-27 21:38:30 +0000 |
|---|---|---|
| committer | hrydgard <hrydgard@gmail.com> | 2008-10-27 21:38:30 +0000 |
| commit | 5129341a9cd08da1f7d004d0f8242f3555844443 (patch) | |
| tree | 4e4ab1403bb935b3d6d3236afa72405239a8d8b7 /Source/Core/VideoCommon | |
| parent | d35fb4e2b0aedcb494f5769dc6c8e437e306238a (diff) | |
Aligned all vertex components to 4 byte boundaries - maybe ATI likes that? Renamed and reorganized misc things.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@981 8ced0084-cf51-0410-be5f-012b33b47a6e
Diffstat (limited to 'Source/Core/VideoCommon')
| -rw-r--r-- | Source/Core/VideoCommon/Src/NativeVertexFormat.h | 1 | ||||
| -rw-r--r-- | Source/Core/VideoCommon/Src/TextureDecoder.cpp | 11 | ||||
| -rw-r--r-- | Source/Core/VideoCommon/Src/XFMemory.cpp | 2 | ||||
| -rw-r--r-- | Source/Core/VideoCommon/Src/XFMemory.h | 2 |
4 files changed, 9 insertions, 7 deletions
diff --git a/Source/Core/VideoCommon/Src/NativeVertexFormat.h b/Source/Core/VideoCommon/Src/NativeVertexFormat.h index 2f3dd08f9b..64382ff040 100644 --- a/Source/Core/VideoCommon/Src/NativeVertexFormat.h +++ b/Source/Core/VideoCommon/Src/NativeVertexFormat.h @@ -75,7 +75,6 @@ public: // TODO: move these in under private:
int m_VBVertexStride; // PC-side vertex stride
- int m_VBStridePad;
u32 m_components; // VB_HAS_X. Bitmask telling what vertex components are present.
};
diff --git a/Source/Core/VideoCommon/Src/TextureDecoder.cpp b/Source/Core/VideoCommon/Src/TextureDecoder.cpp index 0cb6353a0e..295577ced7 100644 --- a/Source/Core/VideoCommon/Src/TextureDecoder.cpp +++ b/Source/Core/VideoCommon/Src/TextureDecoder.cpp @@ -284,15 +284,15 @@ inline void decodebytesARGB8_4(u32 *dst, const u16 *src, const u16 *src2) inline u32 makecol(int r, int g, int b, int a)
{
- return ((a&255)<<24)|((r&255)<<16)|((g&255)<<8)|((b&255));
+ return (a<<24)|(r<<16)|(g<<8)|b;
}
void decodeDXTBlock(u32 *dst, const DXTBlock *src, int pitch)
{
u16 c1 = Common::swap16(src->color1);
u16 c2 = Common::swap16(src->color2);
- int blue1 = lut5to8[c1&0x1F];
- int blue2 = lut5to8[c2&0x1F];
+ int blue1 = lut5to8[c1 & 0x1F];
+ int blue2 = lut5to8[c2 & 0x1F];
int green1 = lut6to8[(c1>>5) & 0x3F];
int green2 = lut6to8[(c2>>5) & 0x3F];
int red1 = lut5to8[(c1>>11) & 0x1F];
@@ -320,7 +320,7 @@ void decodeDXTBlock(u32 *dst, const DXTBlock *src, int pitch) int val = src->lines[y];
for (int x = 0; x < 4; x++)
{
- dst[x] = colors[(val>>6) & 3];
+ dst[x] = colors[(val >> 6) & 3];
val <<= 2;
}
dst += pitch;
@@ -515,11 +515,12 @@ PC_TexFormat TexDecoder_Decode(u8 *dst, const u8 *src, int width, int height, in }
}
return PC_TEX_FMT_BGRA32;
- case GX_TF_CMPR:
+ case GX_TF_CMPR: // speed critical
{
// TODO: Shuffle to PC S3TC (DXTC) format instead of converting
// 11111111 22222222 55555555 66666666
// 33333333 44444444 77777777 88888888
+ // The metroid games use this format almost exclusively.
for (int y = 0; y < height; y += 8)
for (int x = 0; x < width; x += 8)
{
diff --git a/Source/Core/VideoCommon/Src/XFMemory.cpp b/Source/Core/VideoCommon/Src/XFMemory.cpp index 3641d9f65c..44000613c6 100644 --- a/Source/Core/VideoCommon/Src/XFMemory.cpp +++ b/Source/Core/VideoCommon/Src/XFMemory.cpp @@ -19,4 +19,4 @@ // STATE_TO_SAVE
XFRegisters xfregs;
-u32 xfmem[XFMEM_SIZE]; +u32 xfmem[XFMEM_SIZE];
diff --git a/Source/Core/VideoCommon/Src/XFMemory.h b/Source/Core/VideoCommon/Src/XFMemory.h index caea564080..398b0caa7d 100644 --- a/Source/Core/VideoCommon/Src/XFMemory.h +++ b/Source/Core/VideoCommon/Src/XFMemory.h @@ -173,6 +173,8 @@ struct XFRegisters ColorChannel colChans[2]; //C0A0 C1A1
TexCoordInfo texcoords[8];
bool bEnableDualTexTransform;
+ float rawViewport[6];
+ float rawProjection[7];
};
#define XFMEM_SIZE 0x8000
|
