Rev 81 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 81 | Rev 85 | ||
---|---|---|---|
Line 40... | Line 40... | ||
40 | theme_count++; // we know now one theme more |
40 | theme_count++; // we know now one theme more |
41 | 41 | ||
42 | // is it the selected theme ? |
42 | // is it the selected theme ? |
43 | if (_wcsicmp (wfd.cFileName, wantedtheme_name) == 0) |
43 | if (_wcsicmp (wfd.cFileName, wantedtheme_name) == 0) |
44 | { |
44 | { |
45 |
|
45 | Theme_LoadABitMore (&themes[theme_count - 1]); // start loading the theme data from this directory |
46 | selectedtheme_index = theme_count - 1; // remember the selected theme is this one |
46 | selectedtheme_index = theme_count - 1; // remember the selected theme is this one |
47 | } |
47 | } |
48 | } |
48 | } |
49 | } while (FindNextFile (hFind, &wfd)); // ...and don't stop as long as there are files to go |
49 | } while (FindNextFile (hFind, &wfd)); // ...and don't stop as long as there are files to go |
50 | 50 | ||
Line 61... | Line 61... | ||
61 | // have we found the selected theme ? |
61 | // have we found the selected theme ? |
62 | if (selectedtheme_index != -1) |
62 | if (selectedtheme_index != -1) |
63 | theme = &themes[selectedtheme_index]; // found it, so link it |
63 | theme = &themes[selectedtheme_index]; // found it, so link it |
64 | else |
64 | else |
65 | { |
65 | { |
66 |
|
66 | Theme_LoadABitMore (&themes[0]); // not found, so start loading the first available theme |
67 | theme = &themes[0]; // and link selected theme to it |
67 | theme = &themes[0]; // and link selected theme to it |
68 | } |
68 | } |
69 | 69 | ||
70 | // if we have a custom background specified, load it too |
70 | // if we have a custom background specified, load it too |
71 | if (custombackground_pathname[0] != 0) |
71 | if (custombackground_pathname[0] != 0) |
Line 99... | Line 99... | ||
99 | 99 | ||
100 | return; // nothing to do |
100 | return; // nothing to do |
101 | } |
101 | } |
102 | 102 | ||
103 | 103 | ||
104 | void |
104 | void Theme_LoadABitMore (theme_t *theme) |
105 | { |
105 | { |
106 | // this function loads a particular theme out of a theme subdirectory's files |
106 | // this function loads a particular theme out of a theme subdirectory's files |
107 | 107 | ||
108 | #define THEME_LOAD_STEP(id) if |
108 | #define THEME_LOAD_STEP(id) if (theme->load_index == (id)) |
109 | #define THEME_LOAD_TEXTURE(varname,texture_name) \ |
109 | #define THEME_LOAD_TEXTURE(varname,texture_name) \ |
110 | { \ |
110 | { \ |
111 | theme->varname = Render_LoadTexture (L"%s/themes/%s/" texture_name L".*", app_path, theme->name); \ |
111 | theme->varname = Render_LoadTexture (L"%s/themes/%s/" texture_name L".*", app_path, theme->name); \ |
112 | if (theme->varname == -1) \ |
112 | if (theme->varname == -1) \ |
113 | MessageBox (NULL, LOCALIZE (L"Error_UnableToAddTextureD3DXCreateTextureFromFileFailed"), LOCALIZE (L"FatalError"), MB_ICONERROR | MB_OK); \ |
113 | MessageBox (NULL, LOCALIZE (L"Error_UnableToAddTextureD3DXCreateTextureFromFileFailed"), LOCALIZE (L"FatalError"), MB_ICONERROR | MB_OK); \ |
Line 142... | Line 142... | ||
142 | wchar_t value[128]; |
142 | wchar_t value[128]; |
143 | light_t light; |
143 | light_t light; |
144 | void *inifile; |
144 | void *inifile; |
145 | int light_index; |
145 | int light_index; |
146 | int light_count; |
146 | int light_count; |
147 | int length; |
- | |
148 | int pos; |
- | |
149 | int red; |
147 | int red; |
150 | int green; |
148 | int green; |
151 | int blue; |
149 | int blue; |
152 | FILE *fp; |
150 | FILE *fp; |
153 | 151 |