Codechange: Remove direct access to _colour_gradient.
Access is now through GetColourGradient, which ensures parameters are in range.
This commit is contained in:

committed by
Peter Nelson

parent
56cf89d189
commit
0463d4c198
@@ -540,11 +540,12 @@ void ShowSelectGameWindow();
|
||||
*/
|
||||
void SetupColoursAndInitialWindow()
|
||||
{
|
||||
for (uint i = 0; i != 16; i++) {
|
||||
for (Colours i = COLOUR_BEGIN; i != COLOUR_END; i++) {
|
||||
const byte *b = GetNonSprite(GENERAL_SPRITE_COLOUR(i), SpriteType::Recolour);
|
||||
|
||||
assert(b);
|
||||
memcpy(_colour_gradient[i], b + 0xC6, sizeof(_colour_gradient[i]));
|
||||
assert(b != nullptr);
|
||||
for (uint j = 0; j < 8; j++) {
|
||||
SetColourGradient(i, j, b[0xC6 + j]);
|
||||
}
|
||||
}
|
||||
|
||||
new MainWindow(&_main_window_desc);
|
||||
|
Reference in New Issue
Block a user