[Scummvm-git-logs] scummvm master -> c917c9d49e29dffc7d4b920d4073b00b2f6a0de5

mduggan noreply at scummvm.org
Fri Mar 17 00:59:39 UTC 2023


This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
94a565dcaf TETRAEDGE: Update support level for iOS demo
c917c9d49e TETRAEDGE: Add detection entries for paid iOS Syberias


Commit: 94a565dcaff8e89875f6663ced40aaff91446ef9
    https://github.com/scummvm/scummvm/commit/94a565dcaff8e89875f6663ced40aaff91446ef9
Author: Matthew Duggan (mgithub at guarana.org)
Date: 2023-03-17T09:53:47+09:00

Commit Message:
TETRAEDGE: Update support level for iOS demo

Changed paths:
  A engines/tetraedge/game/upsell_screen.cpp
  A engines/tetraedge/game/upsell_screen.h
    engines/tetraedge/detection_tables.h
    engines/tetraedge/game/application.cpp
    engines/tetraedge/game/application.h
    engines/tetraedge/game/lua_binds.cpp
    engines/tetraedge/module.mk
    engines/tetraedge/te/te_core.cpp
    engines/tetraedge/tetraedge.cpp
    engines/tetraedge/tetraedge.h


diff --git a/engines/tetraedge/detection_tables.h b/engines/tetraedge/detection_tables.h
index d9578d1b07d..c963e4691fe 100644
--- a/engines/tetraedge/detection_tables.h
+++ b/engines/tetraedge/detection_tables.h
@@ -42,18 +42,18 @@ const ADGameDescription GAME_DESCRIPTIONS[] = {
 		GUIO1(GAMEOPTION_CORRECT_MOVIE_ASPECT)
 	},
 
-	// iOS release v1.1.3
+	// iOS "free" release v1.1.3.  Not supported as we can't properly support
+	// the in-app purchase to enable the full game.
 	{
 		"syberia",
 		nullptr,
 		AD_ENTRY1s("Syberia", "d:be658efbcf4541f56b656f92a05d271a", 15821120),
 		Common::UNK_LANG,
 		Common::kPlatformIOS,
-		ADGF_TESTING,
+		ADGF_UNSUPPORTED | ADGF_DEMO,
 		GUIO1(GAMEOPTION_CORRECT_MOVIE_ASPECT)
 	},
 
