Skip to content

Commit

Permalink
DM: Pull K0016_aui_Palette_FadeTemporary into a class vaiable
Browse files Browse the repository at this point in the history
  • Loading branch information
Bendegúz Nagy committed Aug 26, 2016
1 parent 921431c commit 44a5e36
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
9 changes: 5 additions & 4 deletions engines/dm/gfx.cpp
Expand Up @@ -136,6 +136,8 @@ DisplayMan::DisplayMan(DMEngine *dmEngine) : _vm(dmEngine) {
_g345_aui_BlankBuffer[i] = 0;

_gK17_paletteFadeFrom = nullptr;
for (uint16 i = 0; i < 16; ++i)
_gK16_paletteFadeTemporary[i] = 0;

initConstants();
}
Expand Down Expand Up @@ -3751,14 +3753,13 @@ uint16 DisplayMan::f431_getDarkenedColor(uint16 RGBcolor) {
}

void DisplayMan::f436_STARTEND_FadeToPalette(uint16* P0849_pui_Palette) {
static uint16 K0016_aui_Palette_FadeTemporary[16];
uint16 *paletteRegister = K0016_aui_Palette_FadeTemporary;
uint16 *paletteRegister = _gK16_paletteFadeTemporary;

for (int16 i = 0; i < 16; i++)
paletteRegister[i] = _gK17_paletteFadeFrom[i];

for (int16 i = 0; i < 8; i++) {
paletteRegister = K0016_aui_Palette_FadeTemporary;
paletteRegister = _gK16_paletteFadeTemporary;
for (int16 colIdx = 0; colIdx < 16; colIdx++, paletteRegister++) {
uint16 currentRGBColor = getFlag(*paletteRegister, D12_MASK_BLUE_COMPONENT);
int16 targetRGBColor = getFlag(P0849_pui_Palette[colIdx], D12_MASK_BLUE_COMPONENT);
Expand Down Expand Up @@ -3802,7 +3803,7 @@ void DisplayMan::f436_STARTEND_FadeToPalette(uint16* P0849_pui_Palette) {
}
_vm->f22_delay(1);
_vm->_eventMan->f357_discardAllInput();
f508_buildPaletteChangeCopperList(K0016_aui_Palette_FadeTemporary, K0016_aui_Palette_FadeTemporary);
f508_buildPaletteChangeCopperList(_gK16_paletteFadeTemporary, _gK16_paletteFadeTemporary);
}
}

Expand Down
1 change: 1 addition & 0 deletions engines/dm/gfx.h
Expand Up @@ -670,6 +670,7 @@ class DisplayMan {
int16 _g695_doorNativeBitmapIndex_Front_D1LCR[2]; // @ G0695_ai_DoorNativeBitmapIndex_Front_D1LCR

uint16 *_gK17_paletteFadeFrom; // @ K0017_pui_Palette_FadeFrom
uint16 _gK16_paletteFadeTemporary[16]; // @ K0016_aui_Palette_FadeTemporary
public:

uint16 _screenWidth;
Expand Down

0 comments on commit 44a5e36

Please sign in to comment.