mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-06-02 01:30:00 -04:00
Widescreen rework & IR scaling
This commit is contained in:
+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;
|
||||
|
||||
Reference in New Issue
Block a user