[846] | 1 |
|
---|
| 2 | #include <assert.h>
|
---|
| 3 |
|
---|
| 4 | typedef enum { bShowHelp, bShowHud, LAST_BOOL } bool_t;
|
---|
| 5 | typedef enum { iGain, iPasses, iGlowPasses, iGlowGain, iStretch, LAST_NUMBER } number_t;
|
---|
| 6 |
|
---|
| 7 | enum { IDC_RESET_BUTTON = -3, IDC_SAVE_BUTTON, IDC_LOAD_BUTTON };
|
---|
| 8 |
|
---|
| 9 | #define CHARBUF 100 // The max length of a line in the save file
|
---|
| 10 |
|
---|
| 11 | typedef float (*CONVERTER)(float a);
|
---|
| 12 | typedef void (*ONCHANGE_CALLBACK)(void);
|
---|
| 13 |
|
---|
| 14 | float noconvert(float a); // { return a; }
|
---|
| 15 | float myconvert(float a); // { return a; }
|
---|
| 16 | float myPassConvert(float a);
|
---|
| 17 | float myGlowConvert(float a);
|
---|
| 18 | float stretchconvert(float a);
|
---|
| 19 | void OnChange(); // {}
|
---|
| 20 |
|
---|
| 21 |
|
---|
| 22 | class Parameters {
|
---|
| 23 | bool bparam[LAST_BOOL];
|
---|
| 24 | wchar_t bname[LAST_BOOL][CHARBUF];
|
---|
| 25 |
|
---|
| 26 | int param[LAST_NUMBER]; // 0..100 (0..num_steps)
|
---|
| 27 | wchar_t name[LAST_NUMBER][CHARBUF];
|
---|
| 28 | int numsteps[LAST_NUMBER];
|
---|
| 29 |
|
---|
| 30 | CONVERTER ffunc[LAST_NUMBER];
|
---|
| 31 | ONCHANGE_CALLBACK chfunc[LAST_NUMBER+3];
|
---|
| 32 |
|
---|
| 33 | CDXUTDialog* g_HUD;
|
---|
| 34 |
|
---|
| 35 | bool bSilent;
|
---|
| 36 | const static int CHARBUFFER_SIZE = 200;
|
---|
| 37 | enum { checkboxID0 = 1000, sliderID0 = 2000, staticID0 = 3000, upID0 = 4000, downID0 = 5000 };
|
---|
| 38 |
|
---|
| 39 | public:
|
---|
| 40 | void Setup( CDXUTDialog* g_HUD );
|
---|
| 41 | void Setup( CDXUTDialog* g_HUD, ONCHANGE_CALLBACK OnReset, ONCHANGE_CALLBACK OnSave = OnChange, ONCHANGE_CALLBACK OnLoad = OnChange);
|
---|
| 42 |
|
---|
| 43 | bool Get( bool_t i );
|
---|
| 44 | float Get( number_t i );
|
---|
| 45 | int GetInt( number_t i );
|
---|
| 46 |
|
---|
| 47 | void SetBool( bool_t ID, bool b );
|
---|
| 48 | void SetFloat( number_t ID, float v );
|
---|
| 49 | void SetInt( number_t ID, int v );
|
---|
| 50 |
|
---|
| 51 | void Add( bool_t ID, char* label, char cHotKey = 0 );
|
---|
| 52 | void Add( number_t ID, char* label, int num_steps);
|
---|
| 53 |
|
---|
| 54 | void Add( number_t ID, char* label, int num_steps,
|
---|
| 55 | CONVERTER ff, ONCHANGE_CALLBACK chf = OnChange );
|
---|
| 56 |
|
---|
| 57 | void Add( number_t ID, char* label, int num_steps, char cKeyDecr, char cKeyIncr,
|
---|
| 58 | CONVERTER ff = noconvert, ONCHANGE_CALLBACK chf = OnChange );
|
---|
| 59 |
|
---|
| 60 | void UpdateFromHUD( int controlID );
|
---|
| 61 |
|
---|
| 62 | void SaveToFile( char* fileName );
|
---|
| 63 | void LoadFromFile( char* fileName );
|
---|
| 64 | }; |
---|