Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members

ScreenOptionsMasterPrefs.h

Go to the documentation of this file.
00001 #ifndef SCREEN_OPTIONS_MASTER_PREFS_H 00002 #define SCREEN_OPTIONS_MASTER_PREFS_H 00003 00004 static const int MAX_OPTIONS=16; 00005 #define OPT_SAVE_PREFERENCES (1<<0) 00006 #define OPT_APPLY_GRAPHICS (1<<1) 00007 #define OPT_APPLY_THEME (1<<2) 00008 #define OPT_RESET_GAME (1<<3) 00009 #define OPT_APPLY_SOUND (1<<4) 00010 #define OPT_APPLY_SONG (1<<5) 00011 #define OPT_APPLY_ASPECT_RATIO (1<<6) 00012 00013 struct ConfOption 00014 { 00015 static ConfOption *Find( CString name ); 00016 00017 /* Name of this option. It's helpful to delimit this with newlines, as it'll 00018 * be the default display title. */ 00019 CString name; 00020 typedef void (*MoveData_t)( int &sel, bool ToSel, const ConfOption *pConfOption ); 00021 MoveData_t MoveData; 00022 int m_iEffects; 00023 00024 /* For dynamic options, update the options. Since this changes the available 00025 * options, this may invalidate the offsets returned by Get() and Put(). */ 00026 void UpdateAvailableOptions(); 00027 00028 /* Return the list of available selections; Get() and Put() use indexes into this 00029 * array. UpdateAvailableOptions() should be called before using this. */ 00030 void MakeOptionsList( CStringArray &out ) const; 00031 00032 inline int Get() const { int sel; MoveData( sel, true, this ); return sel; } 00033 inline void Put( int sel ) const { MoveData( sel, false, this ); } 00034 int GetEffects() const; 00035 00036 ConfOption( const char *n, MoveData_t m, 00037 const char *c0=NULL, const char *c1=NULL, const char *c2=NULL, const char *c3=NULL, const char *c4=NULL, const char *c5=NULL, const char *c6=NULL, const char *c7=NULL, const char *c8=NULL, const char *c9=NULL, const char *c10=NULL, const char *c11=NULL, const char *c12=NULL, const char *c13=NULL, const char *c14=NULL, const char *c15=NULL, const char *c16=NULL, const char *c17=NULL, const char *c18=NULL, const char *c19=NULL ) 00038 { 00039 name = n; 00040 MoveData = m; 00041 MakeOptionsListCB = NULL; 00042 m_iEffects = 0; 00043 #define PUSH( c ) if(c) names.push_back(c); 00044 PUSH(c0);PUSH(c1);PUSH(c2);PUSH(c3);PUSH(c4);PUSH(c5);PUSH(c6);PUSH(c7);PUSH(c8);PUSH(c9);PUSH(c10);PUSH(c11);PUSH(c12);PUSH(c13);PUSH(c14);PUSH(c15);PUSH(c16);PUSH(c17);PUSH(c18);PUSH(c19); 00045 #undef PUSH 00046 } 00047 00048 ConfOption( const char *n, MoveData_t m, 00049 void (*lst)( CStringArray &out ) ) 00050 { 00051 name = n; 00052 MoveData = m; 00053 MakeOptionsListCB = lst; 00054 m_iEffects = 0; 00055 } 00056 00057 00058 private: 00059 vector<CString> names; 00060 void (*MakeOptionsListCB)( CStringArray &out ); 00061 }; 00062 00063 00064 // HACK: This is used by ScreenTitleMenu 00065 void LifeDifficulty( int &sel, bool ToSel, const ConfOption *pConfOption ); 00066 00067 00068 #endif 00069 00070 /* 00071 * (c) 2003-2004 Glenn Maynard 00072 * All rights reserved. 00073 * 00074 * Permission is hereby granted, free of charge, to any person obtaining a 00075 * copy of this software and associated documentation files (the 00076 * "Software"), to deal in the Software without restriction, including 00077 * without limitation the rights to use, copy, modify, merge, publish, 00078 * distribute, and/or sell copies of the Software, and to permit persons to 00079 * whom the Software is furnished to do so, provided that the above 00080 * copyright notice(s) and this permission notice appear in all copies of 00081 * the Software and that both the above copyright notice(s) and this 00082 * permission notice appear in supporting documentation. 00083 * 00084 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 00085 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 00086 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF 00087 * THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS 00088 * INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT 00089 * OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS 00090 * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR 00091 * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 00092 * PERFORMANCE OF THIS SOFTWARE. 00093 */

Generated on Thu Jan 27 20:57:32 2005 for StepMania by doxygen 1.3.7