tr2/viewport: fix screenshots at wrong resolution

Resolves #2845.
This commit is contained in:
Marcin Kurczewski 2025-04-26 11:55:23 +02:00
parent 15b758c57d
commit 1d5aa6b1bd
No known key found for this signature in database
GPG key ID: CC65E6FD28CAE42A
3 changed files with 12 additions and 5 deletions

View file

@ -1,6 +1,7 @@
## [Unreleased](https://github.com/LostArtefacts/TRX/compare/tr2-1.0.1...develop) - ××××-××-××
- fixed guns carried by enemies not being converted to ammo if Lara has picked up the same gun elsewhere in the same level (#2856)
- fixed guns carried by enemies not being converted to ammo if Lara starts the level with the gun and the game has later been reloaded (#2850, regression from 1.0)
- fixed 1920x1080 screenshots in 16:9 aspect mode being saved as 1919x1080 (#2845, regression from 0.8)
## [1.0.1](https://github.com/LostArtefacts/TRX/compare/tr2-1.0...tr2-1.0.1) - 2025-04-24
- added an option to wraparound when scrolling UI dialogs, such as save/load (#2834)

View file

@ -125,20 +125,23 @@ void Viewport_Reset(void)
VIEWPORT *const vp = &m_Viewport;
switch (g_Config.rendering.aspect_mode) {
case AM_4_3:
vp->render_ar = 4.0 / 3.0;
vp->render_ar.w = 4;
vp->render_ar.h = 3;
break;
case AM_16_9:
vp->render_ar = 16.0 / 9.0;
vp->render_ar.w = 16;
vp->render_ar.h = 9;
break;
case AM_ANY:
vp->render_ar = size.w / (double)size.h;
vp->render_ar.w = size.w;
vp->render_ar.h = size.h;
break;
}
vp->width = size.w / g_Config.rendering.scaler;
vp->height = size.h / g_Config.rendering.scaler;
if (g_Config.rendering.aspect_mode != AM_ANY) {
vp->width = vp->height * vp->render_ar;
vp->width = vp->height * vp->render_ar.w / vp->render_ar.h;
}
vp->near_z = Output_GetNearZ() >> W2V_SHIFT;

View file

@ -8,7 +8,10 @@ typedef struct {
int32_t near_z;
int32_t far_z;
int16_t view_angle;
double render_ar;
struct {
int32_t w;
int32_t h;
} render_ar;
// TODO: remove most of these variables if possible
struct {