diff options
Diffstat (limited to '')
-rw-r--r-- | src/T2DLL/T2PaletteAnime.cpp | 64 |
1 files changed, 32 insertions, 32 deletions
diff --git a/src/T2DLL/T2PaletteAnime.cpp b/src/T2DLL/T2PaletteAnime.cpp index da9fc8e..d1dee3b 100644 --- a/src/T2DLL/T2PaletteAnime.cpp +++ b/src/T2DLL/T2PaletteAnime.cpp @@ -65,18 +65,18 @@ LOGPALETTE* T2PaletteAnime::MakeInterCTab() { } BOOL T2PaletteAnime::IsSETime() { - BOOL result = false; - DWORD now = TickCount(); + BOOL isSETime = false; + DWORD ticks = TickCount(); - if (mSETimeNextTick <= now) { - mSETimeNextTick = now + 2; + if (mSETimeNextTick <= ticks) { + mSETimeNextTick = ticks + 2; mSECount++; if (mSECount >= 60) mSECount = 0; - result = true; + isSETime = true; } - return result; + return isSETime; } void T2PaletteAnime::ChangeSE() { @@ -88,14 +88,14 @@ void T2PaletteAnime::ChangeSE() { mSEKind = 0; int numOfSEColor = mPaletteAnimeDef->GetNumOfSEColor(); - int interStartIndex = mPaletteAnimeDef->GetNumOfRefrectColor() + mPaletteAnimeDef->GetNumOfSkyColor(); - int seStartIndex = numOfSEColor * mSEKind; - LOGPALETTE *sePal = mPaletteAnimeDef->GetSEPalette(); + int interIndex = mPaletteAnimeDef->GetNumOfRefrectColor() + mPaletteAnimeDef->GetNumOfSkyColor(); + int srcIndex = numOfSEColor * mSEKind; + LOGPALETTE *theSEPalette = mPaletteAnimeDef->GetSEPalette(); for (int i = 0; i < numOfSEColor; i++) { - mInterCTab->palPalEntry[interStartIndex + i].peRed = sePal->palPalEntry[seStartIndex + i].peRed; - mInterCTab->palPalEntry[interStartIndex + i].peGreen = sePal->palPalEntry[seStartIndex + i].peGreen; - mInterCTab->palPalEntry[interStartIndex + i].peBlue = sePal->palPalEntry[seStartIndex + i].peBlue; + mInterCTab->palPalEntry[interIndex + i].peRed = theSEPalette->palPalEntry[srcIndex + i].peRed; + mInterCTab->palPalEntry[interIndex + i].peGreen = theSEPalette->palPalEntry[srcIndex + i].peGreen; + mInterCTab->palPalEntry[interIndex + i].peBlue = theSEPalette->palPalEntry[srcIndex + i].peBlue; } mWorldDef->ChangeSEProc(this); @@ -109,14 +109,14 @@ void T2PaletteAnime::RotateDayLightPalette(unsigned int start, unsigned int coun } void T2PaletteAnime::RotatePalette(LOGPALETTE* pal, unsigned int start, unsigned int count) const { - PALETTEENTRY save = pal->palPalEntry[start]; + PALETTEENTRY theFirstEntry = pal->palPalEntry[start]; for (unsigned int i = start + 1; i < (start + count); i++) { PALETTEENTRY entry = pal->palPalEntry[i]; pal->palPalEntry[i - 1] = entry; } - pal->palPalEntry[start + count - 1] = save; + pal->palPalEntry[start + count - 1] = theFirstEntry; } void T2PaletteAnime::AdjustSkyState(T2DateTime* dateTime) { @@ -142,31 +142,31 @@ void T2PaletteAnime::ChangeSkyColor() { if (result == BOOL3_1) { mPaletteUpdated = true; } else if (result == BOOL3_NEG1) { - int i; - int numOfSkyColor = mPaletteAnimeDef->GetNumOfSkyColor(); - int numOfRefrectColor = mPaletteAnimeDef->GetNumOfRefrectColor(); - LOGPALETTE *dayLightPalette = mPaletteAnimeDef->GetDayLightPalette(); + int n; + int numOfSkyCol = mPaletteAnimeDef->GetNumOfSkyColor(); + int numOfRefrectCol = mPaletteAnimeDef->GetNumOfRefrectColor(); + LOGPALETTE *dayLightPal = mPaletteAnimeDef->GetDayLightPalette(); - for (i = 0; i < numOfSkyColor; i++) { + for (n = 0; n < numOfSkyCol; n++) { RGBQUAD c; - c.rgbRed = dayLightPalette->palPalEntry[i].peRed; - c.rgbGreen = dayLightPalette->palPalEntry[i].peGreen; - c.rgbBlue = dayLightPalette->palPalEntry[i].peBlue; + c.rgbRed = dayLightPal->palPalEntry[n].peRed; + c.rgbGreen = dayLightPal->palPalEntry[n].peGreen; + c.rgbBlue = dayLightPal->palPalEntry[n].peBlue; mDayLightFilter->SkyColor(&c); - mInterCTab->palPalEntry[i].peRed = c.rgbRed; - mInterCTab->palPalEntry[i].peGreen = c.rgbGreen; - mInterCTab->palPalEntry[i].peBlue = c.rgbBlue; + mInterCTab->palPalEntry[n].peRed = c.rgbRed; + mInterCTab->palPalEntry[n].peGreen = c.rgbGreen; + mInterCTab->palPalEntry[n].peBlue = c.rgbBlue; } - for (i = 0; i < numOfRefrectColor; i++) { + for (n = 0; n < numOfRefrectCol; n++) { RGBQUAD c; - c.rgbRed = dayLightPalette->palPalEntry[i + numOfSkyColor].peRed; - c.rgbGreen = dayLightPalette->palPalEntry[i + numOfSkyColor].peGreen; - c.rgbBlue = dayLightPalette->palPalEntry[i + numOfSkyColor].peBlue; + c.rgbRed = dayLightPal->palPalEntry[n + numOfSkyCol].peRed; + c.rgbGreen = dayLightPal->palPalEntry[n + numOfSkyCol].peGreen; + c.rgbBlue = dayLightPal->palPalEntry[n + numOfSkyCol].peBlue; mDayLightFilter->RefractionColor(&c); - mInterCTab->palPalEntry[i + numOfSkyColor].peRed = c.rgbRed; - mInterCTab->palPalEntry[i + numOfSkyColor].peGreen = c.rgbGreen; - mInterCTab->palPalEntry[i + numOfSkyColor].peBlue = c.rgbBlue; + mInterCTab->palPalEntry[n + numOfSkyCol].peRed = c.rgbRed; + mInterCTab->palPalEntry[n + numOfSkyCol].peGreen = c.rgbGreen; + mInterCTab->palPalEntry[n + numOfSkyCol].peBlue = c.rgbBlue; } mPaletteUpdated = true; |