mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2026-07-26 00:45:35 +00:00
Codechange: use EnumRange over many enum loops
This commit is contained in:
committed by
Peter Nelson
parent
c991564e12
commit
c3b0d71973
@@ -387,8 +387,8 @@ bool HandleBootstrap()
|
||||
* This way the mauve and gray colours work and we can show the user interface. */
|
||||
GfxInitPalettes();
|
||||
static const EnumIndexArray<uint8_t, Colours, Colours::End> offsets = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x80, 0, 0, 0, 0x04, 0x08 };
|
||||
for (Colours i = Colours::Begin; i != Colours::End; i++) {
|
||||
for (Shade j = Shade::Begin; j < Shade::End; j++) {
|
||||
for (Colours i : EnumRange(Colours::End)) {
|
||||
for (Shade j : EnumRange(Shade::End)) {
|
||||
SetColourGradient(i, j, PixelColour(offsets[i] + to_underlying(j)));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user