]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
Display rotation option (currently D3D9 only), to support Fast Draw Showdown (America...
authorToni Wilen <twilen@winuae.net>
Tue, 21 Feb 2023 16:20:51 +0000 (18:20 +0200)
committerToni Wilen <twilen@winuae.net>
Tue, 21 Feb 2023 16:20:51 +0000 (18:20 +0200)
cfgfile.cpp
include/options.h
od-win32/direct3d.cpp

index a651e04a7cd13c46b407e6366fe1d04355fe5eb3..d75c9128d2d7819a3bbadc39d3a70023ff0c249e 100644 (file)
@@ -2394,6 +2394,7 @@ void cfgfile_save_options (struct zfile *f, struct uae_prefs *p, int type)
        cfgfile_dwrite_bool(f, _T("gfx_vrr_monitor"), p->gfx_variable_sync != 0);
        cfgfile_dwrite_strarr(f, _T("gfx_overscanmode"), overscanmodes, p->gfx_overscanmode);
        cfgfile_dwrite(f, _T("gfx_monitorblankdelay"), _T("%d"), p->gfx_monitorblankdelay);
+       cfgfile_dwrite(f, _T("gfx_rotation"), _T("%d"), p->gfx_rotation);
 
 #ifdef GFXFILTER
        for (int j = 0; j < MAX_FILTERDATA; j++) {
@@ -3606,6 +3607,7 @@ static int cfgfile_parse_host (struct uae_prefs *p, TCHAR *option, TCHAR *value)
                || cfgfile_intval(option, value, _T("gfx_horizontal_extra"), &p->gfx_extrawidth, 1)
                || cfgfile_intval(option, value, _T("gfx_vertical_extra"), &p->gfx_extraheight, 1)
                || cfgfile_intval(option, value, _T("gfx_monitorblankdelay"), &p->gfx_monitorblankdelay, 1)
+               || cfgfile_intval(option, value, _T("gfx_rotation"), &p->gfx_rotation, 1)
 
                || cfgfile_intval (option, value, _T("floppy0sound"), &p->floppyslots[0].dfxclick, 1)
                || cfgfile_intval (option, value, _T("floppy1sound"), &p->floppyslots[1].dfxclick, 1)
index c00a70b0230b6ba3096aa62052e15887e0fc00ee..0668b632fb1bf8b8dd0d19a0c381e60827912f95 100644 (file)
@@ -609,6 +609,7 @@ struct uae_prefs {
        bool gfx_windowed_resize;
        int gfx_overscanmode;
        int gfx_monitorblankdelay;
+       int gfx_rotation;
 
        struct gfx_filterdata gf[3];
 
index 5b0a4af3b94c22f303629e4c2d599776f7d861bc..1101d1b4cae6fc11e41a0325d72c08006c5950da 100644 (file)
@@ -253,7 +253,7 @@ static TCHAR *D3D_ErrorString (HRESULT dival)
        return dierr;
 }
 
-static D3DXMATRIX* MatrixOrthoOffCenterLH (D3DXMATRIXA16 *pOut, float l, float r, float b, float t, float zn, float zf)
+static D3DXMATRIX* MatrixOrthoOffCenterLH(D3DXMATRIXA16 *pOut, float l, float r, float b, float t, float zn, float zf)
 {
        pOut->_11=2.0f/r; pOut->_12=0.0f;   pOut->_13=0.0f;  pOut->_14=0.0f;
        pOut->_21=0.0f;   pOut->_22=2.0f/t; pOut->_23=0.0f;  pOut->_24=0.0f;
@@ -262,7 +262,7 @@ static D3DXMATRIX* MatrixOrthoOffCenterLH (D3DXMATRIXA16 *pOut, float l, float r
        return pOut;
 }
 
-static D3DXMATRIX* MatrixScaling (D3DXMATRIXA16 *pOut, float sx, float sy, float sz)
+static D3DXMATRIX* MatrixScaling(D3DXMATRIXA16 *pOut, float sx, float sy, float sz)
 {
        pOut->_11=sx;     pOut->_12=0.0f;   pOut->_13=0.0f;  pOut->_14=0.0f;
        pOut->_21=0.0f;   pOut->_22=sy;     pOut->_23=0.0f;  pOut->_24=0.0f;
@@ -271,7 +271,7 @@ static D3DXMATRIX* MatrixScaling (D3DXMATRIXA16 *pOut, float sx, float sy, float
        return pOut;
 }
 
-static D3DXMATRIX* MatrixTranslation (D3DXMATRIXA16 *pOut, float tx, float ty, float tz)
+static D3DXMATRIX* MatrixTranslation(D3DXMATRIXA16 *pOut, float tx, float ty, float tz)
 {
        pOut->_11=1.0f;   pOut->_12=0.0f;   pOut->_13=0.0f;  pOut->_14=0.0f;
        pOut->_21=0.0f;   pOut->_22=1.0f;   pOut->_23=0.0f;  pOut->_24=0.0f;
@@ -2171,6 +2171,15 @@ static void setupscenecoords(struct d3dstruct *d3d, bool normalrender)
 
        MatrixScaling (&d3d->m_matWorld_out, sw + 0.5f / sw, sh + 0.5f / sh, 1.0f);
 
+       if (currprefs.gfx_rotation) {
+               const float PI = 3.14159265358979f;
+               D3DXMATRIXA16 mrot;
+               D3DXMatrixRotationZ(&mrot, PI / 180.0f * currprefs.gfx_rotation);
+               D3DXMATRIXA16 tmprmatrix;
+               D3DXMatrixMultiply(&tmprmatrix, &d3d->m_matWorld_out, &mrot);
+               d3d->m_matWorld_out = tmprmatrix;
+       }
+
        d3d->cursor_offset_x = -zr.left;
        d3d->cursor_offset_y = -zr.top;