From 37e364b2c6cc7487a1c888d256a73e5337bb7189 Mon Sep 17 00:00:00 2001 From: Ash Wolf Date: Wed, 14 Jun 2023 00:50:34 +0100 Subject: initial commit --- src/T2DLL/T2PaletteAnime.h | 69 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 src/T2DLL/T2PaletteAnime.h (limited to 'src/T2DLL/T2PaletteAnime.h') diff --git a/src/T2DLL/T2PaletteAnime.h b/src/T2DLL/T2PaletteAnime.h new file mode 100644 index 0000000..fd6ef53 --- /dev/null +++ b/src/T2DLL/T2PaletteAnime.h @@ -0,0 +1,69 @@ +#pragma once +#include "common.h" + +class DLL_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; } + int GetSECount() const { return mSECount; } + LOGPALETTE* GetInterPalette() { return mInterCTab; } + int GetSEKind() const { return mSEKind; } + BOOL IsUpdated() const { return mPaletteUpdated; } + void ClearUpdate() { mPaletteUpdated = false; } + void IncSECount() { + mSECount++; + if (mSECount >= 60) + mSECount = 0; + } + BOOL IsFine() const { + return (mSkyState == 3) || (mSkyState == 4); + } + BOOL IsSnow() const { return (mSkyState == 4); } + BOOL IsShininDay() const { + switch (mSkyState) { + case 3: + case 4: + case 9: + case 10: + return false; + default: + return true; + } + } + +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; +}; -- cgit v1.2.3