mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-07-07 12:03:24 -04:00
Widescreen rework & IR scaling
This commit is contained in:
Vendored
+1
-1
Submodule extern/aurora updated: aa83f6d915...62c7ef68e8
@@ -73,6 +73,7 @@ struct UserSettings {
|
||||
ConfigVar<float> bloomMultiplier;
|
||||
ConfigVar<bool> enableWaterRefraction;
|
||||
ConfigVar<bool> enableFrameInterpolation;
|
||||
ConfigVar<int> internalResolutionScale;
|
||||
ConfigVar<int> shadowResolutionMultiplier;
|
||||
|
||||
// Audio
|
||||
|
||||
@@ -286,12 +286,7 @@ public:
|
||||
#if WIDESCREEN_SUPPORT
|
||||
static void setTvSize();
|
||||
|
||||
#if TARGET_PC
|
||||
static void onWide(f32 width, f32 height);
|
||||
#else
|
||||
static void onWide();
|
||||
#endif
|
||||
|
||||
static void offWide();
|
||||
static u8 isWide();
|
||||
|
||||
@@ -304,7 +299,7 @@ public:
|
||||
#endif
|
||||
|
||||
#if TARGET_PC
|
||||
static void setWindowSize(AuroraWindowSize const& size);
|
||||
static void updateRenderSize();
|
||||
#endif
|
||||
|
||||
static TGXTexObj mFrameBufferTexObj;
|
||||
|
||||
@@ -33,24 +33,16 @@ public:
|
||||
static void postRetraceProc(u32);
|
||||
static void drawDoneCallback();
|
||||
|
||||
u16 getFbWidth() const {
|
||||
#if TARGET_PC
|
||||
return m_WindowSize.fb_width;
|
||||
#else
|
||||
return mRenderObj->fbWidth;
|
||||
#endif
|
||||
}
|
||||
u16 getEfbHeight() const {
|
||||
#if TARGET_PC
|
||||
return m_WindowSize.fb_height;
|
||||
#else
|
||||
return mRenderObj->efbHeight;
|
||||
#endif
|
||||
}
|
||||
u16 getFbWidth() const { return mRenderObj->fbWidth; }
|
||||
u16 getEfbHeight() const { return mRenderObj->efbHeight; }
|
||||
void getBounds(u16& width, u16& height) const {
|
||||
width = (u16)getFbWidth();
|
||||
height = (u16)getEfbHeight();
|
||||
}
|
||||
#ifdef TARGET_PC
|
||||
u32 getRenderWidth() const { return mRenderWidth; }
|
||||
u32 getRenderHeight() const { return mRenderHeight; }
|
||||
#endif
|
||||
u16 getXfbHeight() const { return u16(mRenderObj->xfbHeight); }
|
||||
u8 isAntiAliasing() const { return u8(mRenderObj->aa); }
|
||||
Pattern getSamplePattern() const { return mRenderObj->sample_pattern; }
|
||||
@@ -63,7 +55,7 @@ public:
|
||||
|
||||
GXRenderModeObj* getRenderMode() const { return mRenderObj; }
|
||||
#if TARGET_PC
|
||||
void setWindowSize(AuroraWindowSize const& size);
|
||||
void setRenderSize(u32 width, u32 height);
|
||||
#endif
|
||||
|
||||
private:
|
||||
@@ -89,7 +81,8 @@ private:
|
||||
|
||||
#if TARGET_PC
|
||||
public:
|
||||
AuroraWindowSize m_WindowSize;
|
||||
u32 mRenderWidth;
|
||||
u32 mRenderHeight;
|
||||
#endif
|
||||
};
|
||||
|
||||
|
||||
@@ -64,10 +64,6 @@ void J2DGrafContext::setup2D() {
|
||||
}
|
||||
|
||||
void J2DGrafContext::setScissor() {
|
||||
#if TARGET_PC
|
||||
GXSetScissor(mScissorBounds.i.x, mScissorBounds.i.y, mScissorBounds.getWidth(),
|
||||
mScissorBounds.getHeight());
|
||||
#else
|
||||
JGeometry::TBox2<f32> bounds(0, 0, 1024, 1024);
|
||||
JGeometry::TBox2<f32> curBounds(mScissorBounds);
|
||||
mScissorBounds.intersect(bounds);
|
||||
@@ -81,7 +77,6 @@ void J2DGrafContext::setScissor() {
|
||||
} else {
|
||||
GXSetScissor(0, 0, 0, 0);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void J2DGrafContext::scissor(JGeometry::TBox2<f32> const& bounds) {
|
||||
|
||||
@@ -205,7 +205,8 @@ void JUTVideo::setRenderMode(GXRenderModeObj const* pObj) {
|
||||
void JUTVideo::waitRetraceIfNeed() {}
|
||||
|
||||
#if TARGET_PC
|
||||
void JUTVideo::setWindowSize(AuroraWindowSize const& size) {
|
||||
m_WindowSize = size;
|
||||
void JUTVideo::setRenderSize(u32 width, u32 height) {
|
||||
mRenderWidth = width;
|
||||
mRenderHeight = height;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -3342,13 +3342,8 @@ static void daMP_THPGXYuv2RgbSetup(const GXRenderModeObj* rmode) {
|
||||
Mtx44 m;
|
||||
Mtx e_m;
|
||||
|
||||
#if TARGET_PC
|
||||
w = JUTVideo::getManager()->getFbWidth();
|
||||
h = JUTVideo::getManager()->getEfbHeight();
|
||||
#else
|
||||
w = rmode->fbWidth;
|
||||
h = rmode->efbHeight;
|
||||
#endif
|
||||
var_f31 = 0.0f;
|
||||
|
||||
#if WIDESCREEN_SUPPORT
|
||||
|
||||
@@ -3870,16 +3870,10 @@ void dFile_select_c::_draw() {
|
||||
dComIfGd_set2DOpa(mSelIcon2);
|
||||
|
||||
#if PLATFORM_GCN
|
||||
#if TARGET_PC
|
||||
mpFadePict->draw(0, 0,
|
||||
mDoGph_gInf_c::getWidth(), mDoGph_gInf_c::getHeight(), false, false,
|
||||
false);
|
||||
#else
|
||||
mpFadePict->draw(mDoGph_gInf_c::getMinXF(), mDoGph_gInf_c::getMinYF(),
|
||||
mDoGph_gInf_c::getWidthF(), mDoGph_gInf_c::getHeightF(), false, false,
|
||||
false);
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -37,11 +37,10 @@ void dDlst_Gameover_CAPTURE_c::draw() {
|
||||
TGXTexObj tex_obj;
|
||||
Mtx44 m;
|
||||
|
||||
#if TARGET_PC
|
||||
GXSetTexCopySrc(0, 0, mDoGph_gInf_c::getWidth(), mDoGph_gInf_c::getHeight());
|
||||
GXSetTexCopyDst(mDoGph_gInf_c::getWidth(), mDoGph_gInf_c::getHeight(), GX_TF_RGB565, GX_TRUE);
|
||||
#else
|
||||
GXSetTexCopySrc(0, 0, FB_WIDTH, FB_HEIGHT);
|
||||
#if TARGET_PC
|
||||
GXSetTexCopyDst(FB_WIDTH, FB_HEIGHT, GX_TF_RGB565, GX_FALSE);
|
||||
#else
|
||||
GXSetTexCopyDst(FB_WIDTH / 2, FB_HEIGHT / 2, GX_TF_RGB565, GX_TRUE);
|
||||
#endif
|
||||
GXCopyTex(mDoGph_gInf_c::mZbufferTex, 0);
|
||||
|
||||
+7
-16
@@ -16,10 +16,6 @@
|
||||
|
||||
#ifdef TARGET_PC
|
||||
constexpr u16 kMapResolutionMultiplier = 4;
|
||||
// Line widths are relative to the framebuffer size. Since we're rendering to a separate
|
||||
// framebuffer, we have to scale them accordingly. The original game used about half of the
|
||||
// EFB for the map rendering, so this is a reasonable approximation.
|
||||
constexpr u8 kMapLineWidthMultiplier = 2;
|
||||
#endif
|
||||
|
||||
void dMpath_n::dTexObjAggregate_c::create() {
|
||||
@@ -242,11 +238,7 @@ void dDrawPath_c::rendering(dDrawPath_c::line_class const* p_line) {
|
||||
int width = getLineWidth(p_line->field_0x1);
|
||||
|
||||
if (width > 0 && p_line->mDataNum >= 2) {
|
||||
#ifdef TARGET_PC
|
||||
GXSetLineWidth(width * kMapLineWidthMultiplier, GX_TO_ZERO);
|
||||
#else
|
||||
GXSetLineWidth(width * 2, GX_TO_ZERO);
|
||||
#endif
|
||||
GXSetLineWidth(width, GX_TO_ZERO);
|
||||
GXSetTevColor(GX_TEVREG0, *getLineColor(p_line->field_0x0 & 0x3F, p_line->field_0x1));
|
||||
GXBegin(GX_LINESTRIP, GX_VTXFMT0, p_line->mDataNum);
|
||||
|
||||
@@ -435,8 +427,12 @@ void dRenderingFDAmap_c::preRenderingMap() {
|
||||
const u16 w = mTexWidth * kMapResolutionMultiplier;
|
||||
const u16 h = mTexHeight * kMapResolutionMultiplier;
|
||||
GXCreateFrameBuffer(w, h);
|
||||
GXSetViewport(0.0f, 0.0f, w, h, 0.0f, 1.0f);
|
||||
GXSetScissor(0, 0, w, h);
|
||||
// Set logical viewport dimensions
|
||||
GXSetViewport(0.0f, 0.0f, mTexWidth, mTexHeight, 0.0f, 1.0f);
|
||||
GXSetScissor(0, 0, mTexWidth, mTexHeight);
|
||||
// Set render viewport dimensions
|
||||
GXSetViewportRender(0.0f, 0.0f, w, h, 0.0f, 1.0f);
|
||||
GXSetScissorRender(0, 0, w, h);
|
||||
#else
|
||||
GXSetViewport(0.0f, 0.0f, mTexWidth, mTexHeight, 0.0f, 1.0f);
|
||||
GXSetScissor(0, 0, mTexWidth, mTexHeight);
|
||||
@@ -517,13 +513,8 @@ void dRenderingFDAmap_c::renderingDecoration(dDrawPath_c::line_class const* p_li
|
||||
|
||||
BE(u16)* data_p = p_line->mpData;
|
||||
s32 data_num = p_line->mDataNum;
|
||||
#ifdef TARGET_PC
|
||||
GXSetLineWidth(width * kMapLineWidthMultiplier, GX_TO_ZERO);
|
||||
GXSetPointSize(width * kMapLineWidthMultiplier, GX_TO_ONE);
|
||||
#else
|
||||
GXSetLineWidth(width, GX_TO_ONE);
|
||||
GXSetPointSize(width, GX_TO_ONE);
|
||||
#endif
|
||||
GXColor lineColor = *getDecoLineColor(p_line->field_0x0 & 0x3f, p_line->field_0x1);
|
||||
GXSetTevColor(GX_TEVREG0, lineColor);
|
||||
lineColor.r = lineColor.r - 4;
|
||||
|
||||
@@ -2688,12 +2688,7 @@ u8 dMenu_Collect3D_c::getMaskMdlVisible() {
|
||||
f32 dMenu_Collect3D_c::mViewOffsetY = -100.0f;
|
||||
|
||||
void dMenu_Collect3D_c::setupItem3D(Mtx param_0) {
|
||||
#if TARGET_PC
|
||||
f32 scaleFactor = mDoGph_gInf_c::getHeight() / FB_HEIGHT;
|
||||
GXSetViewport(0.0f, mViewOffsetY * scaleFactor, mDoGph_gInf_c::getWidth(), mDoGph_gInf_c::getHeight(), 0.0f, 1.0f);
|
||||
#else
|
||||
GXSetViewport(0.0f, mViewOffsetY, FB_WIDTH, FB_HEIGHT, 0.0f, 1.0f);
|
||||
#endif
|
||||
mViewOffsetY = -100.0f;
|
||||
Mtx44 projection;
|
||||
C_MTXPerspective(projection, 45.0f, mDoGph_gInf_c::getAspect(), 1.0f, 100000.0f);
|
||||
|
||||
+1
-29
@@ -864,33 +864,15 @@ void dMenu_DmapBg_c::draw() {
|
||||
J2DOrthoGraph* grafContext = (J2DOrthoGraph*)dComIfGp_getCurrentGrafPort();
|
||||
grafContext->setup2D();
|
||||
|
||||
#if TARGET_PC
|
||||
// GXGetScissor uses 11-bit GC register fields (max 2047) which overflow
|
||||
// at window widths > ~1705px, producing garbage values on restore.
|
||||
scissor_left = 0;
|
||||
scissor_top = 0;
|
||||
scissor_width = (u32)mDoGph_gInf_c::getWidth();
|
||||
scissor_height = (u32)mDoGph_gInf_c::getHeight();
|
||||
#else
|
||||
GXGetScissor(&scissor_left, &scissor_top, &scissor_width, &scissor_height);
|
||||
#endif
|
||||
#if TARGET_PC
|
||||
grafContext->scissor(field_0xd94, 0.0f, mDoGph_gInf_c::getWidth(), mDoGph_gInf_c::getHeight());
|
||||
#else
|
||||
grafContext->scissor(field_0xd94, 0.0f, FB_WIDTH, FB_HEIGHT);
|
||||
#endif
|
||||
grafContext->scissor(field_0xd94, 0.0f, FB_WIDTH, FB_HEIGHT);
|
||||
grafContext->setScissor();
|
||||
|
||||
mBaseScreen->draw(field_0xd94, field_0xd98, grafContext);
|
||||
dMenu_Dmap_c::myclass->drawFloorScreenBack(mFloorScreen, field_0xd94, field_0xd98, grafContext);
|
||||
|
||||
#if TARGET_PC
|
||||
f32 dVar21 = mDoGph_gInf_c::getWidthF() / mDoGph_gInf_c::getWidth();
|
||||
f32 dVar16 = mDoGph_gInf_c::getHeightF() / mDoGph_gInf_c::getHeight();
|
||||
#else
|
||||
f32 dVar21 = mDoGph_gInf_c::getWidthF() / FB_WIDTH;
|
||||
f32 dVar16 = mDoGph_gInf_c::getHeightF() / FB_HEIGHT;
|
||||
#endif
|
||||
mMapScreen[0]->draw(field_0xd94, field_0xd98, grafContext);
|
||||
|
||||
if (mpBackTexture != NULL) {
|
||||
@@ -922,15 +904,9 @@ void dMenu_DmapBg_c::draw() {
|
||||
mpBackTexture->draw(local_28c, field_0xd94 + mpBackTexture->getBounds().i.y, mpBackTexture->getWidth(),
|
||||
mpBackTexture->getHeight(), false, false, false);
|
||||
|
||||
#if TARGET_PC
|
||||
grafContext->scissor(field_0xd94,
|
||||
0, mDoGph_gInf_c::getWidth(),
|
||||
scissor_height);
|
||||
#else
|
||||
grafContext->scissor(field_0xd94 + mDoGph_gInf_c::getMinXF(),
|
||||
scissor_top, mDoGph_gInf_c::getWidthF(),
|
||||
scissor_height);
|
||||
#endif
|
||||
grafContext->setScissor();
|
||||
}
|
||||
|
||||
@@ -957,11 +933,7 @@ void dMenu_DmapBg_c::draw() {
|
||||
|
||||
Vec local_26c = pane.getGlobalVtx(mMapPane, &local_110, 0, false, 0);
|
||||
drawIcon(local_26c.x + field_0xd94, local_26c.y, field_0xda8, 1.0f);
|
||||
#if TARGET_PC
|
||||
grafContext->scissor(field_0xd94, scissor_top, mDoGph_gInf_c::getWidth(), scissor_height);
|
||||
#else
|
||||
grafContext->scissor(field_0xd94 + mDoGph_gInf_c::getMinXF(), scissor_top, mDoGph_gInf_c::getWidthF(), scissor_height);
|
||||
#endif
|
||||
grafContext->setScissor();
|
||||
grafContext->scissor(scissor_left, scissor_top, scissor_width, scissor_height);
|
||||
grafContext->setScissor();
|
||||
|
||||
+2
-19
@@ -276,18 +276,14 @@ void dMenu_Fmap2DBack_c::draw() {
|
||||
u32 scissorLeft, scissorTop, scissorWidth, scissorHeight;
|
||||
GXGetScissor(&scissorLeft, &scissorTop, &scissorWidth, &scissorHeight);
|
||||
|
||||
#if TARGET_PC
|
||||
grafPort->scissor(mTransX, 0.0f, mDoGph_gInf_c::getWidth(), mDoGph_gInf_c::getHeight());
|
||||
#else
|
||||
grafPort->scissor(mTransX, 0.0f, FB_WIDTH, FB_HEIGHT);
|
||||
#endif
|
||||
grafPort->setScissor();
|
||||
|
||||
mpBackTex->setBlackWhite(field_0x1208, field_0x120c);
|
||||
mpBackTex->setAlpha(mAlphaRate * 255.0f * g_fmapHIO.mBackgroundAlpha);
|
||||
mpBackTex->draw(mTransX + mDoGph_gInf_c::getMinXF(),
|
||||
mTransZ + mDoGph_gInf_c::getMinYF(), mDoGph_gInf_c::getWidth(),
|
||||
mDoGph_gInf_c::getHeight(), false, false, false);
|
||||
mTransZ + mDoGph_gInf_c::getMinYF(), mDoGph_gInf_c::getWidthF(),
|
||||
mDoGph_gInf_c::getHeightF(), false, false, false);
|
||||
|
||||
mpBackScreen->draw(mTransX, mTransZ, grafPort);
|
||||
mpBaseScreen->draw(mTransX, mTransZ, grafPort);
|
||||
@@ -297,13 +293,8 @@ void dMenu_Fmap2DBack_c::draw() {
|
||||
|
||||
Vec vec2 = mpMapArea->getGlobalVtx(&mtx, 3, false, 0);
|
||||
|
||||
#if TARGET_PC
|
||||
f32 width = mDoGph_gInf_c::getWidthF() / mDoGph_gInf_c::getWidth();
|
||||
f32 height = mDoGph_gInf_c::getHeightF() / mDoGph_gInf_c::getHeight();
|
||||
#else
|
||||
f32 width = mDoGph_gInf_c::getWidthF() / FB_WIDTH;
|
||||
f32 height = mDoGph_gInf_c::getHeightF() / FB_HEIGHT;
|
||||
#endif
|
||||
|
||||
grafPort->scissor(mTransX + ((vec1.x - mDoGph_gInf_c::getMinXF()) / width),
|
||||
mTransZ + (vec1.y / height), (vec2.x - vec1.x) / width,
|
||||
@@ -360,11 +351,7 @@ void dMenu_Fmap2DBack_c::draw() {
|
||||
drawDebugRegionArea();
|
||||
}
|
||||
|
||||
#if TARGET_PC
|
||||
grafPort->scissor(scissorLeft, scissorTop, mDoGph_gInf_c::getWidth(), mDoGph_gInf_c::getHeight());
|
||||
#else
|
||||
grafPort->scissor(scissorLeft, scissorTop, scissorWidth, scissorHeight);
|
||||
#endif
|
||||
grafPort->setScissor();
|
||||
|
||||
if (isArrowDrawFlag()) {
|
||||
@@ -2580,11 +2567,7 @@ void dMenu_Fmap2DTop_c::draw() {
|
||||
J2DOrthoGraph* ctx = static_cast<J2DOrthoGraph*>(dComIfGp_getCurrentGrafPort());
|
||||
ctx->setup2D();
|
||||
GXGetScissor(&scissor_left, &scissor_top, &scissor_width, &scissor_height);
|
||||
#if TARGET_PC
|
||||
ctx->scissor(mTransX, 0.0f, mDoGph_gInf_c::getWidth(), mDoGph_gInf_c::getHeight());
|
||||
#else
|
||||
ctx->scissor(mTransX, 0.0f, FB_WIDTH, FB_HEIGHT);
|
||||
#endif
|
||||
ctx->setScissor();
|
||||
mpTitleScreen->draw(mTransX, mTransY, ctx);
|
||||
ctx->scissor(scissor_left, scissor_top, scissor_width, scissor_height);
|
||||
|
||||
@@ -223,13 +223,8 @@ void dMenu_Letter_c::_draw() {
|
||||
f32 y1 = local_178.y;
|
||||
Vec local_184;
|
||||
local_184 = afStack_138.getGlobalVtx(field_0x1ec, &mtx, 3, false, 0);
|
||||
#if TARGET_PC
|
||||
f32 dVar17 = mDoGph_gInf_c::getWidthF() / mDoGph_gInf_c::getWidth();
|
||||
f32 dVar16 = mDoGph_gInf_c::getHeightF() / mDoGph_gInf_c::getHeight();
|
||||
#else
|
||||
f32 dVar17 = mDoGph_gInf_c::getWidthF() / FB_WIDTH;
|
||||
f32 dVar16 = mDoGph_gInf_c::getHeightF() / FB_HEIGHT;
|
||||
#endif
|
||||
f32 fVar1 = (x1 - mDoGph_gInf_c::getMinXF()) / dVar17;
|
||||
f32 fVar2 = y1 / dVar16;
|
||||
grafContext->scissor(fVar1, fVar2,
|
||||
|
||||
@@ -555,19 +555,11 @@ void dMenu_Option_c::_draw() {
|
||||
#endif
|
||||
|
||||
mpBlackTex->setAlpha(0xff);
|
||||
#if TARGET_PC
|
||||
mpBlackTex->draw(mDoGph_gInf_c::getMinXF(), mDoGph_gInf_c::getMinYF(), mDoGph_gInf_c::getWidthF(), mDoGph_gInf_c::getHeightF(), 0, 0, 0);
|
||||
#else
|
||||
mpBlackTex->draw(0.0f, 0.0f, FB_WIDTH, FB_HEIGHT, 0, 0, 0);
|
||||
#endif
|
||||
mpBackScreen->draw(0.0f, 0.0f, ctx);
|
||||
f32 alpha = (f32)g_drawHIO.mOptionScreen.mBackgroundAlpha * (f32)field_0x374;
|
||||
mpBlackTex->setAlpha(alpha);
|
||||
#if TARGET_PC
|
||||
mpBlackTex->draw(mDoGph_gInf_c::getMinXF(), mDoGph_gInf_c::getMinYF(), mDoGph_gInf_c::getWidthF(), mDoGph_gInf_c::getHeightF(), 0, 0, 0);
|
||||
#else
|
||||
mpBlackTex->draw(0.0f, 0.0f, FB_WIDTH, FB_HEIGHT, 0, 0, 0);
|
||||
#endif
|
||||
mpScreen->draw(0.0f, 0.0f, ctx);
|
||||
mpClipScreen->draw(0.0f, 0.0f, ctx);
|
||||
#if TARGET_PC
|
||||
|
||||
+8
-14
@@ -32,15 +32,9 @@ public:
|
||||
if (getDrawFlag() == 1) {
|
||||
setDrawFlag();
|
||||
dComIfGp_onPauseFlag();
|
||||
|
||||
#if TARGET_PC
|
||||
GXSetTexCopySrc(0, 0, mDoGph_gInf_c::getWidth(), mDoGph_gInf_c::getHeight());
|
||||
#else
|
||||
GXSetTexCopySrc(0, 0, FB_WIDTH, FB_HEIGHT);
|
||||
#endif
|
||||
|
||||
#if TARGET_PC
|
||||
GXSetTexCopyDst(mDoGph_gInf_c::getWidth(), mDoGph_gInf_c::getHeight(), (GXTexFmt)mDoGph_gInf_c::getFrameBufferTimg()->format, GX_ENABLE);
|
||||
GXSetTexCopyDst(FB_WIDTH, FB_HEIGHT, (GXTexFmt)mDoGph_gInf_c::getFrameBufferTimg()->format, GX_DISABLE);
|
||||
#else
|
||||
GXSetTexCopyDst(FB_WIDTH / 2, FB_HEIGHT / 2, (GXTexFmt)mDoGph_gInf_c::getFrameBufferTimg()->format, GX_ENABLE);
|
||||
#endif
|
||||
@@ -48,17 +42,17 @@ public:
|
||||
GXPixModeSync();
|
||||
#if TARGET_PC
|
||||
// init mTexObj at capture time so the gpu ref survives window resizes
|
||||
mCaptureWidth = mDoGph_gInf_c::getWidth();
|
||||
mCaptureHeight = mDoGph_gInf_c::getHeight();
|
||||
GXInitTexObj(&mTexObj, mDoGph_gInf_c::getFrameBufferTex(), mCaptureWidth, mCaptureHeight,
|
||||
mCaptureWidth = JUTVideo::getManager()->getRenderWidth();
|
||||
mCaptureHeight = JUTVideo::getManager()->getRenderHeight();
|
||||
GXInitTexObj(&mTexObj, mDoGph_gInf_c::getFrameBufferTex(), FB_WIDTH / 2, FB_HEIGHT / 2,
|
||||
(GXTexFmt)mDoGph_gInf_c::getFrameBufferTimg()->format, GX_CLAMP, GX_CLAMP, GX_FALSE);
|
||||
GXInitTexObjLOD(&mTexObj, GX_LINEAR, GX_LINEAR, 0.0f, 0.0f, 0.0f, GX_FALSE, GX_FALSE, GX_ANISO_1);
|
||||
#endif
|
||||
} else {
|
||||
#if TARGET_PC
|
||||
// If the window was resized since capture, force a re-capture at the new size
|
||||
if (mCaptureWidth != (u16)mDoGph_gInf_c::getWidth() ||
|
||||
mCaptureHeight != (u16)mDoGph_gInf_c::getHeight()) {
|
||||
if (mCaptureWidth != JUTVideo::getManager()->getRenderWidth() ||
|
||||
mCaptureHeight != JUTVideo::getManager()->getRenderHeight()) {
|
||||
mFlag = 1;
|
||||
return;
|
||||
}
|
||||
@@ -137,8 +131,8 @@ private:
|
||||
/* 0x5 */ u8 mAlpha;
|
||||
/* 0x6 */ u8 mTopFlag;
|
||||
#if TARGET_PC
|
||||
u16 mCaptureWidth;
|
||||
u16 mCaptureHeight;
|
||||
u32 mCaptureWidth;
|
||||
u32 mCaptureHeight;
|
||||
TGXTexObj mTexObj;
|
||||
#endif
|
||||
};
|
||||
|
||||
@@ -607,17 +607,10 @@ void dMsgScrnHowl_c::drawGuide() {
|
||||
J2DGrafContext* grafContext = dComIfGp_getCurrentGrafPort();
|
||||
Vec local_b0 = field_0x128;
|
||||
Vec local_bc = field_0x140;
|
||||
#if TARGET_PC
|
||||
grafContext->scissor(
|
||||
(local_b0.x - mDoGph_gInf_c::getMinXF()) / (mDoGph_gInf_c::getWidthF() / mDoGph_gInf_c::getWidth()),
|
||||
field_0x2118, (local_bc.x - local_b0.x) / (mDoGph_gInf_c::getWidthF() / mDoGph_gInf_c::getWidth()),
|
||||
field_0x2120);
|
||||
#else
|
||||
grafContext->scissor(
|
||||
(local_b0.x - mDoGph_gInf_c::getMinXF()) / (mDoGph_gInf_c::getWidthF() / FB_WIDTH),
|
||||
field_0x2118, (local_bc.x - local_b0.x) / (mDoGph_gInf_c::getWidthF() / FB_WIDTH),
|
||||
field_0x2120);
|
||||
#endif
|
||||
grafContext->setScissor();
|
||||
f32 local_cc = mpLineH[0]->getGlobalPosX();
|
||||
s16 sVar12 = 0;
|
||||
@@ -745,19 +738,11 @@ void dMsgScrnHowl_c::drawGuide2() {
|
||||
}
|
||||
Vec local_58 = field_0x128;
|
||||
Vec local_64 = field_0x140;
|
||||
#if TARGET_PC
|
||||
f32 local_70 = mDoGph_gInf_c::getHeightF() / mDoGph_gInf_c::getHeight();
|
||||
grafContext->scissor(
|
||||
(local_58.x - mDoGph_gInf_c::getMinXF()) / (mDoGph_gInf_c::getWidthF() / mDoGph_gInf_c::getWidth()),
|
||||
field_0x2118, (local_64.x - local_58.x) / (mDoGph_gInf_c::getWidthF() / mDoGph_gInf_c::getWidth()),
|
||||
field_0x2120);
|
||||
#else
|
||||
f32 local_70 = mDoGph_gInf_c::getHeightF() / mDoGph_gInf_c::getHeight();
|
||||
grafContext->scissor(
|
||||
(local_58.x - mDoGph_gInf_c::getMinXF()) / (mDoGph_gInf_c::getWidthF() / FB_WIDTH),
|
||||
field_0x2118, (local_64.x - local_58.x) / (mDoGph_gInf_c::getWidthF() / FB_WIDTH),
|
||||
field_0x2120);
|
||||
#endif
|
||||
grafContext->setScissor();
|
||||
f32 local_74 = mpLineH[0]->getGlobalPosX();
|
||||
s16 local_134 = 0;
|
||||
@@ -859,15 +844,9 @@ void dMsgScrnHowl_c::drawEffect() {
|
||||
Vec vec1 = field_0x128;
|
||||
Vec vec2 = field_0x140;
|
||||
mDoGph_gInf_c::getHeightF();
|
||||
#if TARGET_PC
|
||||
grafContext->scissor(
|
||||
(vec1.x - mDoGph_gInf_c::getMinXF()) / (mDoGph_gInf_c::getWidthF() / mDoGph_gInf_c::getWidth()), field_0x2118,
|
||||
12.0f + ((vec2.x - vec1.x) / (mDoGph_gInf_c::getWidthF() / mDoGph_gInf_c::getWidth())), field_0x2120);
|
||||
#else
|
||||
grafContext->scissor(
|
||||
(vec1.x - mDoGph_gInf_c::getMinXF()) / (mDoGph_gInf_c::getWidthF() / FB_WIDTH), field_0x2118,
|
||||
12.0f + ((vec2.x - vec1.x) / (mDoGph_gInf_c::getWidthF() / FB_WIDTH)), field_0x2120);
|
||||
#endif
|
||||
grafContext->setScissor();
|
||||
u8 timer = daAlink_getAlinkActorClass()->getWolfHowlMgrP()->getReleaseTimer();
|
||||
u8 screenAlpha = mpScreen->search(MULTI_CHAR('line00'))->getAlpha();
|
||||
|
||||
@@ -12,13 +12,8 @@
|
||||
#include "m_Do/m_Do_graphic.h"
|
||||
|
||||
void dOvlpFd2_dlst_c::draw() {
|
||||
#if TARGET_PC
|
||||
GXSetViewport(0.0f, 0.0f, mDoGph_gInf_c::getWidth(), mDoGph_gInf_c::getHeight(), 0.0f, 1.0f);
|
||||
GXSetScissor(0, 0, mDoGph_gInf_c::getWidth(), mDoGph_gInf_c::getHeight());
|
||||
#else
|
||||
GXSetViewport(0.0f, 0.0f, FB_WIDTH, FB_HEIGHT, 0.0f, 1.0f);
|
||||
GXSetScissor(0, 0, FB_WIDTH, FB_HEIGHT);
|
||||
#endif
|
||||
GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_POS, GX_CLR_RGB, GX_RGBA4, 0);
|
||||
GXClearVtxDesc();
|
||||
GXSetVtxDesc(GX_VA_POS, GX_DIRECT);
|
||||
|
||||
+3
-23
@@ -13,11 +13,10 @@
|
||||
#include "m_Do/m_Do_graphic.h"
|
||||
|
||||
void dDlst_snapShot_c::draw() {
|
||||
#if TARGET_PC
|
||||
GXSetTexCopySrc(0, 0, mDoGph_gInf_c::getWidth(), mDoGph_gInf_c::getHeight());
|
||||
GXSetTexCopyDst(mDoGph_gInf_c::getWidth(), mDoGph_gInf_c::getHeight(), GX_TF_RGBA8, GX_TRUE);
|
||||
#else
|
||||
GXSetTexCopySrc(0, 0, FB_WIDTH, FB_HEIGHT);
|
||||
#if TARGET_PC
|
||||
GXSetTexCopyDst(FB_WIDTH, FB_HEIGHT, GX_TF_RGBA8, GX_FALSE);
|
||||
#else
|
||||
GXSetTexCopyDst(FB_WIDTH / 2, FB_HEIGHT / 2, GX_TF_RGBA8, GX_TRUE);
|
||||
#endif
|
||||
GXCopyTex(mDoGph_gInf_c::getFrameBufferTex(), GX_FALSE);
|
||||
@@ -25,13 +24,8 @@ void dDlst_snapShot_c::draw() {
|
||||
}
|
||||
|
||||
void dOvlpFd3_dlst_c::draw() {
|
||||
#if TARGET_PC
|
||||
GXSetViewport(0.0f, 0.0f, mDoGph_gInf_c::getWidth(), mDoGph_gInf_c::getHeight(), 0.0f, 1.0f);
|
||||
GXSetScissor(0, 0, mDoGph_gInf_c::getWidth(), mDoGph_gInf_c::getHeight());
|
||||
#else
|
||||
GXSetViewport(0.0f, 0.0f, FB_WIDTH, FB_HEIGHT, 0.0f, 1.0f);
|
||||
GXSetScissor(0, 0, FB_WIDTH, FB_HEIGHT);
|
||||
#endif
|
||||
GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_POS, GX_CLR_RGB, GX_RGBA4, 0);
|
||||
GXClearVtxDesc();
|
||||
GXSetVtxDesc(GX_VA_POS, GX_DIRECT);
|
||||
@@ -112,19 +106,6 @@ void dOvlpFd3_dlst_c::draw() {
|
||||
|
||||
GXBegin(GX_QUADS, GX_VTXFMT0, 4);
|
||||
|
||||
#if TARGET_PC
|
||||
GXPosition2s16(-FB_WIDTH / 2, FB_HEIGHT / 2);
|
||||
GXTexCoord2s8(0, 0);
|
||||
|
||||
GXPosition2s16(FB_WIDTH / 2, FB_HEIGHT / 2);
|
||||
GXTexCoord2s8(1, 0);
|
||||
|
||||
GXPosition2s16(FB_WIDTH / 2, -FB_HEIGHT / 2);
|
||||
GXTexCoord2s8(1, 1);
|
||||
|
||||
GXPosition2s16(-FB_WIDTH / 2, -FB_HEIGHT / 2);
|
||||
GXTexCoord2s8(0, 1);
|
||||
#else
|
||||
GXPosition2s16(-mDoGph_gInf_c::getWidth() / 2, mDoGph_gInf_c::getHeight() / 2);
|
||||
GXTexCoord2s8(0, 0);
|
||||
|
||||
@@ -136,7 +117,6 @@ void dOvlpFd3_dlst_c::draw() {
|
||||
|
||||
GXPosition2s16(-mDoGph_gInf_c::getWidth() / 2, -mDoGph_gInf_c::getHeight() / 2);
|
||||
GXTexCoord2s8(0, 1);
|
||||
#endif
|
||||
|
||||
GXEnd();
|
||||
|
||||
|
||||
@@ -356,12 +356,8 @@ Vec CPaneMgr::getGlobalVtx(J2DPane* p_pane, Mtx* param_1, u8 param_2, bool param
|
||||
Mtx m;
|
||||
MtxP mp = (MtxP)param_1;
|
||||
J2DPane* parent = p_pane->getParentPane();
|
||||
|
||||
#if TARGET_PC
|
||||
J2DOrthoGraph ortho(0.0f, 0.0f, mDoGph_gInf_c::getWidth(), mDoGph_gInf_c::getHeight(), -1.0f, 1.0f);
|
||||
#else
|
||||
|
||||
J2DOrthoGraph ortho(0.0f, 0.0f, FB_WIDTH, FB_HEIGHT, -1.0f, 1.0f);
|
||||
#endif
|
||||
ortho.setOrtho(mDoGph_gInf_c::getMinXF(), mDoGph_gInf_c::getMinYF(), mDoGph_gInf_c::getWidthF(), mDoGph_gInf_c::getHeightF(), -1.0f, 1.0f);
|
||||
|
||||
if (parent != NULL) {
|
||||
|
||||
@@ -1418,12 +1418,7 @@ static int phase_4(dScnPly_c* i_this) {
|
||||
dComIfGp_setPlayerPtr(i, NULL);
|
||||
}
|
||||
|
||||
#if TARGET_PC
|
||||
dComIfGp_setWindow(0, 0.0f, 0.0f, mDoGph_gInf_c::getWidth(), mDoGph_gInf_c::getHeight(), 0.0f,
|
||||
1.0f, 0, 2);
|
||||
#else
|
||||
dComIfGp_setWindow(0, 0.0f, 0.0f, FB_WIDTH, FB_HEIGHT, 0.0f, 1.0f, 0, 2);
|
||||
#endif
|
||||
dComIfGp_setCameraInfo(0, NULL, 0, 0, -1);
|
||||
dComIfGd_setWindow(NULL);
|
||||
dComIfGd_setViewport(NULL);
|
||||
|
||||
@@ -13,7 +13,7 @@ static void ApplyPresetClassic() {
|
||||
auto& s = getSettings();
|
||||
s.video.lockAspectRatio.setValue(true);
|
||||
s.game.bloomMode.setValue(BloomMode::Classic);
|
||||
VILockAspectRatio(defaultAspectRatioW, defaultAspectRatioH);
|
||||
AuroraSetViewportPolicy(AURORA_VIEWPORT_FIT);
|
||||
}
|
||||
|
||||
static void ApplyPresetHD() {
|
||||
|
||||
@@ -21,6 +21,14 @@
|
||||
|
||||
#include "dusk/main.h"
|
||||
|
||||
namespace {
|
||||
constexpr int kInternalResolutionScaleMax = 12;
|
||||
} // namespace
|
||||
|
||||
namespace aurora::gx {
|
||||
extern bool enableLodBias;
|
||||
}
|
||||
|
||||
namespace dusk {
|
||||
void ImGuiMenuGame::ToggleFullscreen() {
|
||||
getSettings().video.enableFullscreen.setValue(!getSettings().video.enableFullscreen);
|
||||
@@ -58,14 +66,34 @@ namespace dusk {
|
||||
getSettings().video.lockAspectRatio.setValue(lockAspect);
|
||||
|
||||
if (lockAspect) {
|
||||
VILockAspectRatio(defaultAspectRatioW, defaultAspectRatioH);
|
||||
AuroraSetViewportPolicy(AURORA_VIEWPORT_FIT);
|
||||
} else {
|
||||
VIUnlockAspectRatio();
|
||||
AuroraSetViewportPolicy(AURORA_VIEWPORT_STRETCH);
|
||||
}
|
||||
|
||||
config::Save();
|
||||
}
|
||||
|
||||
u32 internalResolutionWidth = 0;
|
||||
u32 internalResolutionHeight = 0;
|
||||
AuroraGetRenderSize(&internalResolutionWidth, &internalResolutionHeight);
|
||||
ImGui::TextDisabled("Current internal resolution: %ux%u", internalResolutionWidth,
|
||||
internalResolutionHeight);
|
||||
|
||||
int scale = std::clamp(getSettings().game.internalResolutionScale.getValue(), 0,
|
||||
kInternalResolutionScaleMax);
|
||||
if (ImGui::SliderInt("Internal Resolution", &scale, 0, kInternalResolutionScaleMax,
|
||||
scale == 0 ? "Auto" : "%dx"))
|
||||
{
|
||||
getSettings().game.internalResolutionScale.setValue(scale);
|
||||
VISetFrameBufferScale(static_cast<float>(scale));
|
||||
config::Save();
|
||||
}
|
||||
if (ImGui::IsItemHovered()) {
|
||||
ImGui::SetTooltip("Auto renders at the native window resolution.\n"
|
||||
"Higher values scale the game's internal framebuffer.");
|
||||
}
|
||||
|
||||
constexpr const char* bloomModeNames[] = {"Off", "Classic", "Dusk"};
|
||||
int bloomMode = static_cast<int>(getSettings().game.bloomMode.getValue());
|
||||
if (ImGui::BeginCombo("Bloom", bloomModeNames[bloomMode])) {
|
||||
@@ -93,6 +121,8 @@ namespace dusk {
|
||||
|
||||
config::ImGuiCheckbox("Enable Water Refraction", getSettings().game.enableWaterRefraction);
|
||||
|
||||
ImGui::Checkbox("Enable LOD Bias", &aurora::gx::enableLodBias);
|
||||
|
||||
ImGui::EndMenu();
|
||||
}
|
||||
|
||||
|
||||
@@ -47,6 +47,7 @@ UserSettings g_userSettings = {
|
||||
.bloomMultiplier {"game.bloomMultiplier", 1.0f},
|
||||
.enableWaterRefraction {"game.enableWaterRefraction", true},
|
||||
.enableFrameInterpolation = {"game.enableFrameInterpolation", false},
|
||||
.internalResolutionScale {"game.internalResolutionScale", 0},
|
||||
.shadowResolutionMultiplier {"game.shadowResolutionMultiplier", 1},
|
||||
|
||||
// Audio
|
||||
@@ -127,6 +128,7 @@ void registerSettings() {
|
||||
Register(g_userSettings.game.bloomMode);
|
||||
Register(g_userSettings.game.bloomMultiplier);
|
||||
Register(g_userSettings.game.enableWaterRefraction);
|
||||
Register(g_userSettings.game.internalResolutionScale);
|
||||
Register(g_userSettings.game.shadowResolutionMultiplier);
|
||||
Register(g_userSettings.game.enableFastIronBoots);
|
||||
Register(g_userSettings.game.canTransformAnywhere);
|
||||
|
||||
@@ -332,14 +332,6 @@ static VIRetraceCallback sVIPostRetraceCallback = NULL;
|
||||
|
||||
extern "C" {
|
||||
|
||||
void VIConfigure(const GXRenderModeObj* rm) {
|
||||
STUB_LOG();
|
||||
}
|
||||
|
||||
void VIConfigurePan(u16 xOrg, u16 yOrg, u16 width, u16 height) {
|
||||
STUB_LOG();
|
||||
}
|
||||
|
||||
u32 VIGetRetraceCount() {
|
||||
return sRetraceCount;
|
||||
}
|
||||
|
||||
+49
-74
@@ -141,7 +141,7 @@ void dDlst_heapMap_c::draw() {
|
||||
f32 var_f29 = field_0x10 - field_0x8;
|
||||
f32 sp4C = field_0x14 - field_0xc;
|
||||
f32 sp48 = var_f29 * sp4C;
|
||||
|
||||
|
||||
uintptr_t start_addr = (uintptr_t)m_heap->getStartAddr();
|
||||
uintptr_t end_addr = (uintptr_t)m_heap->getEndAddr();
|
||||
u32 sp40 = end_addr - start_addr;
|
||||
@@ -156,7 +156,7 @@ void dDlst_heapMap_c::draw() {
|
||||
f32 var_f30 = (f32)sp38 * sp3C;
|
||||
uintptr_t sp34 = (uintptr_t)block - start_addr;
|
||||
f32 sp30 = (f32)sp34 * sp3C;
|
||||
|
||||
|
||||
f32 var_f28 = std::floor(sp30 / var_f29);
|
||||
|
||||
f32 sp2C = sp30 - (var_f29 * var_f28);
|
||||
@@ -603,21 +603,16 @@ struct tvSize {
|
||||
u16 width;
|
||||
u16 height;
|
||||
};
|
||||
const tvSize l_tvSize[2] = {
|
||||
#ifndef TARGET_PC
|
||||
const
|
||||
#endif
|
||||
tvSize l_tvSize[2] = {
|
||||
{FB_WIDTH_BASE, FB_HEIGHT_BASE},
|
||||
{808, FB_HEIGHT_BASE},
|
||||
};
|
||||
|
||||
#if TARGET_PC
|
||||
tvSize pc_tvSize = {608, 448};
|
||||
#endif
|
||||
|
||||
void mDoGph_gInf_c::setTvSize() {
|
||||
#if TARGET_PC
|
||||
const tvSize* tvsize = &pc_tvSize;
|
||||
#else
|
||||
const tvSize* tvsize = &l_tvSize[mWide];
|
||||
#endif
|
||||
|
||||
m_width = tvsize->width;
|
||||
m_height = tvsize->height;
|
||||
@@ -644,21 +639,11 @@ void mDoGph_gInf_c::setTvSize() {
|
||||
#endif
|
||||
}
|
||||
|
||||
#if TARGET_PC
|
||||
void mDoGph_gInf_c::onWide(f32 width, f32 height) {
|
||||
mWide = TRUE;
|
||||
pc_tvSize.width = width;
|
||||
pc_tvSize.height = height;
|
||||
setTvSize();
|
||||
dMeter2Info_onWide2D();
|
||||
}
|
||||
#else
|
||||
void mDoGph_gInf_c::onWide() {
|
||||
mWide = TRUE;
|
||||
setTvSize();
|
||||
dMeter2Info_onWide2D();
|
||||
}
|
||||
#endif
|
||||
|
||||
void mDoGph_gInf_c::offWide() {
|
||||
mWide = FALSE;
|
||||
@@ -800,8 +785,11 @@ void mDoGph_gInf_c::updateSafeAreaBounds() {
|
||||
return;
|
||||
}
|
||||
|
||||
u32 renderWidth = 0;
|
||||
u32 renderHeight = 0;
|
||||
AuroraGetRenderSize(&renderWidth, &renderHeight);
|
||||
if (windowSize.native_fb_width == 0 || windowSize.native_fb_height == 0 ||
|
||||
windowSize.fb_width == 0 || windowSize.fb_height == 0)
|
||||
renderWidth == 0 || renderHeight == 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -814,23 +802,25 @@ void mDoGph_gInf_c::updateSafeAreaBounds() {
|
||||
const f32 safeRight = static_cast<f32>(safeRect.x + safeRect.w) * nativeScaleX;
|
||||
const f32 safeBottom = static_cast<f32>(safeRect.y + safeRect.h) * nativeScaleY;
|
||||
|
||||
const f32 viewportLeft =
|
||||
(static_cast<f32>(windowSize.native_fb_width) - static_cast<f32>(windowSize.fb_width)) *
|
||||
0.5f;
|
||||
const f32 viewportTop =
|
||||
(static_cast<f32>(windowSize.native_fb_height) - static_cast<f32>(windowSize.fb_height)) *
|
||||
0.5f;
|
||||
const f32 viewportRight = viewportLeft + static_cast<f32>(windowSize.fb_width);
|
||||
const f32 viewportBottom = viewportTop + static_cast<f32>(windowSize.fb_height);
|
||||
f32 viewportWidth = static_cast<f32>(windowSize.native_fb_width);
|
||||
f32 viewportHeight = static_cast<f32>(windowSize.native_fb_height);
|
||||
const f32 targetAspect = viewportWidth / viewportHeight;
|
||||
const f32 contentAspect = static_cast<f32>(renderWidth) / static_cast<f32>(renderHeight);
|
||||
if (targetAspect > contentAspect) {
|
||||
viewportWidth = std::max(1.0f, std::round(viewportHeight * contentAspect));
|
||||
} else if (targetAspect < contentAspect) {
|
||||
viewportHeight = std::max(1.0f, std::round(viewportWidth / contentAspect));
|
||||
}
|
||||
|
||||
const f32 leftInset = std::max(0.0f, safeLeft - viewportLeft) *
|
||||
(m_widthF / static_cast<f32>(windowSize.fb_width));
|
||||
const f32 topInset = std::max(0.0f, safeTop - viewportTop) *
|
||||
(m_heightF / static_cast<f32>(windowSize.fb_height));
|
||||
const f32 rightInset = std::max(0.0f, viewportRight - safeRight) *
|
||||
(m_widthF / static_cast<f32>(windowSize.fb_width));
|
||||
const f32 bottomInset = std::max(0.0f, viewportBottom - safeBottom) *
|
||||
(m_heightF / static_cast<f32>(windowSize.fb_height));
|
||||
const f32 viewportLeft = (static_cast<f32>(windowSize.native_fb_width) - viewportWidth) * 0.5f;
|
||||
const f32 viewportTop = (static_cast<f32>(windowSize.native_fb_height) - viewportHeight) * 0.5f;
|
||||
const f32 viewportRight = viewportLeft + viewportWidth;
|
||||
const f32 viewportBottom = viewportTop + viewportHeight;
|
||||
|
||||
const f32 leftInset = std::max(0.0f, safeLeft - viewportLeft) * (m_widthF / viewportWidth);
|
||||
const f32 topInset = std::max(0.0f, safeTop - viewportTop) * (m_heightF / viewportHeight);
|
||||
const f32 rightInset = std::max(0.0f, viewportRight - safeRight) * (m_widthF / viewportWidth);
|
||||
const f32 bottomInset = std::max(0.0f, viewportBottom - safeBottom) * (m_heightF / viewportHeight);
|
||||
|
||||
const f32 safeMinXF = m_minXF + leftInset;
|
||||
const f32 safeMinYF = m_minYF + topInset;
|
||||
@@ -851,13 +841,13 @@ void mDoGph_gInf_c::updateSafeAreaBounds() {
|
||||
m_safeHeightF = safeHeightF;
|
||||
}
|
||||
|
||||
void mDoGph_gInf_c::setWindowSize(AuroraWindowSize const& size) {
|
||||
JUTVideo::getManager()->setWindowSize(size);
|
||||
dComIfGp_setWindow(0, 0.0f, 0.0f, getWidth(), getHeight(), 0.0f, 1.0f, 0, 2);
|
||||
mFader->mBox.set(0, 0, getWidth(), getHeight());
|
||||
|
||||
f32 newWidth = (getWidth() / getHeight()) * 448.0f;
|
||||
onWide(newWidth, 448.0f);
|
||||
void mDoGph_gInf_c::updateRenderSize() {
|
||||
u32 width, height;
|
||||
AuroraGetRenderSize(&width, &height);
|
||||
JUTVideo::getManager()->setRenderSize(width, height);
|
||||
l_tvSize[1].width = static_cast<u16>(static_cast<float>(width) / static_cast<float>(height) *
|
||||
static_cast<float>(l_tvSize[1].height));
|
||||
onWide();
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -996,7 +986,7 @@ static void drawDepth2(view_class* param_0, view_port_class* param_1, int param_
|
||||
GXProject(param_0->lookat.center.x, param_0->lookat.center.y,
|
||||
param_0->lookat.center.z, param_0->viewMtx, sp4C, sp34, &sp1C, &sp18,
|
||||
&sp14);
|
||||
|
||||
|
||||
param_2 = (0xFF0000 - (int)(16777215.0f * sp14)) >> 8;
|
||||
param_2 = cLib_minMaxLimit<int>(param_2, -0x400, 0);
|
||||
}
|
||||
@@ -1361,8 +1351,8 @@ void mDoGph_gInf_c::bloom_c::draw2() {
|
||||
if (mMonoColor.a == 0 && !enabled)
|
||||
return;
|
||||
|
||||
f32 width = mDoGph_gInf_c::getWidth();
|
||||
f32 height = mDoGph_gInf_c::getHeight();
|
||||
f32 width = JUTVideo::getManager()->getRenderWidth();
|
||||
f32 height = JUTVideo::getManager()->getRenderHeight();
|
||||
|
||||
GXLoadTexObj(getFrameBufferTexObj(), GX_TEXMAP0);
|
||||
GXSetNumChans(0);
|
||||
@@ -1446,7 +1436,7 @@ void mDoGph_gInf_c::bloom_c::draw2() {
|
||||
CopyToTexObj(&tmpTex[texNo], texNo, rect.w, rect.h);
|
||||
return &tmpTex[texNo];
|
||||
};
|
||||
|
||||
|
||||
auto divQuad = [&](int divNo) {
|
||||
auto const& rect = divRects[divNo];
|
||||
f32 x0 = rect.x / width;
|
||||
@@ -1479,8 +1469,8 @@ void mDoGph_gInf_c::bloom_c::draw2() {
|
||||
}
|
||||
|
||||
if (enabled) {
|
||||
GXCreateFrameBuffer(width * 0.75f, height * 0.5f);
|
||||
GXSetViewport(0.0f, 0.0f, width, height, 0.0f, 1.0f); // use oversized viewport to make the math easier
|
||||
GXCreateFrameBuffer(divRects[2].x + divRects[2].w, divRects[1].y + divRects[1].h);
|
||||
GXSetViewportRender(0.0f, 0.0f, width, height, 0.0f, 1.0f); // use oversized viewport to make the math easier
|
||||
|
||||
GXSetNumTevStages(3);
|
||||
GXSetTevOrder(GX_TEVSTAGE0, GX_TEXCOORD0, GX_TEXMAP0, GX_COLOR_NULL);
|
||||
@@ -1551,7 +1541,7 @@ void mDoGph_gInf_c::bloom_c::draw2() {
|
||||
// This is applied over two passes, the second one with an alpha of 25%; however, the clipping that this introduces is a bit integral to the look,
|
||||
// so we do the same thing, letting it clip.
|
||||
float brightnessF32 = (mBlureRatio * 16 / 255.0f);
|
||||
|
||||
|
||||
// Distribute the brightness through the total number of passes.
|
||||
f32 totalNumPasses = (divNum - divStart + 1);
|
||||
float brightnessPerPass = 255.0f * powf(brightnessF32, 1.0f / totalNumPasses);
|
||||
@@ -1623,13 +1613,8 @@ void mDoGph_gInf_c::bloom_c::draw() {
|
||||
|
||||
bool enabled = mEnable && m_buffer != NULL;
|
||||
if (mMonoColor.a != 0 || enabled) {
|
||||
#if TARGET_PC
|
||||
f32 width = mDoGph_gInf_c::getWidth();
|
||||
f32 height = mDoGph_gInf_c::getHeight();
|
||||
#else
|
||||
f32 width = FB_WIDTH;
|
||||
f32 height = FB_HEIGHT;
|
||||
#endif
|
||||
GXSetViewport(0.0f, 0.0f, width, height, 0.0f, 1.0f);
|
||||
GXSetScissor(0, 0, width, height);
|
||||
|
||||
@@ -1744,7 +1729,7 @@ void mDoGph_gInf_c::bloom_c::draw() {
|
||||
GXSetTexCoordGen(GX_TEXCOORD0, GX_TG_MTX2x4, GX_TG_TEX0, GX_IDENTITY);
|
||||
for (int texCoord = (int)GX_TEXCOORD1; texCoord < (int)GX_MAX_TEXCOORD; texCoord++) {
|
||||
GXSetTexCoordGen((GXTexCoordID)texCoord, GX_TG_MTX2x4, GX_TG_TEX0, texMtxID);
|
||||
|
||||
|
||||
#if TARGET_PC
|
||||
f32 dVar15 = mBlureSize * ((448.0f / height) / 6400.0f);
|
||||
#else
|
||||
@@ -1885,7 +1870,7 @@ static void retry_captue_frame(view_class* param_0, view_port_class* param_1, in
|
||||
var_r23 = height >> 1;
|
||||
GXSetTexCopySrc(x_orig, y_orig_pos, width, height);
|
||||
#ifdef TARGET_PC
|
||||
GXSetTexCopyDst(width, height, (GXTexFmt)mDoGph_gInf_c::getFrameBufferTimg()->format, GX_TRUE);
|
||||
GXSetTexCopyDst(width, height, (GXTexFmt)mDoGph_gInf_c::getFrameBufferTimg()->format, GX_FALSE);
|
||||
#else
|
||||
GXSetTexCopyDst(var_r24, var_r23, (GXTexFmt)mDoGph_gInf_c::getFrameBufferTimg()->format, GX_TRUE);
|
||||
#endif
|
||||
@@ -2143,8 +2128,7 @@ int mDoGph_Painter() {
|
||||
j3dSys.drawInit();
|
||||
GXSetDither(GX_ENABLE);
|
||||
|
||||
J2DOrthoGraph ortho(0.0f, 0.0f, mDoGph_gInf_c::getWidth(), mDoGph_gInf_c::getHeight(), -1.0f,
|
||||
1.0f);
|
||||
J2DOrthoGraph ortho(0.0f, 0.0f, FB_WIDTH, FB_HEIGHT, -1.0f, 1.0f);
|
||||
ortho.setOrtho(mDoGph_gInf_c::getMinXF(), mDoGph_gInf_c::getMinYF(),
|
||||
mDoGph_gInf_c::getWidthF(), mDoGph_gInf_c::getHeightF(),
|
||||
-1.0f, 1.0f);
|
||||
@@ -2190,13 +2174,8 @@ int mDoGph_Painter() {
|
||||
view_port_class new_port;
|
||||
new_port.x_orig = 0.0f;
|
||||
new_port.y_orig = 0.0f;
|
||||
#if TARGET_PC
|
||||
new_port.width = mDoGph_gInf_c::getWidth();
|
||||
new_port.height = mDoGph_gInf_c::getHeight();
|
||||
#else
|
||||
new_port.width = FB_WIDTH;
|
||||
new_port.height = FB_HEIGHT;
|
||||
#endif
|
||||
new_port.near_z = view_port->near_z;
|
||||
new_port.far_z = view_port->far_z;
|
||||
new_port.scissor = view_port->scissor;
|
||||
@@ -2250,7 +2229,7 @@ int mDoGph_Painter() {
|
||||
dComIfGp_setCurrentView(&camera_p->view);
|
||||
dComIfGp_setCurrentViewport(view_port);
|
||||
GXSetProjection(camera_p->view.projMtx, GX_PERSPECTIVE);
|
||||
|
||||
|
||||
#if DEBUG
|
||||
captureScreenSetProjection(camera_p->view.projMtx);
|
||||
#endif
|
||||
@@ -2327,7 +2306,7 @@ int mDoGph_Painter() {
|
||||
#endif
|
||||
|
||||
GX_DEBUG_GROUP(dComIfGd_drawOpaListPacket);
|
||||
|
||||
|
||||
#if DEBUG
|
||||
// "drawing up to special-use drawing (Opaque) except J3D (Rendering)"
|
||||
fapGm_HIO_c::stopCpuTimer("J3D以外などの特殊用(不透明)描画まで(レンダリング)");
|
||||
@@ -2409,7 +2388,7 @@ int mDoGph_Painter() {
|
||||
GX_DEBUG_GROUP(dComIfGd_drawXluListInvisible);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
#if DEBUG
|
||||
// "drawing up to projection (Translucent)"
|
||||
@@ -2513,12 +2492,8 @@ int mDoGph_Painter() {
|
||||
retry_captue_frame(&camera_p->view, view_port,
|
||||
dComIfGp_getCameraZoomForcus(camera_id));
|
||||
}
|
||||
|
||||
#if TARGET_PC
|
||||
GXSetViewport(0.0f, 0.0f, mDoGph_gInf_c::getWidth(), mDoGph_gInf_c::getHeight(), 0.0f, 1.0f);
|
||||
#else
|
||||
|
||||
GXSetViewport(0.0f, 0.0f, FB_WIDTH, FB_HEIGHT, 0.0f, 1.0f);
|
||||
#endif
|
||||
|
||||
Mtx m2;
|
||||
Mtx44 m;
|
||||
|
||||
+5
-13
@@ -126,8 +126,6 @@ AuroraStats dusk::lastFrameAuroraStats;
|
||||
float dusk::frameUsagePct = 0.0f;
|
||||
const char* configPath;
|
||||
|
||||
AuroraWindowSize preLaunchUIWindowSize;
|
||||
|
||||
bool launchUILoop() {
|
||||
while (dusk::IsRunning && !dusk::IsGameLaunched) {
|
||||
const AuroraEvent* event = aurora_update();
|
||||
@@ -136,9 +134,6 @@ bool launchUILoop() {
|
||||
case AURORA_SDL_EVENT:
|
||||
dusk::g_imguiConsole.HandleSDLEvent(event->sdl);
|
||||
break;
|
||||
case AURORA_WINDOW_RESIZED:
|
||||
preLaunchUIWindowSize = event->windowSize;
|
||||
break;
|
||||
case AURORA_DISPLAY_SCALE_CHANGED:
|
||||
dusk::ImGuiEngine_Initialize(event->windowSize.scale);
|
||||
break;
|
||||
@@ -202,9 +197,6 @@ void main01(void) {
|
||||
|
||||
OSReport("Entering Main Loop (main01)...\n");
|
||||
|
||||
if (preLaunchUIWindowSize.width != 0)
|
||||
mDoGph_gInf_c::setWindowSize(preLaunchUIWindowSize);
|
||||
|
||||
constexpr float kSimStepSeconds = 1.0 / 30.0;
|
||||
auto previous_time = std::chrono::steady_clock::now();
|
||||
float accumulator = kSimStepSeconds;
|
||||
@@ -219,9 +211,6 @@ void main01(void) {
|
||||
case AURORA_SDL_EVENT:
|
||||
dusk::g_imguiConsole.HandleSDLEvent(event->sdl);
|
||||
break;
|
||||
case AURORA_WINDOW_RESIZED:
|
||||
mDoGph_gInf_c::setWindowSize(event->windowSize);
|
||||
break;
|
||||
case AURORA_DISPLAY_SCALE_CHANGED:
|
||||
dusk::ImGuiEngine_Initialize(event->windowSize.scale);
|
||||
break;
|
||||
@@ -247,6 +236,8 @@ void main01(void) {
|
||||
continue;
|
||||
}
|
||||
|
||||
mDoGph_gInf_c::updateRenderSize();
|
||||
|
||||
if (dusk::getSettings().game.enableFrameInterpolation && !dusk::getTransientSettings().skipFrameRateLimit) {
|
||||
dusk::frame_interp::notify_presentation_frame();
|
||||
if (accumulator >= kSimStepSeconds) {
|
||||
@@ -525,10 +516,11 @@ int game_main(int argc, char* argv[]) {
|
||||
.c_str());
|
||||
|
||||
if (dusk::getSettings().video.lockAspectRatio) {
|
||||
VILockAspectRatio(defaultAspectRatioW, defaultAspectRatioH);
|
||||
AuroraSetViewportPolicy(AURORA_VIEWPORT_FIT);
|
||||
} else {
|
||||
VIUnlockAspectRatio();
|
||||
AuroraSetViewportPolicy(AURORA_VIEWPORT_STRETCH);
|
||||
}
|
||||
VISetFrameBufferScale(dusk::getSettings().game.internalResolutionScale.getValue());
|
||||
|
||||
dusk::audio::SetMasterVolume(dusk::getSettings().audio.masterVolume / 100.0f);
|
||||
dusk::audio::SetEnableReverb(dusk::getSettings().audio.enableReverb);
|
||||
|
||||
Reference in New Issue
Block a user