-
 	// GOG release
 	{
 		"syberia2",
diff --git a/engines/tetraedge/game/application.cpp b/engines/tetraedge/game/application.cpp
index 3e9ce0a98fa..6bb3e0e1d38 100644
--- a/engines/tetraedge/game/application.cpp
+++ b/engines/tetraedge/game/application.cpp
@@ -65,7 +65,10 @@ _drawShadows(true) {
 	//
 	core->fileFlagSystemSetFlag("plateform", "MacOSX");
 	core->fileFlagSystemSetFlag("part", "Full");
-	core->fileFlagSystemSetFlag("distributor", "DefaultDistributor");
+	if (g_engine->isGameDemo())
+		core->fileFlagSystemSetFlag("distributor", "Freemium");
+	else
+		core->fileFlagSystemSetFlag("distributor", "DefaultDistributor");
 
 	TeLuaGUI tempGui;
 	tempGui.load("texts/Part.lua");
diff --git a/engines/tetraedge/game/application.h b/engines/tetraedge/game/application.h
index a37b6e3056e..8c7e3b8043f 100644
--- a/engines/tetraedge/game/application.h
+++ b/engines/tetraedge/game/application.h
@@ -33,6 +33,7 @@
 #include "tetraedge/game/owner_error_menu.h"
 #include "tetraedge/game/splash_screens.h"
 #include "tetraedge/game/in_game_scene.h"
+#include "tetraedge/game/upsell_screen.h"
 
 #include "tetraedge/te/te_visual_fade.h"
 #include "tetraedge/te/te_music.h"
@@ -93,6 +94,7 @@ public:
 	MainMenu &mainMenu() { return _mainMenu; }
 	TeMusic &music() { return _music; }
 	Credits &credits() { return _credits; }
+	UpsellScreen &upsellScreen() { return _upsellScreen; }
 	TeVisualFade &visualFade() { return _visFade; }
 	TeSpriteLayout &appSpriteLayout() { return _appSpriteLayout; }
 	TeSpriteLayout &mouseCursorLayout() { return _mouseCursorLayout; }
@@ -155,6 +157,7 @@ private:
 	Credits _credits;
 	OwnerErrorMenu _ownerErrorMenu;
 	SplashScreens _splashScreens;
+	UpsellScreen _upsellScreen;
 
 	TeIntrusivePtr<TeFont3> _fontComic;
 	TeIntrusivePtr<TeFont3> _fontArgh;
diff --git a/engines/tetraedge/game/lua_binds.cpp b/engines/tetraedge/game/lua_binds.cpp
index df3d001c2fb..d4b129bd863 100644
--- a/engines/tetraedge/game/lua_binds.cpp
+++ b/engines/tetraedge/game/lua_binds.cpp
@@ -326,6 +326,50 @@ static int tolua_ExportedFunctions_AddDocument00(lua_State *L) {
 	error("#ferror in function 'AddDocument': %d %d %s", err.index, err.array, err.type);
 }
 
+static bool IsFreemiumUnlocked() {
+	// Only called in demo versions of the game, so the answer is no.
+	return false;
+}
+
+static int tolua_ExportedFunctions_IsFreemiumUnlocked00(lua_State *L) {
+	tolua_Error err;
+	if (tolua_isnoobj(L, 2, &err)) {
+		bool result = IsFreemiumUnlocked();
+		tolua_pushboolean(L, result);
+		return 1;
+	}
+	error("#ferror in function 'IsFreemiumUnlocked': %d %d %s", err.index, err.array, err.type);
+}
+
+static void ReachedFreemiumLimit() {
+	Application *app = g_engine->getApplication();
+	app->upsellScreen().enter();
+}
+
+static int tolua_ExportedFunctions_ReachedFreemiumLimit00(lua_State *L) {
+	tolua_Error err;
+	if (tolua_isnoobj(L, 2, &err)) {
+		ReachedFreemiumLimit();
+		return 0;
+	}
+	error("#ferror in function 'ReachedFreemiumLimit': %d %d %s", err.index, err.array, err.type);
+}
+
+static bool IsFacebookLiked() {
+	// Only called in demo versions of the game, so the answer is no.
+	return false;
+}
+
+static int tolua_ExportedFunctions_IsFacebookLiked00(lua_State *L) {
+	tolua_Error err;
+	if (tolua_isnoobj(L, 2, &err)) {
+		bool result = IsFacebookLiked();
+		tolua_pushboolean(L, result);
+		return 1;
+	}
+	error("#ferror in function 'IsFacebookLiked': %d %d %s", err.index, err.array, err.type);
+}
+
 static void AddUnrecalAnim(const Common::String &newanim) {
 	Application *app = g_engine->getApplication();
 	Common::Array<Common::String> &anims = app->unrecalAnims();
@@ -2723,8 +2767,10 @@ void LuaOpenBinds(lua_State *L) {
 	tolua_function(L, "Random", tolua_ExportedFunctions_Random00);
 	tolua_function(L, "SetCharacterMeshVisible", tolua_ExportedFunctions_SetCharacterMeshVisible00);
 	tolua_function(L, "SetRecallageY", tolua_ExportedFunctions_SetRecallageY00);
-	// tolua_function(L, "IsFreemiumUnlocked", tolua_ExportedFunctions_IsFreemiumUnlocked00); // Unused
-	// tolua_function(L, "ReachedFreemiumLimit", tolua_ExportedFunctions_ReachedFreemiumLimit00); // Unused
+	tolua_function(L, "IsFreemiumUnlocked", tolua_ExportedFunctions_IsFreemiumUnlocked00);
+	tolua_function(L, "ReachedFreemiumLimit", tolua_ExportedFunctions_ReachedFreemiumLimit00);
+	tolua_function(L, "IsFacebookLiked", tolua_ExportedFunctions_IsFacebookLiked00);
+
 	tolua_function(L, "AddUnrecalAnim", tolua_ExportedFunctions_AddUnrecalAnim00);
 	tolua_function(L, "UnlockArtwork", tolua_ExportedFunctions_UnlockArtwork00);
 
diff --git a/engines/tetraedge/game/upsell_screen.cpp b/engines/tetraedge/game/upsell_screen.cpp
new file mode 100644
index 00000000000..a4bfba0ddb5
--- /dev/null
+++ b/engines/tetraedge/game/upsell_screen.cpp
@@ -0,0 +1,79 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#include "tetraedge/tetraedge.h"
+#include "tetraedge/game/application.h"
+#include "tetraedge/game/upsell_screen.h"
+
+#include "common/translation.h"
+
+namespace Tetraedge {
+
+UpsellScreen::UpsellScreen() {
+}
+
+void UpsellScreen::enter() {
+	if (!load("menus/upsell/UpsellScreen.lua")) {
+		error("Failed to load UpsellScreen.lua");
+	}
+
+	// Simplified logic from original as we don't support in-app purhcases.
+	Application *app = g_engine->getApplication();
+	app->frontLayout().addChild(layoutChecked("upsellMenu"));
+
+	TeButtonLayout *btn;
+	btn = buttonLayoutChecked("unlockLaterButton");
+	btn->onMouseClickValidated().add(this, &UpsellScreen::onQuitButton);
+
+	btn = buttonLayoutChecked("purchaseNowButton");
+	btn->onMouseClickValidated().add(this, &UpsellScreen::onPurchaseButton);
+	btn->setEnable(true);
+
+	btn = buttonLayoutChecked("alreadyPaidButton");
+	btn->onMouseClickValidated().add(this, &UpsellScreen::onAlreadyPurchasedButton);
+	btn->setEnable(true);
+}
+
+void UpsellScreen::leave() {
+	if (loaded())
+		unload();
+}
+
+bool UpsellScreen::onAlreadyPurchasedButton() {
+	warning("Ignoring button. In-game purchases not available in ScummVM");
+	return false;
+}
+
+bool UpsellScreen::onPurchaseButton() {
+	warning("Ignoring button. In-game purchases not available in ScummVM");
+	return false;
+}
+
+bool UpsellScreen::onQuitButton() {
+	leave();
+	Application *app = g_engine->getApplication();
+	app->captureFade();
+	app->mainMenu().enter();
+	app->fade();
+	return true;
+}
+
+} // end namespace Tetraedge
diff --git a/engines/tetraedge/game/upsell_screen.h b/engines/tetraedge/game/upsell_screen.h
new file mode 100644
index 00000000000..db3fc12cd63
--- /dev/null
+++ b/engines/tetraedge/game/upsell_screen.h
@@ -0,0 +1,45 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#ifndef TETRAEDGE_GAME_UPSELL_SCREEN_H
+#define TETRAEDGE_GAME_UPSELL_SCREEN_H
+
+#include "tetraedge/te/te_lua_gui.h"
+
+namespace Tetraedge {
+
+class UpsellScreen : TeLuaGUI {
+public:
+	UpsellScreen();
+
+	void enter() override;
+	void leave() override;
+
+private:
+	bool onAlreadyPurchasedButton();
+	bool onPurchaseButton();
+	bool onQuitButton();
+
+};
+
+} // end namespace Tetraedge
+
+#endif // TETRAEDGE_GAME_UPSELL_SCREEN_H
diff --git a/engines/tetraedge/module.mk b/engines/tetraedge/module.mk
index 3b0a957f65c..008a6c270cd 100644
--- a/engines/tetraedge/module.mk
+++ b/engines/tetraedge/module.mk
@@ -41,6 +41,7 @@ MODULE_OBJS := \
 	game/question2.o \
 	game/scene_lights_xml_parser.o \
 	game/splash_screens.o \
+	game/upsell_screen.o \
 	game/youki_manager.o \
 	te/micropather.o \
 	te/te_3d_object2.o \
diff --git a/engines/tetraedge/te/te_core.cpp b/engines/tetraedge/te/te_core.cpp
index 221261fa4e1..f788e3202c3 100644
--- a/engines/tetraedge/te/te_core.cpp
+++ b/engines/tetraedge/te/te_core.cpp
@@ -178,7 +178,8 @@ Common::FSNode TeCore::findFile(const Common::Path &path) const {
 		"iPhone-iPad",							// for iOS Syb 1
 		"iPhone-iPad/HD",						// for iOS Syb 1
 		"iPhone-iPad/HD/Freemium",				// for iOS Syb 1
-		"Android-MacOSX-iPhone-iPad"			// for iOS Syb 1
+		"Android-MacOSX-iPhone-iPad",			// for iOS Syb 1
+		"Freemium-BUKAFree/HD"					// for iOS Syb 1
 	};
 
 	const Common::Path langs[] = {
diff --git a/engines/tetraedge/tetraedge.cpp b/engines/tetraedge/tetraedge.cpp
index cb75ac7dde8..4ef5aa6ee47 100644
--- a/engines/tetraedge/tetraedge.cpp
+++ b/engines/tetraedge/tetraedge.cpp
@@ -142,6 +142,10 @@ Common::Platform TetraedgeEngine::getGamePlatform() const {
 	return _gameDescription->platform;
 }
 
+bool TetraedgeEngine::isGameDemo() const {
+	return (_gameDescription->flags & ADGF_DEMO) != 0;
+}
+
 bool TetraedgeEngine::canLoadGameStateCurrently() {
 	return _game && _application && !_application->mainMenu().isEntered();
 }
diff --git a/engines/tetraedge/tetraedge.h b/engines/tetraedge/tetraedge.h
index 616b5242977..45f06281d9e 100644
--- a/engines/tetraedge/tetraedge.h
+++ b/engines/tetraedge/tetraedge.h
@@ -90,6 +90,8 @@ public:
 
 	Common::Platform getGamePlatform() const;
 
+	bool isGameDemo() const;
+
 	/**
 	 * Gets a random number
 	 */


Commit: c917c9d49e29dffc7d4b920d4073b00b2f6a0de5
    https://github.com/scummvm/scummvm/commit/c917c9d49e29dffc7d4b920d4073b00b2f6a0de5
Author: Matthew Duggan (mgithub at guarana.org)
Date: 2023-03-17T09:53:50+09:00

Commit Message:
TETRAEDGE: Add detection entries for paid iOS Syberias

Changed paths:
    engines/tetraedge/detection_tables.h


diff --git a/engines/tetraedge/detection_tables.h b/engines/tetraedge/detection_tables.h
index c963e4691fe..ae2d6f4be7a 100644
--- a/engines/tetraedge/detection_tables.h
+++ b/engines/tetraedge/detection_tables.h
@@ -54,6 +54,17 @@ const ADGameDescription GAME_DESCRIPTIONS[] = {
 		GUIO1(GAMEOPTION_CORRECT_MOVIE_ASPECT)
 	},
 
+	// iOS paid release v1.2.  Not yet tested.
+	{
+		"syberia",
+		nullptr,
+		AD_ENTRY1s("Syberia", "d:1425707556476013e859979562c5d753", 15794272),
+		Common::UNK_LANG,
+		Common::kPlatformIOS,
+		ADGF_UNSTABLE,
+		GUIO1(GAMEOPTION_CORRECT_MOVIE_ASPECT)
+	},
+
 	// GOG release
 	{
 		"syberia2",
@@ -65,6 +76,17 @@ const ADGameDescription GAME_DESCRIPTIONS[] = {
 		GUIO1(GAMEOPTION_CORRECT_MOVIE_ASPECT)
 	},
 
+	// iOS release v1.0.1.  Not yet tested.
+	{
+		"syberia2",
+		nullptr,
+		AD_ENTRY1s("Syberia 2", "d:17d0ded9b87b5096207117bf0cfb5138", 15881248),
+		Common::UNK_LANG,
+		Common::kPlatformIOS,
+		ADGF_UNSTABLE,
+		GUIO1(GAMEOPTION_CORRECT_MOVIE_ASPECT)
+	},
+
 	AD_TABLE_END_MARKER
 };
 




More information about the Scummvm-git-logs mailing list