Update aurora; CMoviePlayer fixes

This commit is contained in:
Luke Street 2022-07-31 17:03:15 -04:00
parent 94645de53e
commit 324d89693c
3 changed files with 11 additions and 9 deletions

View File

@ -190,7 +190,7 @@ void CGraphics::Render2D(CTexture& tex, u32 x, u32 y, u32 w, u32 h, const zeus::
const auto oldLights = g_LightActive;
SetOrtho(-g_Viewport.x10_halfWidth, g_Viewport.x10_halfWidth, g_Viewport.x14_halfHeight, -g_Viewport.x14_halfHeight,
-1.f, -10.f);
GXLoadPosMtxImm({}, GX_PNMTX0);
GXLoadPosMtxImm(&zeus::skIdentityMatrix4f, GX_PNMTX0);
DisableAllLights();
SetCullMode(ERglCullMode::None);
tex.Load(GX_TEXMAP0, EClampMode::Repeat);
@ -273,11 +273,6 @@ void CGraphics::SetModelMatrix(const zeus::CTransform& xf) {
SetViewMatrix();
}
constexpr zeus::CMatrix4f PlusOneZ(1.f, 0.f, 0.f, 0.f, 0.f, 1.f, 0.f, 0.f, 0.f, 0.f, 1.f, 1.f, 0.f, 0.f, 0.f, 1.f);
constexpr zeus::CMatrix4f VulkanCorrect(1.f, 0.f, 0.f, 0.f, 0.f, -1.f, 0.f, 0.f, 0.f, 0.f, 0.5f, 0.5f + FLT_EPSILON,
0.f, 0.f, 0.f, 1.f);
zeus::CMatrix4f CGraphics::CalculatePerspectiveMatrix(float fovy, float aspect, float znear, float zfar) {
CProjectionState st;
float tfov = std::tan(zeus::degToRad(fovy * 0.5f));

View File

@ -78,8 +78,8 @@ static void MyTHPGXYuv2RgbSetup(bool interlaced2ndFrame, bool fieldFlip) {
GXSetColorUpdate(true);
GXSetAlphaUpdate(false);
GXInvalidateTexAll();
GXSetVtxAttrFmt(GX_VTXFMT7, GX_VA_POS, GX_CLR_RGBA, GX_F32, 0);
GXSetVtxAttrFmt(GX_VTXFMT7, GX_VA_TEX0, GX_CLR_RGBA, GX_RGBX8, 0);
GXSetVtxAttrFmt(GX_VTXFMT7, GX_VA_POS, GX_POS_XYZ, GX_F32, 0);
GXSetVtxAttrFmt(GX_VTXFMT7, GX_VA_TEX0, GX_TEX_ST, GX_U16, 0);
CGX::SetTevOrder(GX_TEVSTAGE0, GX_TEXCOORD1, GX_TEXMAP1, GX_COLOR_NULL);
CGX::SetTevColorIn(GX_TEVSTAGE0, GX_CC_ZERO, GX_CC_TEXC, GX_CC_KONST, GX_CC_C0);
CGX::SetTevColorOp(GX_TEVSTAGE0, GX_TEV_ADD, GX_TB_ZERO, GX_CS_SCALE_1, false, GX_TEVPREV);
@ -484,8 +484,15 @@ bool CMoviePlayer::DrawVideo() {
const s32 vpWidth = CGraphics::GetViewportWidth();
const s32 vpTop = CGraphics::GetViewportTop();
const s32 vpLeft = CGraphics::GetViewportLeft();
#ifdef AURORA
// Scale to full size, maintaining aspect ratio
float vidAspect = static_cast<float>(x6c_videoInfo.width) / static_cast<float>(x6c_videoInfo.height);
const s32 vidWidth = vpHeight * vidAspect;
const s32 vidHeight = vpHeight;
#else
const s32 vidWidth = x6c_videoInfo.width;
const s32 vidHeight = x6c_videoInfo.height;
#endif
const s32 centerX = (vidWidth - vpWidth) / 2;
const s32 centerY = (vidHeight - vpHeight) / 2;
const s32 vl = vpLeft - centerX;

2
extern/aurora vendored

@ -1 +1 @@
Subproject commit e22541f1750128a4386759ee4f8c21565619a020
Subproject commit 04590f30cd90814d70fa7d1fe4a5f1e814b177c2