1 | #pragma once
|
---|
2 | #include <assert.h>
|
---|
3 |
|
---|
4 | typedef enum { bShowHelp, bMoveLight, bLookFromLight, bDots, bTurbo, bCruise, LAST_BOOL } bool_t;
|
---|
5 | typedef enum { fLightScale, fIndirectLightingMode, fTorchDistance, LAST_NUMBER } number_t;
|
---|
6 |
|
---|
7 | enum { IDC_GEN_BUTTON = -4, IDC_RESET_BUTTON, 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 |
|
---|
16 | float convertLightScale(float a);
|
---|
17 | float convertTorchDistance(float a);
|
---|
18 | float convertInt4(float a);
|
---|
19 |
|
---|
20 | void OnChange(); // {}
|
---|
21 |
|
---|
22 |
|
---|
23 | class Parameters {
|
---|
24 | bool bparam[LAST_BOOL];
|
---|
25 | wchar_t bname[LAST_BOOL][CHARBUF];
|
---|
26 |
|
---|
27 | int param[LAST_NUMBER]; // 0..100 (0..num_steps)
|
---|
28 | wchar_t name[LAST_NUMBER][CHARBUF];
|
---|
29 | int numsteps[LAST_NUMBER];
|
---|
30 |
|
---|
31 | CONVERTER ffunc[LAST_NUMBER];
|
---|
32 | ONCHANGE_CALLBACK chfunc[LAST_NUMBER+3];
|
---|
33 |
|
---|
34 | CDXUTDialog* g_HUD;
|
---|
35 |
|
---|
36 | bool bSilent;
|
---|
37 | const static int CHARBUFFER_SIZE = 200;
|
---|
38 | enum { checkboxID0 = 1000, sliderID0 = 2000, staticID0 = 3000, upID0 = 4000, downID0 = 5000 };
|
---|
39 |
|
---|
40 | public:
|
---|
41 | void Setup( CDXUTDialog* g_HUD );
|
---|
42 | void Setup( CDXUTDialog* g_HUD, ONCHANGE_CALLBACK OnReset, ONCHANGE_CALLBACK OnSave = OnChange, ONCHANGE_CALLBACK OnLoad = OnChange);
|
---|
43 |
|
---|
44 | bool Get( bool_t i );
|
---|
45 | float Get( number_t i );
|
---|
46 | int GetInt( number_t i );
|
---|
47 |
|
---|
48 | void SetBool( bool_t ID, bool b );
|
---|
49 | void SetFloat( number_t ID, float v );
|
---|
50 | void SetInt( number_t ID, int v );
|
---|
51 |
|
---|
52 | void Add( bool_t ID, char* label, char cHotKey = 0 );
|
---|
53 | void Add( number_t ID, char* label, int num_steps);
|
---|
54 |
|
---|
55 | void Add( number_t ID, char* label, int num_steps,
|
---|
56 | CONVERTER ff, ONCHANGE_CALLBACK chf = OnChange );
|
---|
57 |
|
---|
58 | void Add( number_t ID, char* label, int num_steps, char cKeyDecr, char cKeyIncr,
|
---|
59 | CONVERTER ff = noconvert, ONCHANGE_CALLBACK chf = OnChange );
|
---|
60 |
|
---|
61 | void UpdateFromHUD( int controlID );
|
---|
62 |
|
---|
63 | void SaveToFile( char* fileName );
|
---|
64 | void LoadFromFile( char* fileName );
|
---|
65 | }; |
---|