#pragma once #include "common.h" class AFX_CLASS_EXPORT T2PaletteAnime { public: T2PaletteAnime(T2WorldDef*, T2DateTime*); virtual ~T2PaletteAnime(); int IsSETime(); void ChangeSE(); void RotateDayLightPalette(unsigned int, unsigned int) const; void MinuteChanged(T2DateTime*); void DoAnimatePalette(); void ReplaceDayLightPalette(int); void SetSkyState(int, int); T2PaletteAnimeDef* GetPaletteAnimeDef() const { return mPaletteAnimeDef; } int GetSkyState() const { return mSkyState; } int GetSkyCount() const { return mSkyCount; } void IncSECount(); int GetSECount() const { return mSECount; } LOGPALETTE* GetInterPalette() { return mInterCTab; } int GetSEKind() const { return mSEKind; } BOOL IsUpdated() const { return mPaletteUpdated; } void ClearUpdate() { mPaletteUpdated = false; } BOOL IsFine() const; BOOL IsSnow() const; BOOL IsShininDay() const; protected: void RotatePalette(LOGPALETTE*, unsigned int, unsigned int) const; void AdjustSkyState(T2DateTime*); int IsChangeSkyTime(); void ChangeSkyColor(); private: void Init(); LOGPALETTE* MakeInterCTab(); void AdjustWindowColor(T2DateTime*); T2WorldDef *mWorldDef; T2WorldPlugin *mWorldPlugin; T2PaletteAnimeDef *mPaletteAnimeDef; LOGPALETTE *mInterCTab; BOOL mPaletteUpdated; int mSkyState; int mSkyCount; int mSECount; int mSEKind; unsigned int mSETimeNextTick; T2DayLightFilter *mDayLightFilter; T2WeatherFilter *mWeatherFilter; }; inline void T2PaletteAnime::IncSECount() { mSECount++; if (mSECount >= 60) mSECount = 0; } inline BOOL T2PaletteAnime::IsFine() const { BOOL result = true; if (mSkyState == 3 || mSkyState == 4) result = false; return result; } inline BOOL T2PaletteAnime::IsSnow() const { return (mSkyState == 4); } inline BOOL T2PaletteAnime::IsShininDay() const { switch (mSkyState) { case 3: case 4: case 9: case 10: return false; default: return true; } }