From 665136bb088f1b25c1e7c37c854f6742a0575611 Mon Sep 17 00:00:00 2001 From: lolbot-iichan Date: Thu, 9 May 2019 00:38:48 +0300 Subject: WINTERMUTE: Add FoxTail engine versions to WMETargetExecutable enum FoxTail engine is a WME Light engine fork with closed sources. Some features have different behaviour in different versions of FoxTail engine. That's why we need to detect engine version. Note that FOXTAIL_OLDEST_VERSION > LATEST_VERSION. Most features are just new methods for Game, Actor, Array, etc. and are not guarded. Some hacks are common for all FoxTail versions, and are guarded with isFoxTail(). Some changes are specific to versions from v1 to v2, isFoxTail(v1,v2) is checked then. --- engines/wintermute/base/base_engine.h | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'engines') diff --git a/engines/wintermute/base/base_engine.h b/engines/wintermute/base/base_engine.h index a8770f6168..14a14a3c19 100644 --- a/engines/wintermute/base/base_engine.h +++ b/engines/wintermute/base/base_engine.h @@ -84,7 +84,14 @@ enum WMETargetExecutable { WME_1_9_2, // DEAD:CODE 2010 WME_1_9_3, // DEAD:CODE 2012, released as "1.10.1 beta" WME_LITE, - LATEST_VERSION + LATEST_VERSION, + FOXTAIL_OLDEST_VERSION, + FOXTAIL_1_2_227, + FOXTAIL_1_2_230, + FOXTAIL_1_2_304, + FOXTAIL_1_2_362, + FOXTAIL_1_2_527, + FOXTAIL_LATEST_VERSION }; class BaseFileManager; @@ -129,6 +136,12 @@ public: WMETargetExecutable getTargetExecutable() const { return _targetExecutable; } + static bool isFoxTailCheck(WMETargetExecutable t, WMETargetExecutable v1=FOXTAIL_OLDEST_VERSION, WMETargetExecutable v2=FOXTAIL_LATEST_VERSION) { + return t >= v1 && t <= v2; + } + bool isFoxTail(WMETargetExecutable v1=FOXTAIL_OLDEST_VERSION, WMETargetExecutable v2=FOXTAIL_LATEST_VERSION) const { + return isFoxTailCheck(_targetExecutable, v1, v2); + } }; } // End of namespace Wintermute -- cgit v1.2.3