summaryrefslogtreecommitdiff
path: root/src/T2DLL/T2PaletteAnime.h
diff options
context:
space:
mode:
authorAsh Wolf <ninji@wuffs.org>2023-06-14 00:50:34 +0100
committerAsh Wolf <ninji@wuffs.org>2023-06-14 00:50:34 +0100
commit37e364b2c6cc7487a1c888d256a73e5337bb7189 (patch)
treeeaf6e857382eef16c2dd940eb4125536fbe068bd /src/T2DLL/T2PaletteAnime.h
downloadt2win-37e364b2c6cc7487a1c888d256a73e5337bb7189.tar.gz
t2win-37e364b2c6cc7487a1c888d256a73e5337bb7189.zip
initial commit
Diffstat (limited to 'src/T2DLL/T2PaletteAnime.h')
-rw-r--r--src/T2DLL/T2PaletteAnime.h69
1 files changed, 69 insertions, 0 deletions
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;
+};