add half-finished screen centering code (necessary for arcade and Xbox)
This commit is contained in:
@@ -0,0 +1 @@
|
||||
_options to options
|
||||
@@ -0,0 +1 @@
|
||||
_options to options
|
||||
@@ -0,0 +1 @@
|
||||
_shared footer
|
||||
@@ -0,0 +1 @@
|
||||
_shared menu header
|
||||
@@ -1747,6 +1747,11 @@ OddLineOut=stoptweening;accelerate,0.3;addx,640;
|
||||
StyleIcon=0
|
||||
TimerSeconds=0
|
||||
|
||||
[ScreenCenterImage]
|
||||
HelpText=Use arrow keys to navigate, ENTER to assign, SPACE to clear, ESCAPE when done.
|
||||
StyleIcon=0
|
||||
TimerSeconds=0
|
||||
|
||||
[HoldGhostArrow]
|
||||
WarmUpSeconds=0.25
|
||||
|
||||
@@ -2558,19 +2563,20 @@ OptionMenuFlags=together;forceallplayers;rows,11;smnavigation
|
||||
# This NextScreen is only used for the "exit" choice.
|
||||
NextScreen=ScreenTitleMenu
|
||||
PrevScreen=ScreenTitleMenu
|
||||
NumRows=12
|
||||
NumRows=13
|
||||
Line1=list,Appearance Options;title,;
|
||||
Line2=list,Autogen Options;title,;
|
||||
Line3=list,Background Options;title,;
|
||||
Line4=list,Coin Options;title,;
|
||||
Line5=list,Config Key/Joy Mappings;title,;
|
||||
Line6=list,Input Options;title,;
|
||||
Line7=list,Gameplay Options;title,;
|
||||
Line8=list,Graphic Options;title,;
|
||||
Line9=list,Machine Options;title,;
|
||||
Line10=list,Sound Options;title,;
|
||||
Line11=list,Profile Options;title,;
|
||||
Line12=list,Reload Songs/Courses;title,;
|
||||
Line4=list,Center Image;title,;
|
||||
Line5=list,Coin Options;title,;
|
||||
Line6=list,Config Key/Joy Mappings;title,;
|
||||
Line7=list,Input Options;title,;
|
||||
Line8=list,Gameplay Options;title,;
|
||||
Line9=list,Graphic Options;title,;
|
||||
Line10=list,Machine Options;title,;
|
||||
Line11=list,Sound Options;title,;
|
||||
Line12=list,Profile Options;title,;
|
||||
Line13=list,Reload Songs/Courses;title,;
|
||||
|
||||
[TextBanner]
|
||||
Width=180
|
||||
@@ -3059,6 +3065,10 @@ Background Options=1,together
|
||||
Background OptionsDefault=
|
||||
Background Options,1=screen,ScreenBackgroundOptions@ScreenOptionsMaster
|
||||
Background OptionsName,1=Background Options
|
||||
Center Image=1,together
|
||||
Center ImageDefault=
|
||||
Center Image,1=screen,ScreenCenterImage
|
||||
Center ImageName,1=Center Image
|
||||
Coin Options=1,together
|
||||
Coin OptionsDefault=
|
||||
Coin Options,1=screen,ScreenCoinOptions@ScreenOptionsMaster
|
||||
|
||||
@@ -206,6 +206,7 @@ void RageDisplay::SetDefaultRenderStates()
|
||||
SetBlendMode( BLEND_NORMAL );
|
||||
SetTextureFiltering( true );
|
||||
LoadMenuPerspective(0, CENTER_X, CENTER_Y); // 0 FOV = ortho
|
||||
ResetCentering();
|
||||
}
|
||||
|
||||
|
||||
@@ -619,3 +620,22 @@ RageMatrix RageDisplay::GetFrustumMatrix( float l, float r, float b, float t, fl
|
||||
0, 0, D, 0 );
|
||||
return m;
|
||||
}
|
||||
|
||||
void RageDisplay::ResetCentering()
|
||||
{
|
||||
RageMatrixIdentity( &m_Centering );
|
||||
}
|
||||
|
||||
void RageDisplay::CenteringTranslate( float x, float y, float z )
|
||||
{
|
||||
RageMatrix m;
|
||||
RageMatrixTranslation( &m, x, y, z );
|
||||
RageMatrixMultiply( &m_Centering, &m, &m_Centering );
|
||||
}
|
||||
|
||||
void RageDisplay::CenteringScale( float x, float y, float z )
|
||||
{
|
||||
RageMatrix m;
|
||||
RageMatrixScaling( &m, x, y, z );
|
||||
RageMatrixMultiply( &m_Centering, &m, &m_Centering );
|
||||
}
|
||||
|
||||
@@ -247,6 +247,12 @@ public:
|
||||
void LoadMenuPerspective( float fovDegrees, float fVanishPointX, float fVanishPointY );
|
||||
void LoadLookAt( float fov, const RageVector3 &Eye, const RageVector3 &At, const RageVector3 &Up );
|
||||
|
||||
/* Centering matrix */
|
||||
void CenteringTranslate( float x, float y, float z );
|
||||
void CenteringScale( float x, float y, float z );
|
||||
void ResetCentering();
|
||||
|
||||
|
||||
SDL_Surface *CreateSurfaceFromPixfmt( PixelFormat pixfmt, void *pixels, int width, int height, int pitch );
|
||||
PixelFormat FindPixelFormat( int bpp, int Rmask, int Gmask, int Bmask, int Amask );
|
||||
|
||||
@@ -257,7 +263,13 @@ protected:
|
||||
virtual RageMatrix GetOrthoMatrix( float l, float r, float b, float t, float zn, float zf ) = 0;
|
||||
virtual RageMatrix GetFrustumMatrix( float l, float r, float b, float t, float zn, float zf );
|
||||
|
||||
//
|
||||
// Matrix that adjusts position and scale of image on the screen
|
||||
//
|
||||
RageMatrix m_Centering;
|
||||
|
||||
// Called by the RageDisplay derivitives
|
||||
const RageMatrix* GetCentering() { return &m_Centering; }
|
||||
const RageMatrix* GetProjectionTop();
|
||||
const RageMatrix* GetViewTop();
|
||||
const RageMatrix* GetWorldTop();
|
||||
|
||||
@@ -243,11 +243,12 @@ RageDisplay_D3D::RageDisplay_D3D( VideoModeParams p )
|
||||
LOG->Trace(
|
||||
"Driver: %s\n"
|
||||
"Description: %s\n"
|
||||
"Max texture size: %d\n",
|
||||
"Max texture size: %d\n"
|
||||
"Alpha in palette: %s\n",
|
||||
identifier.Driver,
|
||||
identifier.Description,
|
||||
g_DeviceCaps.MaxTextureWidth
|
||||
);
|
||||
g_DeviceCaps.MaxTextureWidth,
|
||||
(g_DeviceCaps.TextureCaps & D3DPTEXTURECAPS_ALPHAPALETTE) ? "yes" : "no" );
|
||||
|
||||
LOG->Trace( "This display adaptor supports the following modes:" );
|
||||
D3DDISPLAYMODE mode;
|
||||
|
||||
@@ -741,7 +741,8 @@ static void SetupVertices( const RageSpriteVertex v[], int iNumVerts )
|
||||
glMatrixMode( GL_PROJECTION ); \
|
||||
glLoadMatrixf( (const float*)GetProjectionTop() ); \
|
||||
RageMatrix modelView; \
|
||||
RageMatrixMultiply( &modelView, GetViewTop(), GetWorldTop() ); \
|
||||
RageMatrixMultiply( &modelView, GetCentering(), GetViewTop() ); \
|
||||
RageMatrixMultiply( &modelView, &modelView, GetWorldTop() ); \
|
||||
glMatrixMode( GL_MODELVIEW ); \
|
||||
glLoadMatrixf( (const float*)&modelView ); \
|
||||
|
||||
|
||||
@@ -96,6 +96,10 @@ RageMatrix RageMatrix::GetTranspose() const
|
||||
|
||||
void RageMatrixMultiply( RageMatrix* pOut, const RageMatrix* pA, const RageMatrix* pB )
|
||||
{
|
||||
//#if defined(_WINDOWS) || defined(_XBOX)
|
||||
// // <30 cycles for theirs versus >100 for ours.
|
||||
// D3DXMatrixMultiply( (D3DMATRIX*)pOut, (D3DMATRIX*)pA, (D3DMATRIX*)pB );
|
||||
//#else
|
||||
const RageMatrix &a = *pA;
|
||||
const RageMatrix &b = *pB;
|
||||
|
||||
@@ -118,6 +122,7 @@ void RageMatrixMultiply( RageMatrix* pOut, const RageMatrix* pA, const RageMatri
|
||||
b.m30*a.m03+b.m31*a.m13+b.m32*a.m23+b.m33*a.m33
|
||||
);
|
||||
// phew!
|
||||
//#endif
|
||||
}
|
||||
|
||||
void RageMatrixTranslation( RageMatrix* pOut, float x, float y, float z )
|
||||
|
||||
@@ -288,6 +288,7 @@ void Screen::ClearMessageQueue( const ScreenMessage SM )
|
||||
#include "ScreenAttract.h"
|
||||
#include "ScreenReloadSongs.h"
|
||||
#include "ScreenOptionsMaster.h"
|
||||
#include "ScreenCenterImage.h"
|
||||
|
||||
Screen* Screen::Create( CString sClassName )
|
||||
{
|
||||
@@ -385,6 +386,7 @@ Screen* Screen::Create( CString sClassName )
|
||||
IF_RETURN( ScreenExit );
|
||||
IF_RETURN( ScreenReloadSongs );
|
||||
IF_RETURN( ScreenOptionsMaster );
|
||||
IF_RETURN( ScreenCenterImage );
|
||||
|
||||
RageException::Throw( "Invalid Screen class name '%s'", sClassName.c_str() );
|
||||
}
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
#include "GameState.h"
|
||||
#include "RageSounds.h"
|
||||
#include "ThemeManager.h"
|
||||
#include "RageDisplay.h"
|
||||
|
||||
|
||||
#define EVEN_LINE_IN THEME->GetMetric("ScreenMapControllers","EvenLineIn")
|
||||
|
||||
Reference in New Issue
Block a user