allow theme to specify logical screen dimensions
This commit is contained in:
@@ -22,6 +22,8 @@ DefaultCpuModifiers=
|
|||||||
JoinPauseSeconds=0.8
|
JoinPauseSeconds=0.8
|
||||||
DifficultiesToShow=beginner,easy,medium,hard,challenge
|
DifficultiesToShow=beginner,easy,medium,hard,challenge
|
||||||
CourseDifficultiesToShow=easy,regular,difficult
|
CourseDifficultiesToShow=easy,regular,difficult
|
||||||
|
ScreenWidth=640
|
||||||
|
ScreenHeight=480
|
||||||
|
|
||||||
[ModeSwitcher]
|
[ModeSwitcher]
|
||||||
PrevModeX=-200
|
PrevModeX=-200
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
#include "Actor.h"
|
#include "Actor.h"
|
||||||
#include "GameConstantsAndTypes.h"
|
#include "GameConstantsAndTypes.h"
|
||||||
|
#include "ScreenDimensions.h"
|
||||||
|
|
||||||
|
|
||||||
inline float GetOffScreenLeft( Actor* pActor ) { return SCREEN_LEFT - pActor->GetZoomedWidth()/2; }
|
inline float GetOffScreenLeft( Actor* pActor ) { return SCREEN_LEFT - pActor->GetZoomedWidth()/2; }
|
||||||
|
|||||||
@@ -9,6 +9,7 @@
|
|||||||
#include "NoteDisplay.h"
|
#include "NoteDisplay.h"
|
||||||
#include "song.h"
|
#include "song.h"
|
||||||
#include "RageMath.h"
|
#include "RageMath.h"
|
||||||
|
#include "ScreenDimensions.h"
|
||||||
|
|
||||||
const float ARROW_SPACING = ARROW_SIZE;// + 2;
|
const float ARROW_SPACING = ARROW_SIZE;// + 2;
|
||||||
|
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ const float SPIRAL_MIN_ZOOM = 0.3f;
|
|||||||
#define MAX_TILES_HIGH (SCREEN_HEIGHT/32+2)
|
#define MAX_TILES_HIGH (SCREEN_HEIGHT/32+2)
|
||||||
#define MAX_SPRITES (MAX_TILES_WIDE*MAX_TILES_HIGH)
|
#define MAX_SPRITES (MAX_TILES_WIDE*MAX_TILES_HIGH)
|
||||||
|
|
||||||
static const RectI FullScreenRectI(SCREEN_LEFT,SCREEN_TOP,SCREEN_RIGHT,SCREEN_BOTTOM);
|
#define FullScreenRectI RectI(SCREEN_LEFT,SCREEN_TOP,SCREEN_RIGHT,SCREEN_BOTTOM)
|
||||||
|
|
||||||
|
|
||||||
BGAnimationLayer::BGAnimationLayer( bool Generic )
|
BGAnimationLayer::BGAnimationLayer( bool Generic )
|
||||||
|
|||||||
@@ -15,6 +15,7 @@
|
|||||||
#include "arch/arch.h"
|
#include "arch/arch.h"
|
||||||
#include "BeginnerHelper.h"
|
#include "BeginnerHelper.h"
|
||||||
#include "StageStats.h"
|
#include "StageStats.h"
|
||||||
|
#include "ScreenDimensions.h"
|
||||||
|
|
||||||
#include <set>
|
#include <set>
|
||||||
|
|
||||||
|
|||||||
@@ -10,6 +10,7 @@
|
|||||||
#include "Steps.h"
|
#include "Steps.h"
|
||||||
#include "Style.h"
|
#include "Style.h"
|
||||||
#include "Model.h"
|
#include "Model.h"
|
||||||
|
#include "ScreenDimensions.h"
|
||||||
|
|
||||||
// "PLAYER_X" offsets are relative to the pad.. ex: Setting this to 10, and the HELPER to 300, will put the dancer at 310
|
// "PLAYER_X" offsets are relative to the pad.. ex: Setting this to 10, and the HELPER to 300, will put the dancer at 310
|
||||||
#define PLAYER_X( px ) THEME->GetMetricF("BeginnerHelper",ssprintf("Player%d_X",px+1))
|
#define PLAYER_X( px ) THEME->GetMetricF("BeginnerHelper",ssprintf("Player%d_X",px+1))
|
||||||
|
|||||||
@@ -7,25 +7,6 @@
|
|||||||
#include "Difficulty.h" // TODO: Get rid of this dependency.
|
#include "Difficulty.h" // TODO: Get rid of this dependency.
|
||||||
#include "EnumHelper.h"
|
#include "EnumHelper.h"
|
||||||
|
|
||||||
//
|
|
||||||
// Screen Dimensions
|
|
||||||
//
|
|
||||||
#define SCREEN_WIDTH (640)
|
|
||||||
#define SCREEN_HEIGHT (480)
|
|
||||||
|
|
||||||
#define SCREEN_LEFT (0)
|
|
||||||
#define SCREEN_RIGHT (SCREEN_WIDTH)
|
|
||||||
#define SCREEN_TOP (0)
|
|
||||||
#define SCREEN_BOTTOM (SCREEN_HEIGHT)
|
|
||||||
|
|
||||||
#define CENTER_X (SCREEN_LEFT + (SCREEN_RIGHT - SCREEN_LEFT)/2.0f)
|
|
||||||
#define CENTER_Y (SCREEN_TOP + (SCREEN_BOTTOM - SCREEN_TOP)/2.0f)
|
|
||||||
|
|
||||||
#define SCREEN_NEAR (-1000)
|
|
||||||
#define SCREEN_FAR (1000)
|
|
||||||
|
|
||||||
#define ARROW_SIZE (64)
|
|
||||||
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Note definitions
|
// Note definitions
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
#include "global.h"
|
#include "global.h"
|
||||||
#include "LyricDisplay.h"
|
#include "LyricDisplay.h"
|
||||||
|
#include "ScreenDimensions.h"
|
||||||
|
|
||||||
#include "GameState.h"
|
#include "GameState.h"
|
||||||
#include "ThemeManager.h"
|
#include "ThemeManager.h"
|
||||||
|
|||||||
@@ -14,6 +14,7 @@
|
|||||||
#include "NoteFieldPositioning.h"
|
#include "NoteFieldPositioning.h"
|
||||||
#include "NoteSkinManager.h"
|
#include "NoteSkinManager.h"
|
||||||
#include "song.h"
|
#include "song.h"
|
||||||
|
#include "ScreenDimensions.h"
|
||||||
|
|
||||||
NoteField::NoteField()
|
NoteField::NoteField()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -10,6 +10,7 @@
|
|||||||
#include "GameManager.h"
|
#include "GameManager.h"
|
||||||
#include "IniFile.h"
|
#include "IniFile.h"
|
||||||
#include "Game.h"
|
#include "Game.h"
|
||||||
|
#include "ScreenDimensions.h"
|
||||||
|
|
||||||
/* Copies of the current mode. Update this by calling Load. */
|
/* Copies of the current mode. Update this by calling Load. */
|
||||||
NoteFieldMode g_NoteFieldMode[NUM_PLAYERS];
|
NoteFieldMode g_NoteFieldMode[NUM_PLAYERS];
|
||||||
|
|||||||
@@ -27,6 +27,7 @@
|
|||||||
#include "Game.h"
|
#include "Game.h"
|
||||||
#include "NetworkSyncManager.h" //used for sending timing offset
|
#include "NetworkSyncManager.h" //used for sending timing offset
|
||||||
#include "DancingCharacters.h"
|
#include "DancingCharacters.h"
|
||||||
|
#include "ScreenDimensions.h"
|
||||||
|
|
||||||
CachedThemeMetricF GRAY_ARROWS_Y_STANDARD ("Player","ReceptorArrowsYStandard");
|
CachedThemeMetricF GRAY_ARROWS_Y_STANDARD ("Player","ReceptorArrowsYStandard");
|
||||||
CachedThemeMetricF GRAY_ARROWS_Y_REVERSE ("Player","ReceptorArrowsYReverse");
|
CachedThemeMetricF GRAY_ARROWS_Y_REVERSE ("Player","ReceptorArrowsYReverse");
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ public:
|
|||||||
m_defaultValue( defaultValue ),
|
m_defaultValue( defaultValue ),
|
||||||
m_currentValue( defaultValue )
|
m_currentValue( defaultValue )
|
||||||
{
|
{
|
||||||
Subscribe( this );
|
PrefsManager::Subscribe( this );
|
||||||
}
|
}
|
||||||
|
|
||||||
void LoadDefault()
|
void LoadDefault()
|
||||||
|
|||||||
@@ -25,9 +25,9 @@ const CString DEFAULT_LIGHTS_DRIVER = "Null";
|
|||||||
//
|
//
|
||||||
// For self-registering prefs
|
// For self-registering prefs
|
||||||
//
|
//
|
||||||
vector<IPreference*> *g_pvpSubscribers = NULL;
|
static vector<IPreference*> *g_pvpSubscribers = NULL;
|
||||||
|
|
||||||
void Subscribe( IPreference *p )
|
void PrefsManager::Subscribe( IPreference *p )
|
||||||
{
|
{
|
||||||
// TRICKY: If we make this a global vector instead of a global pointer,
|
// TRICKY: If we make this a global vector instead of a global pointer,
|
||||||
// then we'd have to be careful that the static constructors of all
|
// then we'd have to be careful that the static constructors of all
|
||||||
|
|||||||
@@ -281,16 +281,17 @@ public:
|
|||||||
|
|
||||||
void ResetToFactoryDefaults();
|
void ResetToFactoryDefaults();
|
||||||
|
|
||||||
|
//
|
||||||
|
// For self-registering prefs
|
||||||
|
//
|
||||||
|
static void Subscribe( IPreference *p );
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void ReadPrefsFromFile( CString sIni );
|
void ReadPrefsFromFile( CString sIni );
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
//
|
|
||||||
// For self-registering prefs
|
|
||||||
//
|
|
||||||
void Subscribe( IPreference *p );
|
|
||||||
|
|
||||||
|
|
||||||
/* This is global, because it can be accessed by crash handlers and error handlers
|
/* This is global, because it can be accessed by crash handlers and error handlers
|
||||||
|
|||||||
@@ -11,6 +11,7 @@
|
|||||||
#include "SDL_rotozoom.h"
|
#include "SDL_rotozoom.h"
|
||||||
#include "RageSurface.h"
|
#include "RageSurface.h"
|
||||||
#include "Preference.h"
|
#include "Preference.h"
|
||||||
|
#include "ScreenDimensions.h"
|
||||||
|
|
||||||
//
|
//
|
||||||
// Statistics stuff
|
// Statistics stuff
|
||||||
|
|||||||
@@ -21,6 +21,7 @@
|
|||||||
#include "PrefsManager.h"
|
#include "PrefsManager.h"
|
||||||
#include "RageSurface.h"
|
#include "RageSurface.h"
|
||||||
#include "RageSurfaceUtils.h"
|
#include "RageSurfaceUtils.h"
|
||||||
|
#include "ScreenDimensions.h"
|
||||||
|
|
||||||
#include "arch/arch.h"
|
#include "arch/arch.h"
|
||||||
|
|
||||||
|
|||||||
@@ -22,6 +22,7 @@
|
|||||||
#include "RageSurface.h"
|
#include "RageSurface.h"
|
||||||
#include "RageSurfaceUtils.h"
|
#include "RageSurfaceUtils.h"
|
||||||
#include "PrefsManager.h" // XXX
|
#include "PrefsManager.h" // XXX
|
||||||
|
#include "ScreenDimensions.h" // XXX
|
||||||
|
|
||||||
/* Windows's broken gl.h defines GL_EXT_paletted_texture incompletely: */
|
/* Windows's broken gl.h defines GL_EXT_paletted_texture incompletely: */
|
||||||
#ifndef GL_TEXTURE_INDEX_SIZE_EXT
|
#ifndef GL_TEXTURE_INDEX_SIZE_EXT
|
||||||
|
|||||||
@@ -12,6 +12,7 @@
|
|||||||
#include "ThemeManager.h"
|
#include "ThemeManager.h"
|
||||||
#include "RageDisplay.h"
|
#include "RageDisplay.h"
|
||||||
#include "Bookkeeper.h"
|
#include "Bookkeeper.h"
|
||||||
|
#include "ScreenDimensions.h"
|
||||||
|
|
||||||
|
|
||||||
ScreenBookkeeping::ScreenBookkeeping( CString sClassName ) : ScreenWithMenuElements( sClassName )
|
ScreenBookkeeping::ScreenBookkeeping( CString sClassName ) : ScreenWithMenuElements( sClassName )
|
||||||
|
|||||||
@@ -11,6 +11,7 @@
|
|||||||
#include "ThemeManager.h"
|
#include "ThemeManager.h"
|
||||||
#include "RageDisplay.h"
|
#include "RageDisplay.h"
|
||||||
#include "HelpDisplay.h"
|
#include "HelpDisplay.h"
|
||||||
|
#include "ScreenDimensions.h"
|
||||||
|
|
||||||
ScreenCenterImage::ScreenCenterImage( CString sClassName ) : ScreenWithMenuElements( sClassName )
|
ScreenCenterImage::ScreenCenterImage( CString sClassName ) : ScreenWithMenuElements( sClassName )
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -0,0 +1,32 @@
|
|||||||
|
#include "global.h"
|
||||||
|
#include "ScreenDimensions.h"
|
||||||
|
|
||||||
|
ThemeMetric<float> SCREEN_WIDTH("Common","ScreenWidth");
|
||||||
|
ThemeMetric<float> SCREEN_HEIGHT("Common","ScreenHeight");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* (c) 2001-2002 Chris Danford
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||||
|
* copy of this software and associated documentation files (the
|
||||||
|
* "Software"), to deal in the Software without restriction, including
|
||||||
|
* without limitation the rights to use, copy, modify, merge, publish,
|
||||||
|
* distribute, and/or sell copies of the Software, and to permit persons to
|
||||||
|
* whom the Software is furnished to do so, provided that the above
|
||||||
|
* copyright notice(s) and this permission notice appear in all copies of
|
||||||
|
* the Software and that both the above copyright notice(s) and this
|
||||||
|
* permission notice appear in supporting documentation.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||||
|
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||||
|
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF
|
||||||
|
* THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS
|
||||||
|
* INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT
|
||||||
|
* OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
|
||||||
|
* OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
||||||
|
* OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||||
|
* PERFORMANCE OF THIS SOFTWARE.
|
||||||
|
*/
|
||||||
@@ -1,9 +1,12 @@
|
|||||||
|
/* ScoreKeeperMAX2 - MAX2-style scorekeeping. */
|
||||||
|
|
||||||
#ifndef SCREEN_DIMENSIONS_H
|
#ifndef SCREEN_DIMENSIONS_H
|
||||||
#define SCREEN_DIMENSIONS_H
|
#define SCREEN_DIMENSIONS_H
|
||||||
|
|
||||||
|
#include "ThemeMetric.h"
|
||||||
|
|
||||||
#define SCREEN_WIDTH (640)
|
extern ThemeMetric<float> SCREEN_WIDTH;
|
||||||
#define SCREEN_HEIGHT (480)
|
extern ThemeMetric<float> SCREEN_HEIGHT;
|
||||||
|
|
||||||
#define SCREEN_LEFT (0)
|
#define SCREEN_LEFT (0)
|
||||||
#define SCREEN_RIGHT (SCREEN_WIDTH)
|
#define SCREEN_RIGHT (SCREEN_WIDTH)
|
||||||
@@ -13,6 +16,10 @@
|
|||||||
#define CENTER_X (SCREEN_LEFT + (SCREEN_RIGHT - SCREEN_LEFT)/2.0f)
|
#define CENTER_X (SCREEN_LEFT + (SCREEN_RIGHT - SCREEN_LEFT)/2.0f)
|
||||||
#define CENTER_Y (SCREEN_TOP + (SCREEN_BOTTOM - SCREEN_TOP)/2.0f)
|
#define CENTER_Y (SCREEN_TOP + (SCREEN_BOTTOM - SCREEN_TOP)/2.0f)
|
||||||
|
|
||||||
|
#define SCREEN_NEAR (-1000)
|
||||||
|
#define SCREEN_FAR (1000)
|
||||||
|
|
||||||
|
#define ARROW_SIZE (64)
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -23,6 +23,7 @@
|
|||||||
#include "SongUtil.h"
|
#include "SongUtil.h"
|
||||||
#include "StepsUtil.h"
|
#include "StepsUtil.h"
|
||||||
#include "Foreach.h"
|
#include "Foreach.h"
|
||||||
|
#include "ScreenDimensions.h"
|
||||||
|
|
||||||
|
|
||||||
const float RECORD_HOLD_SECONDS = 0.3f;
|
const float RECORD_HOLD_SECONDS = 0.3f;
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
#include "RageLog.h"
|
#include "RageLog.h"
|
||||||
#include "ScreenManager.h"
|
#include "ScreenManager.h"
|
||||||
#include "ScreenEndlessBreak.h"
|
#include "ScreenEndlessBreak.h"
|
||||||
|
#include "ScreenDimensions.h"
|
||||||
|
|
||||||
//TODO:: Add scripting support
|
//TODO:: Add scripting support
|
||||||
|
|
||||||
|
|||||||
@@ -16,6 +16,7 @@
|
|||||||
#include "AnnouncerManager.h"
|
#include "AnnouncerManager.h"
|
||||||
#include "MenuTimer.h"
|
#include "MenuTimer.h"
|
||||||
#include "StepsUtil.h"
|
#include "StepsUtil.h"
|
||||||
|
#include "ScreenDimensions.h"
|
||||||
|
|
||||||
#define SCROLLING_LIST_X THEME->GetMetricF("ScreenEz2SelectMusic","ScrollingListX")
|
#define SCROLLING_LIST_X THEME->GetMetricF("ScreenEz2SelectMusic","ScrollingListX")
|
||||||
#define SCROLLING_LIST_Y THEME->GetMetricF("ScreenEz2SelectMusic","ScrollingListY")
|
#define SCROLLING_LIST_Y THEME->GetMetricF("ScreenEz2SelectMusic","ScrollingListY")
|
||||||
|
|||||||
@@ -13,6 +13,7 @@
|
|||||||
#include "RageTimer.h"
|
#include "RageTimer.h"
|
||||||
#include "ThemeManager.h"
|
#include "ThemeManager.h"
|
||||||
#include "MenuTimer.h"
|
#include "MenuTimer.h"
|
||||||
|
#include "ScreenDimensions.h"
|
||||||
|
|
||||||
/* Constants */
|
/* Constants */
|
||||||
|
|
||||||
|
|||||||
@@ -40,6 +40,7 @@
|
|||||||
#include "NetworkSyncManager.h"
|
#include "NetworkSyncManager.h"
|
||||||
#include "Foreach.h"
|
#include "Foreach.h"
|
||||||
#include "DancingCharacters.h"
|
#include "DancingCharacters.h"
|
||||||
|
#include "ScreenDimensions.h"
|
||||||
|
|
||||||
//
|
//
|
||||||
// Defines
|
// Defines
|
||||||
|
|||||||
@@ -8,6 +8,7 @@
|
|||||||
#include "GameState.h"
|
#include "GameState.h"
|
||||||
#include "ThemeManager.h"
|
#include "ThemeManager.h"
|
||||||
#include "PrefsManager.h"
|
#include "PrefsManager.h"
|
||||||
|
#include "ScreenDimensions.h"
|
||||||
|
|
||||||
|
|
||||||
ScreenInstructions::ScreenInstructions( CString sName ) : ScreenWithMenuElements( sName )
|
ScreenInstructions::ScreenInstructions( CString sName ) : ScreenWithMenuElements( sName )
|
||||||
|
|||||||
@@ -13,6 +13,7 @@
|
|||||||
#include "RageDisplay.h"
|
#include "RageDisplay.h"
|
||||||
#include "Game.h"
|
#include "Game.h"
|
||||||
#include "HelpDisplay.h"
|
#include "HelpDisplay.h"
|
||||||
|
#include "ScreenDimensions.h"
|
||||||
|
|
||||||
|
|
||||||
#define EVEN_LINE_IN THEME->GetMetric("ScreenMapControllers","EvenLineIn")
|
#define EVEN_LINE_IN THEME->GetMetric("ScreenMapControllers","EvenLineIn")
|
||||||
|
|||||||
@@ -7,6 +7,7 @@
|
|||||||
#include "PrefsManager.h"
|
#include "PrefsManager.h"
|
||||||
#include "ThemeManager.h"
|
#include "ThemeManager.h"
|
||||||
#include "Foreach.h"
|
#include "Foreach.h"
|
||||||
|
#include "ScreenDimensions.h"
|
||||||
|
|
||||||
|
|
||||||
const float LABEL_X = 200;
|
const float LABEL_X = 200;
|
||||||
|
|||||||
@@ -6,6 +6,7 @@
|
|||||||
#include "AnnouncerManager.h"
|
#include "AnnouncerManager.h"
|
||||||
#include "song.h"
|
#include "song.h"
|
||||||
#include "SongUtil.h"
|
#include "SongUtil.h"
|
||||||
|
#include "ScreenDimensions.h"
|
||||||
|
|
||||||
|
|
||||||
#define SCROLL_DELAY THEME->GetMetricF("ScreenMusicScroll","ScrollDelay")
|
#define SCROLL_DELAY THEME->GetMetricF("ScreenMusicScroll","ScrollDelay")
|
||||||
|
|||||||
@@ -17,6 +17,7 @@
|
|||||||
#include "NoteFieldPositioning.h"
|
#include "NoteFieldPositioning.h"
|
||||||
#include "StageStats.h"
|
#include "StageStats.h"
|
||||||
#include "Game.h"
|
#include "Game.h"
|
||||||
|
#include "ScreenDimensions.h"
|
||||||
|
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|||||||
@@ -22,6 +22,7 @@
|
|||||||
#include "RageDisplay.h"
|
#include "RageDisplay.h"
|
||||||
#include "Foreach.h"
|
#include "Foreach.h"
|
||||||
#include "Style.h"
|
#include "Style.h"
|
||||||
|
#include "ScreenDimensions.h"
|
||||||
|
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|||||||
@@ -13,6 +13,7 @@
|
|||||||
#include "song.h"
|
#include "song.h"
|
||||||
#include "Course.h"
|
#include "Course.h"
|
||||||
#include "Style.h"
|
#include "Style.h"
|
||||||
|
#include "ScreenDimensions.h"
|
||||||
|
|
||||||
const float ITEM_X[NUM_PLAYERS] = { 260, 420 };
|
const float ITEM_X[NUM_PLAYERS] = { 260, 420 };
|
||||||
|
|
||||||
|
|||||||
@@ -9,6 +9,7 @@
|
|||||||
#include "ScreenSongOptions.h"
|
#include "ScreenSongOptions.h"
|
||||||
#include "PrefsManager.h"
|
#include "PrefsManager.h"
|
||||||
#include "CodeDetector.h"
|
#include "CodeDetector.h"
|
||||||
|
#include "ScreenDimensions.h"
|
||||||
|
|
||||||
|
|
||||||
#define PREV_SCREEN THEME->GetMetric ("ScreenPlayerOptions","PrevScreen")
|
#define PREV_SCREEN THEME->GetMetric ("ScreenPlayerOptions","PrevScreen")
|
||||||
|
|||||||
@@ -6,12 +6,13 @@
|
|||||||
#include "GameConstantsAndTypes.h"
|
#include "GameConstantsAndTypes.h"
|
||||||
#include "PrefsManager.h"
|
#include "PrefsManager.h"
|
||||||
#include "ThemeManager.h"
|
#include "ThemeManager.h"
|
||||||
|
#include "ScreenDimensions.h"
|
||||||
|
|
||||||
const float QUESTION_X = CENTER_X;
|
#define QUESTION_X (CENTER_X)
|
||||||
const float QUESTION_Y = CENTER_Y - 60;
|
#define QUESTION_Y (CENTER_Y - 60)
|
||||||
|
|
||||||
const float PROMPT_X = CENTER_X;
|
#define PROMPT_X (CENTER_X)
|
||||||
const float PROMPT_Y = CENTER_Y + 120;
|
#define PROMPT_Y (CENTER_Y + 120)
|
||||||
|
|
||||||
bool ScreenPrompt::s_bLastAnswer = false;
|
bool ScreenPrompt::s_bLastAnswer = false;
|
||||||
|
|
||||||
|
|||||||
@@ -12,6 +12,7 @@
|
|||||||
#include "ProfileManager.h"
|
#include "ProfileManager.h"
|
||||||
#include "RageLog.h"
|
#include "RageLog.h"
|
||||||
#include "UnlockSystem.h"
|
#include "UnlockSystem.h"
|
||||||
|
#include "ScreenDimensions.h"
|
||||||
|
|
||||||
static const CString PageTypeNames[NUM_PAGE_TYPES] = {
|
static const CString PageTypeNames[NUM_PAGE_TYPES] = {
|
||||||
"Category",
|
"Category",
|
||||||
|
|||||||
@@ -6,6 +6,7 @@
|
|||||||
#include "RageTimer.h"
|
#include "RageTimer.h"
|
||||||
#include "RageLog.h"
|
#include "RageLog.h"
|
||||||
#include "ThemeManager.h"
|
#include "ThemeManager.h"
|
||||||
|
#include "ScreenDimensions.h"
|
||||||
|
|
||||||
#include "arch/LoadingWindow/LoadingWindow.h"
|
#include "arch/LoadingWindow/LoadingWindow.h"
|
||||||
|
|
||||||
|
|||||||
@@ -9,6 +9,7 @@
|
|||||||
#include "AnnouncerManager.h"
|
#include "AnnouncerManager.h"
|
||||||
#include "ModeChoice.h"
|
#include "ModeChoice.h"
|
||||||
#include "ActorUtil.h"
|
#include "ActorUtil.h"
|
||||||
|
#include "ScreenDimensions.h"
|
||||||
|
|
||||||
#define NUM_CHOICES_ON_PAGE_1 THEME->GetMetricI(m_sName,"NumChoicesOnPage1")
|
#define NUM_CHOICES_ON_PAGE_1 THEME->GetMetricI(m_sName,"NumChoicesOnPage1")
|
||||||
#define LOCK_INPUT_SECONDS THEME->GetMetricF(m_sName,"LockInputSeconds")
|
#define LOCK_INPUT_SECONDS THEME->GetMetricF(m_sName,"LockInputSeconds")
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
#include "RageTextureManager.h"
|
#include "RageTextureManager.h"
|
||||||
#include "ScreenManager.h"
|
#include "ScreenManager.h"
|
||||||
#include "GameConstantsAndTypes.h"
|
#include "GameConstantsAndTypes.h"
|
||||||
|
#include "ScreenDimensions.h"
|
||||||
|
|
||||||
|
|
||||||
static const float LineWidth = 400;
|
static const float LineWidth = 400;
|
||||||
|
|||||||
@@ -12,6 +12,7 @@
|
|||||||
#include "ThemeManager.h"
|
#include "ThemeManager.h"
|
||||||
#include "RageDisplay.h"
|
#include "RageDisplay.h"
|
||||||
#include "Game.h"
|
#include "Game.h"
|
||||||
|
#include "ScreenDimensions.h"
|
||||||
|
|
||||||
|
|
||||||
ScreenTestInput::ScreenTestInput( CString sClassName ) : ScreenWithMenuElements( sClassName )
|
ScreenTestInput::ScreenTestInput( CString sClassName ) : ScreenWithMenuElements( sClassName )
|
||||||
|
|||||||
@@ -13,6 +13,7 @@
|
|||||||
#include "RageDisplay.h"
|
#include "RageDisplay.h"
|
||||||
#include "LightsManager.h"
|
#include "LightsManager.h"
|
||||||
#include "Game.h"
|
#include "Game.h"
|
||||||
|
#include "ScreenDimensions.h"
|
||||||
|
|
||||||
|
|
||||||
ScreenTestLights::ScreenTestLights( CString sClassName ) : ScreenWithMenuElements( sClassName )
|
ScreenTestLights::ScreenTestLights( CString sClassName ) : ScreenWithMenuElements( sClassName )
|
||||||
|
|||||||
@@ -8,14 +8,15 @@
|
|||||||
#include "PrefsManager.h"
|
#include "PrefsManager.h"
|
||||||
#include "ThemeManager.h"
|
#include "ThemeManager.h"
|
||||||
#include "FontCharAliases.h"
|
#include "FontCharAliases.h"
|
||||||
|
#include "ScreenDimensions.h"
|
||||||
|
|
||||||
const float QUESTION_X = CENTER_X;
|
#define QUESTION_X (CENTER_X)
|
||||||
const float QUESTION_Y = CENTER_Y - 60;
|
#define QUESTION_Y (CENTER_Y - 60)
|
||||||
|
|
||||||
const float ANSWER_X = CENTER_X;
|
#define ANSWER_X (CENTER_X)
|
||||||
const float ANSWER_Y = CENTER_Y + 120;
|
#define ANSWER_Y (CENTER_Y + 120)
|
||||||
const float ANSWER_WIDTH = 440;
|
#define ANSWER_WIDTH (440)
|
||||||
const float ANSWER_HEIGHT = 30;
|
#define ANSWER_HEIGHT (30)
|
||||||
|
|
||||||
|
|
||||||
CString ScreenTextEntry::s_sLastAnswer = "";
|
CString ScreenTextEntry::s_sLastAnswer = "";
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
#include "GameState.h"
|
#include "GameState.h"
|
||||||
#include "ThemeManager.h"
|
#include "ThemeManager.h"
|
||||||
#include "Style.h"
|
#include "Style.h"
|
||||||
|
#include "ScreenDimensions.h"
|
||||||
|
|
||||||
|
|
||||||
SnapDisplay::SnapDisplay()
|
SnapDisplay::SnapDisplay()
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ LINK32=link.exe
|
|||||||
# SUBTRACT LINK32 /verbose /profile /pdb:none /incremental:no /nodefaultlib
|
# SUBTRACT LINK32 /verbose /profile /pdb:none /incremental:no /nodefaultlib
|
||||||
# Begin Special Build Tool
|
# Begin Special Build Tool
|
||||||
IntDir=.\../Debug6
|
IntDir=.\../Debug6
|
||||||
TargetDir=\temp\stepmania\Program
|
TargetDir=\stepmania\stepmania\Program
|
||||||
TargetName=StepMania-debug
|
TargetName=StepMania-debug
|
||||||
SOURCE="$(InputPath)"
|
SOURCE="$(InputPath)"
|
||||||
PreLink_Cmds=disasm\verinc cl /Zl /nologo /c verstub.cpp /Fo$(IntDir)\
|
PreLink_Cmds=disasm\verinc cl /Zl /nologo /c verstub.cpp /Fo$(IntDir)\
|
||||||
@@ -96,7 +96,7 @@ LINK32=link.exe
|
|||||||
# SUBTRACT LINK32 /verbose /pdb:none /debug
|
# SUBTRACT LINK32 /verbose /pdb:none /debug
|
||||||
# Begin Special Build Tool
|
# Begin Special Build Tool
|
||||||
IntDir=.\../Release6
|
IntDir=.\../Release6
|
||||||
TargetDir=\temp\stepmania\Program
|
TargetDir=\stepmania\stepmania\Program
|
||||||
TargetName=StepMania
|
TargetName=StepMania
|
||||||
SOURCE="$(InputPath)"
|
SOURCE="$(InputPath)"
|
||||||
PreLink_Cmds=disasm\verinc cl /Zl /nologo /c verstub.cpp /Fo$(IntDir)\
|
PreLink_Cmds=disasm\verinc cl /Zl /nologo /c verstub.cpp /Fo$(IntDir)\
|
||||||
@@ -952,6 +952,10 @@ SOURCE=.\ScoreKeeperRave.h
|
|||||||
# End Source File
|
# End Source File
|
||||||
# Begin Source File
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=.\ScreenDimensions.cpp
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
SOURCE=.\Song.cpp
|
SOURCE=.\Song.cpp
|
||||||
# End Source File
|
# End Source File
|
||||||
# Begin Source File
|
# Begin Source File
|
||||||
|
|||||||
@@ -830,6 +830,9 @@ cl /Zl /nologo /c verstub.cpp /Fo"$(IntDir)"\
|
|||||||
<File
|
<File
|
||||||
RelativePath="ScoreKeeperRave.h">
|
RelativePath="ScoreKeeperRave.h">
|
||||||
</File>
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="ScreenDimensions.cpp">
|
||||||
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath=".\Song.cpp">
|
RelativePath=".\Song.cpp">
|
||||||
</File>
|
</File>
|
||||||
|
|||||||
@@ -15,6 +15,8 @@
|
|||||||
#include "RageFile.h"
|
#include "RageFile.h"
|
||||||
#include "ScreenManager.h"
|
#include "ScreenManager.h"
|
||||||
#include "StepMania.h"
|
#include "StepMania.h"
|
||||||
|
#include "Foreach.h"
|
||||||
|
#include "ThemeMetric.h"
|
||||||
|
|
||||||
|
|
||||||
ThemeManager* THEME = NULL; // global object accessable from anywhere in the program
|
ThemeManager* THEME = NULL; // global object accessable from anywhere in the program
|
||||||
@@ -45,6 +47,28 @@ struct Theme
|
|||||||
deque<Theme> g_vThemes;
|
deque<Theme> g_vThemes;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//
|
||||||
|
// For self-registering metrics
|
||||||
|
//
|
||||||
|
static vector<IThemeMetric*> *g_pvpSubscribers = NULL;
|
||||||
|
|
||||||
|
void ThemeManager::Subscribe( IThemeMetric *p )
|
||||||
|
{
|
||||||
|
// TRICKY: If we make this a global vector instead of a global pointer,
|
||||||
|
// then we'd have to be careful that the static constructors of all
|
||||||
|
// Preferences are called before the vector constructor. It's
|
||||||
|
// too tricky to enfore that, so we'll allocate the vector ourself
|
||||||
|
// so that the compiler can't possibly call the vector constructor
|
||||||
|
// after we've already added to the vector.
|
||||||
|
if( g_pvpSubscribers == NULL )
|
||||||
|
g_pvpSubscribers = new vector<IThemeMetric*>;
|
||||||
|
g_pvpSubscribers->push_back( p );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* We spend a lot of time doing redundant theme path lookups. Cache results. */
|
/* We spend a lot of time doing redundant theme path lookups. Cache results. */
|
||||||
static map<CString, CString> g_ThemePathCache[NUM_ELEMENT_CATEGORIES];
|
static map<CString, CString> g_ThemePathCache[NUM_ELEMENT_CATEGORIES];
|
||||||
|
|
||||||
@@ -221,6 +245,9 @@ void ThemeManager::SwitchThemeAndLanguage( CString sThemeName, CString sLanguage
|
|||||||
// reload common sounds
|
// reload common sounds
|
||||||
if ( SCREENMAN != NULL )
|
if ( SCREENMAN != NULL )
|
||||||
SCREENMAN->ThemeChanged();
|
SCREENMAN->ThemeChanged();
|
||||||
|
|
||||||
|
// reload subscribers
|
||||||
|
FOREACH( IThemeMetric*, *g_pvpSubscribers, p ) (*p)->Read();
|
||||||
}
|
}
|
||||||
|
|
||||||
CString ThemeManager::GetThemeDirFromName( const CString &sThemeName )
|
CString ThemeManager::GetThemeDirFromName( const CString &sThemeName )
|
||||||
|
|||||||
@@ -8,6 +8,7 @@
|
|||||||
#include <set>
|
#include <set>
|
||||||
#include <deque>
|
#include <deque>
|
||||||
|
|
||||||
|
class IThemeMetric;
|
||||||
class IniFile;
|
class IniFile;
|
||||||
|
|
||||||
enum ElementCategory { BGAnimations, Fonts, Graphics, Numbers, Sounds, Other, NUM_ELEMENT_CATEGORIES };
|
enum ElementCategory { BGAnimations, Fonts, Graphics, Numbers, Sounds, Other, NUM_ELEMENT_CATEGORIES };
|
||||||
@@ -57,6 +58,17 @@ public:
|
|||||||
float GetMetricF( CString sClassName, CString sValueName );
|
float GetMetricF( CString sClassName, CString sValueName );
|
||||||
bool GetMetricB( CString sClassName, CString sValueName );
|
bool GetMetricB( CString sClassName, CString sValueName );
|
||||||
RageColor GetMetricC( CString sClassName, CString sValueName );
|
RageColor GetMetricC( CString sClassName, CString sValueName );
|
||||||
|
void GetMetric( CString sClassName, CString sValueName, CString &valueOut ) { valueOut = GetMetric( sClassName, sValueName ); }
|
||||||
|
void GetMetric( CString sClassName, CString sValueName, int &valueOut ) { valueOut = GetMetricI( sClassName, sValueName ); }
|
||||||
|
void GetMetric( CString sClassName, CString sValueName, float &valueOut ) { valueOut = GetMetricF( sClassName, sValueName ); }
|
||||||
|
void GetMetric( CString sClassName, CString sValueName, bool &valueOut ) { valueOut = GetMetricB( sClassName, sValueName ); }
|
||||||
|
void GetMetric( CString sClassName, CString sValueName, RageColor &valueOut ){ valueOut = GetMetricC( sClassName, sValueName ); }
|
||||||
|
|
||||||
|
//
|
||||||
|
// For self-registering metrics
|
||||||
|
//
|
||||||
|
static void Subscribe( IThemeMetric *p );
|
||||||
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void LoadThemeRecursive( deque<Theme> &theme, CString sThemeName );
|
void LoadThemeRecursive( deque<Theme> &theme, CString sThemeName );
|
||||||
|
|||||||
@@ -0,0 +1,73 @@
|
|||||||
|
/* ThemeMetric - Theme specific data. */
|
||||||
|
|
||||||
|
#ifndef THEME_METRIC_H
|
||||||
|
#define THEME_METRIC_H
|
||||||
|
|
||||||
|
#include "IniFile.h"
|
||||||
|
#include "ThemeManager.h"
|
||||||
|
|
||||||
|
class IThemeMetric
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
virtual ~IThemeMetric() { }
|
||||||
|
virtual void Read() = 0;
|
||||||
|
};
|
||||||
|
|
||||||
|
template <class T>
|
||||||
|
class ThemeMetric : public IThemeMetric
|
||||||
|
{
|
||||||
|
private:
|
||||||
|
CString m_sGroup;
|
||||||
|
CString m_sName;
|
||||||
|
T m_currentValue;
|
||||||
|
|
||||||
|
public:
|
||||||
|
ThemeMetric( const CString& sGroup, const CString& sName ):
|
||||||
|
m_sGroup( sGroup ),
|
||||||
|
m_sName( sName )
|
||||||
|
{
|
||||||
|
ThemeManager::Subscribe( this );
|
||||||
|
}
|
||||||
|
|
||||||
|
void Read()
|
||||||
|
{
|
||||||
|
THEME->GetMetric( m_sGroup, m_sName, m_currentValue );
|
||||||
|
}
|
||||||
|
|
||||||
|
const T& GetValue() const
|
||||||
|
{
|
||||||
|
return m_currentValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
operator const T& () const
|
||||||
|
{
|
||||||
|
return m_currentValue;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/*
|
||||||
|
* (c) 2001-2004 Chris Danford, Chris Gomez
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||||
|
* copy of this software and associated documentation files (the
|
||||||
|
* "Software"), to deal in the Software without restriction, including
|
||||||
|
* without limitation the rights to use, copy, modify, merge, publish,
|
||||||
|
* distribute, and/or sell copies of the Software, and to permit persons to
|
||||||
|
* whom the Software is furnished to do so, provided that the above
|
||||||
|
* copyright notice(s) and this permission notice appear in all copies of
|
||||||
|
* the Software and that both the above copyright notice(s) and this
|
||||||
|
* permission notice appear in supporting documentation.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||||
|
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||||
|
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF
|
||||||
|
* THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS
|
||||||
|
* INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT
|
||||||
|
* OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
|
||||||
|
* OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
||||||
|
* OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||||
|
* PERFORMANCE OF THIS SOFTWARE.
|
||||||
|
*/
|
||||||
Reference in New Issue
Block a user