[Scummvm-git-logs] scummvm master -> 81cbe37db3204541891d89d8bb97229b03f58133
dreammaster
dreammaster at scummvm.org
Mon Feb 8 04:27:09 UTC 2021
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:
6ae29a802e AGS: Split up AGSCreditz versions into separate files
81cbe37db3 AGS: Fix plugins onEvent methods, skeleton for ags_tcp_ip
Commit: 6ae29a802ef4454f2005beea7019dddb4bb7a831
https://github.com/scummvm/scummvm/commit/6ae29a802ef4454f2005beea7019dddb4bb7a831
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2021-02-07T19:47:37-08:00
Commit Message:
AGS: Split up AGSCreditz versions into separate files
Changed paths:
A engines/ags/plugins/ags_creditz/ags_creditz1.cpp
A engines/ags/plugins/ags_creditz/ags_creditz1.h
A engines/ags/plugins/ags_creditz/ags_creditz2.cpp
A engines/ags/plugins/ags_creditz/ags_creditz2.h
engines/ags/detection_tables.h
engines/ags/module.mk
engines/ags/plugins/ags_creditz/ags_creditz.cpp
engines/ags/plugins/ags_creditz/ags_creditz.h
engines/ags/plugins/dll.cpp
diff --git a/engines/ags/detection_tables.h b/engines/ags/detection_tables.h
index 4e99220f0c..e962487e42 100644
--- a/engines/ags/detection_tables.h
+++ b/engines/ags/detection_tables.h
@@ -1311,9 +1311,6 @@ const PlainGameDescriptor GAME_NAMES[] = {
{{ ID, nullptr, AD_ENTRY1s(FILENAME, MD5, SIZE), Common::EN_ANY, \
Common::kPlatformUnknown, ADGF_UNSTABLE, GUIO0() }, PLUGIN_ARR }
-
-static const PluginVersion AGSCREDITZ_11[] = { { "agscreditz", 11 }, { nullptr, 0 } };
-
const AGSGameDescription GAME_DESCRIPTIONS[] = {
// Pre-2.5 games that aren't supported by the current AGS engine
UNSUPPORTED_DEMO("achristmastale", "tale.exe", "094135f05cf14fc3903e0d3697911a4e", 1484122),
@@ -1614,7 +1611,7 @@ const AGSGameDescription GAME_DESCRIPTIONS[] = {
ENGLISH_ENTRY("barnrunnerholiday2", "Xmas 2.exe", "6cddccb3744ec5c6af7c398fb7b3b11c", 31770973),
ENGLISH_ENTRY("bartsquestfortv", "Simpsons.exe", "0500aacb6c176d47ac0f8158f055db83", 794013),
ENGLISH_ENTRY("battlewarriors", "Battle.exe", "3b7cceb3e4bdb031dc5d8f290936e94b", 16314318),
- ENGLISH_PLUGIN("bcremake", "bc.exe", "0710e2ec71042617f565c01824f0cf3c", 7683255, AGSCREDITZ_11),
+ ENGLISH_ENTRY("bcremake", "bc.exe", "0710e2ec71042617f565c01824f0cf3c", 7683255),
ENGLISH_ENTRY("beacon", "Beacon.exe", "af0d268193a9220891e983d03141ec58", 24671086),
ENGLISH_ENTRY("bear", "Bear.exe", "97020973a2a635fe28eb0ba4bdfaa70b", 3258662),
ENGLISH_ENTRY("beasts", "beasts.exe", "0500aacb6c176d47ac0f8158f055db83", 1295435),
diff --git a/engines/ags/module.mk b/engines/ags/module.mk
index 0b9123cea9..dfdfbc7bd7 100644
--- a/engines/ags/module.mk
+++ b/engines/ags/module.mk
@@ -291,6 +291,8 @@ MODULE_OBJS = \
plugins/pluginobjectreader.o \
plugins/ags_blend/ags_blend.o \
plugins/ags_creditz/ags_creditz.o \
+ plugins/ags_creditz/ags_creditz1.o \
+ plugins/ags_creditz/ags_creditz2.o \
plugins/ags_flashlight/ags_flashlight.o \
plugins/ags_galaxy_steam/ags_galaxy_steam.o \
plugins/ags_pal_render/ags_pal_render.o \
diff --git a/engines/ags/plugins/ags_creditz/ags_creditz.cpp b/engines/ags/plugins/ags_creditz/ags_creditz.cpp
index d438c16507..c2f94e6946 100644
--- a/engines/ags/plugins/ags_creditz/ags_creditz.cpp
+++ b/engines/ags/plugins/ags_creditz/ags_creditz.cpp
@@ -39,480 +39,6 @@ AGSCreditz::~AGSCreditz() {
delete _state;
}
-/*------------------------------------------------------------------*/
-
-const char *IMAGE_TEXT = "*i*m*a*g*e*";
-
-AGSCreditz11::AGSCreditz11() : AGSCreditz() {
- _version = VERSION_11;
-
- DLL_METHOD(AGS_GetPluginName);
- DLL_METHOD(AGS_EngineStartup);
-}
-
-const char *AGSCreditz11::AGS_GetPluginName() {
- return "AGSCreditz v1.1 by AJA";
-}
-
-void AGSCreditz11::AGS_EngineStartup(IAGSEngine *engine) {
- _engine = engine;
-
- SCRIPT_METHOD(SetCredit);
- SCRIPT_METHOD(ScrollCredits);
- SCRIPT_METHOD(GetCredit);
- SCRIPT_METHOD(IsCreditScrollingFinished);
- SCRIPT_METHOD(SetCreditImage);
- SCRIPT_METHOD(PauseScroll);
- SCRIPT_METHOD(ScrollReset);
- SCRIPT_METHOD(SetEmptyLineHeight);
- SCRIPT_METHOD(GetEmptyLineHeight);
- SCRIPT_METHOD(SetStaticCredit);
- SCRIPT_METHOD(GetStaticCredit);
- SCRIPT_METHOD(StartEndStaticCredits);
- SCRIPT_METHOD(GetCurrentStaticCredit);
- SCRIPT_METHOD(SetDefaultStaticDelay);
- SCRIPT_METHOD(SetStaticPause);
- SCRIPT_METHOD(SetStaticCreditTitle);
- SCRIPT_METHOD(ShowStaticCredit);
- SCRIPT_METHOD(StaticReset);
- SCRIPT_METHOD(GetStaticCreditTitle);
- SCRIPT_METHOD(SetStaticCreditImage);
- SCRIPT_METHOD(IsStaticCreditsFinished);
-}
-
-void AGSCreditz11::SetCredit(const ScriptMethodParams ¶ms) {
- PARAMS7(int, ID, string, credit, int, colour, int, font, int, center, int, xpos, int, generateoutline);
-
- if (ID >= (int)_state->_credits[0].size())
- _state->_credits[0].resize(ID + 1);
-
- Credit &c = _state->_credits[0][ID];
- c._text = credit;
- c._fontSlot = font;
- c._center = center;
- c._x = xpos;
- c._isSet = true;
- c._outline = generateoutline;
- c._colorHeight = colour;
-}
-
-void AGSCreditz11::ScrollCredits(const ScriptMethodParams ¶ms) {
- PARAMS7(int, onoff, int, speed, int, fromY, int, toY, int, isautom, int, wait, int, resolution);
-
- if (onoff == 1) {
- _state->_creditsRunning = true;
- _state->_seqSettings[0].speed = speed;
- _state->_seqSettings[0].endwait = wait;
- _state->_seqSettings[0].startpoint = fromY;
- _state->_seqSettings[0].endpoint = toY;
- _state->_seqSettings[0].automatic = isautom;
-
- _engine->GetScreenDimensions(&_state->_screenWidth,
- &_state->_screenHeight, &_state->_screenColorDepth);
- if (_state->_screenWidth == 320) {
- _state->_resolutionFlag = (resolution != 2) ? 1 : 0;
- } else if (_state->_screenWidth == 640) {
- _state->_resolutionFlag = (resolution != 1) ? 1 : 0;
- }
-
- } else if (onoff == 0) {
- _state->_creditsRunning = false;
-
- } else {
- _engine->AbortGame("ScrollCredits: OnOff value must be 1 or 0!");
- }
-}
-
-string AGSCreditz11::GetCredit(const ScriptMethodParams ¶ms) {
- PARAMS1(int, ID);
-
- return (_state->_credits[0][ID]._text == IMAGE_TEXT) ?
- "image" : _state->_credits[0][ID]._text.c_str();
-}
-
-int AGSCreditz11::IsCreditScrollingFinished(const ScriptMethodParams ¶ms) {
- return true;
-}
-
-void AGSCreditz11::SetCreditImage(const ScriptMethodParams ¶ms) {
- //PARAMS5(int, ID, int, Slot, int, center, int, xpos, int, pixtonext);
-}
-
-void AGSCreditz11::PauseScroll(const ScriptMethodParams ¶ms) {
- //PARAMS1(int, onoff);
-}
-
-void AGSCreditz11::ScrollReset(const ScriptMethodParams ¶ms) {
-}
-
-void AGSCreditz11::SetEmptyLineHeight(const ScriptMethodParams ¶ms) {
- //PARAMS1(int, Height);
-}
-
-int AGSCreditz11::GetEmptyLineHeight(const ScriptMethodParams ¶ms) {
- return 0;
-}
-
-void AGSCreditz11::SetStaticCredit(const ScriptMethodParams ¶ms) {
- //PARAMS8(int, ID, int, x, int, y, int, creditfont, int, creditcolour, int, centered, int, generateoutline, string, credit);
-
-}
-
-string AGSCreditz11::GetStaticCredit(const ScriptMethodParams ¶ms) {
- //PARAMS1(int, ID);
- return nullptr;
-}
-
-void AGSCreditz11::StartEndStaticCredits(const ScriptMethodParams ¶ms) {
- //PARAMS2(int, onoff, int, res);
-}
-
-int AGSCreditz11::GetCurrentStaticCredit(const ScriptMethodParams ¶ms) {
- return 0;
-}
-
-void AGSCreditz11::SetDefaultStaticDelay(const ScriptMethodParams ¶ms) {
- //PARAMS1(int, Cyclesperchar);
-}
-
-void AGSCreditz11::SetStaticPause(const ScriptMethodParams ¶ms) {
- //PARAMS2(int, ID, int, length);
-}
-
-void AGSCreditz11::SetStaticCreditTitle(const ScriptMethodParams ¶ms) {
- //PARAMS8(int, ID, int, x, int, y, int, titlefont, int, titlecolour, int, centered, int, generateoutline, string, title);
-}
-
-void AGSCreditz11::ShowStaticCredit(const ScriptMethodParams ¶ms) {
- //PARAMS6(int, ID, int, time, int, style, int, transtime, int, sound, int, resolution);
-}
-
-void AGSCreditz11::StaticReset(const ScriptMethodParams ¶ms) {
-}
-
-string AGSCreditz11::GetStaticCreditTitle(const ScriptMethodParams ¶ms) {
- //PARAMS1(int, ID);
- return nullptr;
-}
-
-void AGSCreditz11::SetStaticCreditImage(const ScriptMethodParams ¶ms) {
-//int ID, int x, int y, int Slot, int Hcentered, int Vcentered, int time) {
-}
-
-int AGSCreditz11::IsStaticCreditsFinished(const ScriptMethodParams ¶ms) {
- return true;
-}
-
-/*------------------------------------------------------------------*/
-
-AGSCreditz20::AGSCreditz20() : AGSCreditz() {
- _version = VERSION_20;
-
- DLL_METHOD(AGS_GetPluginName);
- DLL_METHOD(AGS_EngineStartup);
-}
-
-const char *AGSCreditz20::AGS_GetPluginName() {
- return "AGSCreditz 2.0 (by Dima Software: AJA)";
-}
-
-void AGSCreditz20::AGS_EngineStartup(IAGSEngine *engine) {
- _engine = engine;
-
- SCRIPT_METHOD(RunCreditSequence);
- SCRIPT_METHOD(SetCredit);
- SCRIPT_METHOD(GetCredit);
- SCRIPT_METHOD(CreditsSettings);
- SCRIPT_METHOD(SequenceSettings);
- SCRIPT_METHOD(IsSequenceFinished);
- SCRIPT_METHOD(PauseScrolling);
- SCRIPT_METHOD(SetCreditImage);
- SCRIPT_METHOD(ResetSequence);
-
- SCRIPT_METHOD(SetStaticCredit);
- SCRIPT_METHOD(SetStaticCreditTitle);
- SCRIPT_METHOD(SetStaticPause);
- SCRIPT_METHOD(RunStaticCreditSequence);
- SCRIPT_METHOD(IsStaticSequenceFinished);
- SCRIPT_METHOD(ShowStaticCredit);
- SCRIPT_METHOD(SetStaticImage);
- SCRIPT_METHOD(GetCurrentStaticCredit);
-}
-
-void AGSCreditz20::RunCreditSequence(const ScriptMethodParams ¶ms) {
- PARAMS1(int, sequence);
-
- if (!_state->_creditsRunning) {
- _state->_seqSettings[sequence].finished = false;
- _state->_creditsRunning = true;
- _state->_creditSequence = sequence;
-
- _engine->GetScreenDimensions(&_state->_screenWidth, &_state->_screenHeight,
- &_state->_screenColorDepth);
-
- if (_state->_seqSettings[sequence].automatic) {
- calculateSequenceHeight(sequence);
- _state->_yPos = _state->_screenHeight + 1;
- } else {
- _state->_yPos = _state->_seqSettings[sequence].startpoint;
- }
-
- _state->_speedPoint = 0;
- _state->_timer = 0;
- draw();
- } else {
- _state->_paused = false;
- _state->_creditsRunning = false;
- _state->_creditSequence = -1;
- _state->_seqSettings[sequence].finished = true;
- }
-}
-
-void AGSCreditz20::SetCredit(const ScriptMethodParams ¶ms) {
- PARAMS7(int, sequence, int, line, string, credit, int, x_pos, int, font, int, color, int, gen_outline);
-
- assert(sequence >= 0 && sequence <= 10);
- if (line >= (int)_state->_credits[sequence].size())
- _state->_credits[sequence].resize(line + 1);
-
- Credit &c = _state->_credits[sequence][line];
- c._text = credit;
- c._fontSlot = font;
- c._colorHeight = color;
- c._x = x_pos;
- c._isSet = true;
- if (gen_outline > 0)
- c._outline = true;
-}
-
-string AGSCreditz20::GetCredit(const ScriptMethodParams ¶ms) {
- PARAMS2(int, sequence, int, ID);
-
- return _state->_credits[sequence][ID]._text.c_str();
-}
-
-void AGSCreditz20::CreditsSettings(const ScriptMethodParams ¶ms) {
- PARAMS1(int, emptylineheight);
-
- if (emptylineheight >= 0)
- _state->_emptyLineHeight = emptylineheight;
-}
-
-void AGSCreditz20::SequenceSettings(const ScriptMethodParams ¶ms) {
- PARAMS6(int, sequence, int, startpoint, int, endpoint, int, speed, int, automatic, int, endwait);
-
- _state->_seqSettings[sequence].startpoint = startpoint;
- _state->_seqSettings[sequence].endpoint = endpoint;
- _state->_seqSettings[sequence].speed = speed;
- _state->_seqSettings[sequence].automatic = automatic;
- _state->_seqSettings[sequence].endwait = endwait;
-}
-
-int AGSCreditz20::IsSequenceFinished(const ScriptMethodParams ¶ms) {
- PARAMS1(int, sequence);
-
- if (_state->_seqSettings[sequence].finished) {
- _state->_seqSettings[sequence].finished = false;
- return 1;
- }
-
- return 0;
-}
-
-void AGSCreditz20::PauseScrolling(const ScriptMethodParams ¶ms) {
- if (_state->_creditsRunning) {
- _state->_paused = !_state->_paused;
- }
-}
-
-void AGSCreditz20::SetCreditImage(const ScriptMethodParams ¶ms) {
- PARAMS5(int, sequence, int, line, int, xPos, int, slot, int, height);
-
- assert(sequence >= 0 && sequence <= 10);
- if (line >= (int)_state->_credits[sequence].size())
- _state->_credits[sequence].resize(line + 1);
-
- _state->_credits[sequence][line]._image = true;
- _state->_credits[sequence][line]._isSet = true;
- _state->_credits[sequence][line]._x = xPos;
- _state->_credits[sequence][line]._fontSlot = slot;
- _state->_credits[sequence][line]._colorHeight = height;
-}
-
-void AGSCreditz20::ResetSequence(const ScriptMethodParams ¶ms) {
- PARAMS1(int, seqtype);
-
- for (int i = 0; i < 10; ++i) {
- if (seqtype != 2)
- // Scrolling
- _state->_credits[i].clear();
- else
- // Static
- _state->_stCredits[i].clear();
- }
-}
-
-void AGSCreditz20::SetStaticCredit(const ScriptMethodParams ¶ms) {
- PARAMS8(int, sequence, int, id, string, credit, int, xPos, int, yPos,
- int, font, int, color, int, genOutline);
-
- assert(sequence >= 0 && sequence <= 10);
- if (id >= (int)_state->_stCredits[sequence].size())
- _state->_stCredits[sequence].resize(id + 1);
-
- _state->_stCredits[sequence][id].credit = credit;
- _state->_stCredits[sequence][id].x = xPos;
- _state->_stCredits[sequence][id].y = yPos;
- _state->_stCredits[sequence][id].font = font;
- _state->_stCredits[sequence][id].color = color;
-
- if (genOutline > 0)
- _state->_stCredits[sequence][id].outline = true;
-}
-
-void AGSCreditz20::SetStaticCreditTitle(const ScriptMethodParams ¶ms) {
- PARAMS8(int, sequence, int, id, string, title, int, xPos, int, yPos,
- int, font, int, color, int, genOutline);
-
- assert(sequence >= 0 && sequence < 10);
- if (id >= (int)_state->_stCredits[sequence].size())
- _state->_stCredits[sequence].resize(id + 1);
-
- _state->_stCredits[sequence][id].title = title;
- _state->_stCredits[sequence][id].title_x = xPos;
- _state->_stCredits[sequence][id].title_y = yPos;
- _state->_stCredits[sequence][id].title_font = font;
- _state->_stCredits[sequence][id].title_color = color;
-
- if (genOutline > 0)
- _state->_stCredits[sequence][id].title_outline = true;
-}
-
-void AGSCreditz20::SetStaticPause(const ScriptMethodParams ¶ms) {
- PARAMS3(int, sequence, int, id, int, length);
-
- assert(sequence >= 0 && sequence <= 10);
- if (id >= (int)_state->_stCredits[sequence].size())
- _state->_stCredits[sequence].resize(id + 1);
-
- _state->_stCredits[sequence][id].pause = length;
-}
-
-void AGSCreditz20::RunStaticCreditSequence(const ScriptMethodParams ¶ms) {
- PARAMS2(int, sequence, int, speed);
-
- if (!_state->_creditsRunning) {
- _state->_stSeqSettings[sequence].finished = false;
- _state->_stSeqSettings[sequence].speed = speed;
- _state->_creditSequence = sequence;
- _state->_staticCredits = true;
- _state->_creditsRunning = true;
- _state->_currentStatic = 1;
- _state->_timer = 0;
- draw();
-
- } else {
- _state->_staticCredits = false;
- _state->_creditSequence = -1;
- _state->_stSeqSettings[sequence].finished = false;
- _state->_creditsRunning = false;
- _state->_currentStatic = 0;
- _state->_timer = 0;
- }
-}
-
-int AGSCreditz20::IsStaticSequenceFinished(const ScriptMethodParams ¶ms) {
- PARAMS1(int, sequence);
-
- int result = (_state->_stSeqSettings[sequence].finished) ? 1 : 0;
- _state->_stSeqSettings[sequence].finished = false;
-
- return result;
-}
-
-void AGSCreditz20::ShowStaticCredit(const ScriptMethodParams ¶ms) {
- PARAMS6(int, sequence, int, id, int, time, int, style,
- int, styleSettings1, int, styleSettings2);
-
- _state->_creditSequence = sequence;
- _state->_creditsRunning = true;
- _state->_staticCredits = true;
- _state->_singleStatic.id = id;
- _state->_singleStatic.time = time;
- _state->_singleStatic.style = style;
- _state->_singleStatic.settings1 = styleSettings1;
- _state->_singleStatic.settings2 = styleSettings2;
- _state->_singleStatic.bool_ = true;
- _state->_stSeqSettings[sequence].finished = false;
- _state->_timer = 0;
- _state->_timer2 = 0;
- _state->_numChars = 0;
- draw();
-}
-
-void AGSCreditz20::SetStaticImage(const ScriptMethodParams ¶ms) {
- PARAMS6(int, sequence, int, id, int, slot, int, xPos, int, yPos, int, length);
-
- assert(sequence >= 0 && sequence < 10);
- if (id >= (int)_state->_stCredits[sequence].size())
- _state->_stCredits[sequence].resize(id + 1);
-
- _state->_stCredits[sequence][id].image = true;
- _state->_stCredits[sequence][id].image_slot = slot;
- _state->_stCredits[sequence][id].x = xPos;
- _state->_stCredits[sequence][id].y = yPos;
- _state->_stCredits[sequence][id].image_time = length;
-}
-
-int AGSCreditz20::GetCurrentStaticCredit(const ScriptMethodParams ¶ms) {
- int result = -1;
- if (_state->_creditsRunning && _state->_staticCredits)
- result = _state->_currentStatic;
-
- return result;
-}
-
-void AGSCreditz20::calculateSequenceHeight(int sequence) {
- int32 height, creditHeight, dum;
- height = 0;
-
- for (uint currentCredit = 0; currentCredit < _state->_credits[sequence].size();
- ++currentCredit) {
-
- if (_state->_credits[sequence][currentCredit]._isSet) {
- if (_state->_credits[sequence][currentCredit]._image) {
- if (_state->_credits[sequence][currentCredit]._colorHeight < 0)
- creditHeight = _engine->GetSpriteHeight(_state->_credits[sequence][currentCredit]._fontSlot);
- else
- creditHeight = _state->_credits[sequence][currentCredit]._colorHeight;
- } else {
- _engine->GetTextExtent(_state->_credits[sequence][currentCredit]._fontSlot,
- _state->_credits[sequence][currentCredit]._text.c_str(),
- &dum, &creditHeight);
- }
-
- height += creditHeight;
- } else {
- height += VGACheck(_state->_emptyLineHeight);
- }
- }
-
- _state->_calculatedSequenceHeight = height;
-}
-
-int AGSCreditz20::VGACheck(int value) {
- int32 screenX, dum;
- _engine->GetScreenDimensions(&screenX, &dum, &dum);
-
- if (screenX == 640)
- return value * 2;
- else
- return value;
-}
-
-void AGSCreditz20::draw() {
-}
-
} // namespace AGSCreditz
} // namespace Plugins
} // namespace AGS3
diff --git a/engines/ags/plugins/ags_creditz/ags_creditz.h b/engines/ags/plugins/ags_creditz/ags_creditz.h
index 3457f8a80a..b3e227b130 100644
--- a/engines/ags/plugins/ags_creditz/ags_creditz.h
+++ b/engines/ags/plugins/ags_creditz/ags_creditz.h
@@ -126,69 +126,6 @@ public:
~AGSCreditz();
};
-class AGSCreditz11 : public AGSCreditz {
-private:
- static const char *AGS_GetPluginName();
- static void AGS_EngineStartup(IAGSEngine *engine);
-
- static void SetCredit(const ScriptMethodParams ¶ms);
- static void ScrollCredits(const ScriptMethodParams ¶ms);
- static string GetCredit(const ScriptMethodParams ¶ms);
- static int IsCreditScrollingFinished(const ScriptMethodParams ¶ms);
- static void SetCreditImage(const ScriptMethodParams ¶ms);
- static void PauseScroll(const ScriptMethodParams ¶ms);
- static void ScrollReset(const ScriptMethodParams ¶ms);
- static void SetEmptyLineHeight(const ScriptMethodParams ¶ms);
- static int GetEmptyLineHeight(const ScriptMethodParams ¶ms);
- static void SetStaticCredit(const ScriptMethodParams ¶ms);
- static string GetStaticCredit(const ScriptMethodParams ¶ms);
- static void StartEndStaticCredits(const ScriptMethodParams ¶ms);
- static int GetCurrentStaticCredit(const ScriptMethodParams ¶ms);
- static void SetDefaultStaticDelay(const ScriptMethodParams ¶ms);
- static void SetStaticPause(const ScriptMethodParams ¶ms);
- static void SetStaticCreditTitle(const ScriptMethodParams ¶ms);
- static void ShowStaticCredit(const ScriptMethodParams ¶ms);
- static void StaticReset(const ScriptMethodParams ¶ms);
- static string GetStaticCreditTitle(const ScriptMethodParams ¶ms);
- static void SetStaticCreditImage(const ScriptMethodParams ¶ms);
- static int IsStaticCreditsFinished(const ScriptMethodParams ¶ms);
-
-public:
- AGSCreditz11();
-};
-
-class AGSCreditz20 : public AGSCreditz {
-private:
- static const char *AGS_GetPluginName();
- static void AGS_EngineStartup(IAGSEngine *engine);
-
- static void RunCreditSequence(const ScriptMethodParams ¶ms);
- static void SetCredit(const ScriptMethodParams ¶ms);
- static string GetCredit(const ScriptMethodParams ¶ms);
- static void CreditsSettings(const ScriptMethodParams ¶ms);
- static void SequenceSettings(const ScriptMethodParams ¶ms);
- static int IsSequenceFinished(const ScriptMethodParams ¶ms);
- static void PauseScrolling(const ScriptMethodParams ¶ms);
- static void SetCreditImage(const ScriptMethodParams ¶ms);
- static void ResetSequence(const ScriptMethodParams ¶ms);
-
- static void SetStaticCredit(const ScriptMethodParams ¶ms);
- static void SetStaticCreditTitle(const ScriptMethodParams ¶ms);
- static void SetStaticPause(const ScriptMethodParams ¶ms);
- static void RunStaticCreditSequence(const ScriptMethodParams ¶ms);
- static int IsStaticSequenceFinished(const ScriptMethodParams ¶ms);
- static void ShowStaticCredit(const ScriptMethodParams ¶ms);
- static void SetStaticImage(const ScriptMethodParams ¶ms);
- static int GetCurrentStaticCredit(const ScriptMethodParams ¶ms);
-
-private:
- static void calculateSequenceHeight(int sequence);
- static int VGACheck(int value);
- static void draw();
-public:
- AGSCreditz20();
-};
-
} // namespace AGSCreditz
} // namespace Plugins
} // namespace AGS3
diff --git a/engines/ags/plugins/ags_creditz/ags_creditz1.cpp b/engines/ags/plugins/ags_creditz/ags_creditz1.cpp
new file mode 100644
index 0000000000..dc42519eb8
--- /dev/null
+++ b/engines/ags/plugins/ags_creditz/ags_creditz1.cpp
@@ -0,0 +1,193 @@
+/* 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 2
+ * 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, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "ags/plugins/ags_creditz/ags_creditz1.h"
+
+namespace AGS3 {
+namespace Plugins {
+namespace AGSCreditz {
+
+const char *IMAGE_TEXT = "*i*m*a*g*e*";
+
+AGSCreditz1::AGSCreditz1() : AGSCreditz() {
+ _version = VERSION_11;
+
+ DLL_METHOD(AGS_GetPluginName);
+ DLL_METHOD(AGS_EngineStartup);
+}
+
+const char *AGSCreditz1::AGS_GetPluginName() {
+ return "AGSCreditz v1.1 by AJA";
+}
+
+void AGSCreditz1::AGS_EngineStartup(IAGSEngine *engine) {
+ _engine = engine;
+
+ SCRIPT_METHOD(SetCredit);
+ SCRIPT_METHOD(ScrollCredits);
+ SCRIPT_METHOD(GetCredit);
+ SCRIPT_METHOD(IsCreditScrollingFinished);
+ SCRIPT_METHOD(SetCreditImage);
+ SCRIPT_METHOD(PauseScroll);
+ SCRIPT_METHOD(ScrollReset);
+ SCRIPT_METHOD(SetEmptyLineHeight);
+ SCRIPT_METHOD(GetEmptyLineHeight);
+ SCRIPT_METHOD(SetStaticCredit);
+ SCRIPT_METHOD(GetStaticCredit);
+ SCRIPT_METHOD(StartEndStaticCredits);
+ SCRIPT_METHOD(GetCurrentStaticCredit);
+ SCRIPT_METHOD(SetDefaultStaticDelay);
+ SCRIPT_METHOD(SetStaticPause);
+ SCRIPT_METHOD(SetStaticCreditTitle);
+ SCRIPT_METHOD(ShowStaticCredit);
+ SCRIPT_METHOD(StaticReset);
+ SCRIPT_METHOD(GetStaticCreditTitle);
+ SCRIPT_METHOD(SetStaticCreditImage);
+ SCRIPT_METHOD(IsStaticCreditsFinished);
+}
+
+void AGSCreditz1::SetCredit(const ScriptMethodParams ¶ms) {
+ PARAMS7(int, ID, string, credit, int, colour, int, font, int, center, int, xpos, int, generateoutline);
+
+ if (ID >= (int)_state->_credits[0].size())
+ _state->_credits[0].resize(ID + 1);
+
+ Credit &c = _state->_credits[0][ID];
+ c._text = credit;
+ c._fontSlot = font;
+ c._center = center;
+ c._x = xpos;
+ c._isSet = true;
+ c._outline = generateoutline;
+ c._colorHeight = colour;
+}
+
+void AGSCreditz1::ScrollCredits(const ScriptMethodParams ¶ms) {
+ PARAMS7(int, onoff, int, speed, int, fromY, int, toY, int, isautom, int, wait, int, resolution);
+
+ if (onoff == 1) {
+ _state->_creditsRunning = true;
+ _state->_seqSettings[0].speed = speed;
+ _state->_seqSettings[0].endwait = wait;
+ _state->_seqSettings[0].startpoint = fromY;
+ _state->_seqSettings[0].endpoint = toY;
+ _state->_seqSettings[0].automatic = isautom;
+
+ _engine->GetScreenDimensions(&_state->_screenWidth,
+ &_state->_screenHeight, &_state->_screenColorDepth);
+ if (_state->_screenWidth == 320) {
+ _state->_resolutionFlag = (resolution != 2) ? 1 : 0;
+ } else if (_state->_screenWidth == 640) {
+ _state->_resolutionFlag = (resolution != 1) ? 1 : 0;
+ }
+
+ } else if (onoff == 0) {
+ _state->_creditsRunning = false;
+
+ } else {
+ _engine->AbortGame("ScrollCredits: OnOff value must be 1 or 0!");
+ }
+}
+
+string AGSCreditz1::GetCredit(const ScriptMethodParams ¶ms) {
+ PARAMS1(int, ID);
+
+ return (_state->_credits[0][ID]._text == IMAGE_TEXT) ?
+ "image" : _state->_credits[0][ID]._text.c_str();
+}
+
+int AGSCreditz1::IsCreditScrollingFinished(const ScriptMethodParams ¶ms) {
+ return true;
+}
+
+void AGSCreditz1::SetCreditImage(const ScriptMethodParams ¶ms) {
+ //PARAMS5(int, ID, int, Slot, int, center, int, xpos, int, pixtonext);
+}
+
+void AGSCreditz1::PauseScroll(const ScriptMethodParams ¶ms) {
+ //PARAMS1(int, onoff);
+}
+
+void AGSCreditz1::ScrollReset(const ScriptMethodParams ¶ms) {
+}
+
+void AGSCreditz1::SetEmptyLineHeight(const ScriptMethodParams ¶ms) {
+ //PARAMS1(int, Height);
+}
+
+int AGSCreditz1::GetEmptyLineHeight(const ScriptMethodParams ¶ms) {
+ return 0;
+}
+
+void AGSCreditz1::SetStaticCredit(const ScriptMethodParams ¶ms) {
+ //PARAMS8(int, ID, int, x, int, y, int, creditfont, int, creditcolour, int, centered, int, generateoutline, string, credit);
+
+}
+
+string AGSCreditz1::GetStaticCredit(const ScriptMethodParams ¶ms) {
+ //PARAMS1(int, ID);
+ return nullptr;
+}
+
+void AGSCreditz1::StartEndStaticCredits(const ScriptMethodParams ¶ms) {
+ //PARAMS2(int, onoff, int, res);
+}
+
+int AGSCreditz1::GetCurrentStaticCredit(const ScriptMethodParams ¶ms) {
+ return 0;
+}
+
+void AGSCreditz1::SetDefaultStaticDelay(const ScriptMethodParams ¶ms) {
+ //PARAMS1(int, Cyclesperchar);
+}
+
+void AGSCreditz1::SetStaticPause(const ScriptMethodParams ¶ms) {
+ //PARAMS2(int, ID, int, length);
+}
+
+void AGSCreditz1::SetStaticCreditTitle(const ScriptMethodParams ¶ms) {
+ //PARAMS8(int, ID, int, x, int, y, int, titlefont, int, titlecolour, int, centered, int, generateoutline, string, title);
+}
+
+void AGSCreditz1::ShowStaticCredit(const ScriptMethodParams ¶ms) {
+ //PARAMS6(int, ID, int, time, int, style, int, transtime, int, sound, int, resolution);
+}
+
+void AGSCreditz1::StaticReset(const ScriptMethodParams ¶ms) {
+}
+
+string AGSCreditz1::GetStaticCreditTitle(const ScriptMethodParams ¶ms) {
+ //PARAMS1(int, ID);
+ return nullptr;
+}
+
+void AGSCreditz1::SetStaticCreditImage(const ScriptMethodParams ¶ms) {
+//int ID, int x, int y, int Slot, int Hcentered, int Vcentered, int time) {
+}
+
+int AGSCreditz1::IsStaticCreditsFinished(const ScriptMethodParams ¶ms) {
+ return true;
+}
+
+} // namespace AGSCreditz
+} // namespace Plugins
+} // namespace AGS3
diff --git a/engines/ags/plugins/ags_creditz/ags_creditz1.h b/engines/ags/plugins/ags_creditz/ags_creditz1.h
new file mode 100644
index 0000000000..99632ad4f7
--- /dev/null
+++ b/engines/ags/plugins/ags_creditz/ags_creditz1.h
@@ -0,0 +1,67 @@
+/* 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 2
+ * 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, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef AGS_PLUGINS_AGSCREDITZ_AGSCREDITZ1_H
+#define AGS_PLUGINS_AGSCREDITZ_AGSCREDITZ1_H
+
+#include "ags/plugins/ags_creditz/ags_creditz.h"
+
+namespace AGS3 {
+namespace Plugins {
+namespace AGSCreditz {
+
+class AGSCreditz1 : public AGSCreditz {
+private:
+ static const char *AGS_GetPluginName();
+ static void AGS_EngineStartup(IAGSEngine *engine);
+
+ static void SetCredit(const ScriptMethodParams ¶ms);
+ static void ScrollCredits(const ScriptMethodParams ¶ms);
+ static string GetCredit(const ScriptMethodParams ¶ms);
+ static int IsCreditScrollingFinished(const ScriptMethodParams ¶ms);
+ static void SetCreditImage(const ScriptMethodParams ¶ms);
+ static void PauseScroll(const ScriptMethodParams ¶ms);
+ static void ScrollReset(const ScriptMethodParams ¶ms);
+ static void SetEmptyLineHeight(const ScriptMethodParams ¶ms);
+ static int GetEmptyLineHeight(const ScriptMethodParams ¶ms);
+ static void SetStaticCredit(const ScriptMethodParams ¶ms);
+ static string GetStaticCredit(const ScriptMethodParams ¶ms);
+ static void StartEndStaticCredits(const ScriptMethodParams ¶ms);
+ static int GetCurrentStaticCredit(const ScriptMethodParams ¶ms);
+ static void SetDefaultStaticDelay(const ScriptMethodParams ¶ms);
+ static void SetStaticPause(const ScriptMethodParams ¶ms);
+ static void SetStaticCreditTitle(const ScriptMethodParams ¶ms);
+ static void ShowStaticCredit(const ScriptMethodParams ¶ms);
+ static void StaticReset(const ScriptMethodParams ¶ms);
+ static string GetStaticCreditTitle(const ScriptMethodParams ¶ms);
+ static void SetStaticCreditImage(const ScriptMethodParams ¶ms);
+ static int IsStaticCreditsFinished(const ScriptMethodParams ¶ms);
+
+public:
+ AGSCreditz1();
+};
+
+} // namespace AGSCreditz
+} // namespace Plugins
+} // namespace AGS3
+
+#endif
diff --git a/engines/ags/plugins/ags_creditz/ags_creditz2.cpp b/engines/ags/plugins/ags_creditz/ags_creditz2.cpp
new file mode 100644
index 0000000000..e40f9e1949
--- /dev/null
+++ b/engines/ags/plugins/ags_creditz/ags_creditz2.cpp
@@ -0,0 +1,339 @@
+/* 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 2
+ * 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, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "ags/plugins/ags_creditz/ags_creditz2.h"
+
+namespace AGS3 {
+namespace Plugins {
+namespace AGSCreditz {
+
+AGSCreditz2::AGSCreditz2() : AGSCreditz() {
+ _version = VERSION_20;
+
+ DLL_METHOD(AGS_GetPluginName);
+ DLL_METHOD(AGS_EngineStartup);
+}
+
+const char *AGSCreditz2::AGS_GetPluginName() {
+ return "AGSCreditz 2.0 (by Dima Software: AJA)";
+}
+
+void AGSCreditz2::AGS_EngineStartup(IAGSEngine *engine) {
+ _engine = engine;
+
+ SCRIPT_METHOD(RunCreditSequence);
+ SCRIPT_METHOD(SetCredit);
+ SCRIPT_METHOD(GetCredit);
+ SCRIPT_METHOD(CreditsSettings);
+ SCRIPT_METHOD(SequenceSettings);
+ SCRIPT_METHOD(IsSequenceFinished);
+ SCRIPT_METHOD(PauseScrolling);
+ SCRIPT_METHOD(SetCreditImage);
+ SCRIPT_METHOD(ResetSequence);
+
+ SCRIPT_METHOD(SetStaticCredit);
+ SCRIPT_METHOD(SetStaticCreditTitle);
+ SCRIPT_METHOD(SetStaticPause);
+ SCRIPT_METHOD(RunStaticCreditSequence);
+ SCRIPT_METHOD(IsStaticSequenceFinished);
+ SCRIPT_METHOD(ShowStaticCredit);
+ SCRIPT_METHOD(SetStaticImage);
+ SCRIPT_METHOD(GetCurrentStaticCredit);
+}
+
+void AGSCreditz2::RunCreditSequence(const ScriptMethodParams ¶ms) {
+ PARAMS1(int, sequence);
+
+ if (!_state->_creditsRunning) {
+ _state->_seqSettings[sequence].finished = false;
+ _state->_creditsRunning = true;
+ _state->_creditSequence = sequence;
+
+ _engine->GetScreenDimensions(&_state->_screenWidth, &_state->_screenHeight,
+ &_state->_screenColorDepth);
+
+ if (_state->_seqSettings[sequence].automatic) {
+ calculateSequenceHeight(sequence);
+ _state->_yPos = _state->_screenHeight + 1;
+ } else {
+ _state->_yPos = _state->_seqSettings[sequence].startpoint;
+ }
+
+ _state->_speedPoint = 0;
+ _state->_timer = 0;
+ draw();
+ } else {
+ _state->_paused = false;
+ _state->_creditsRunning = false;
+ _state->_creditSequence = -1;
+ _state->_seqSettings[sequence].finished = true;
+ }
+}
+
+void AGSCreditz2::SetCredit(const ScriptMethodParams ¶ms) {
+ PARAMS7(int, sequence, int, line, string, credit, int, x_pos, int, font, int, color, int, gen_outline);
+
+ assert(sequence >= 0 && sequence <= 10);
+ if (line >= (int)_state->_credits[sequence].size())
+ _state->_credits[sequence].resize(line + 1);
+
+ Credit &c = _state->_credits[sequence][line];
+ c._text = credit;
+ c._fontSlot = font;
+ c._colorHeight = color;
+ c._x = x_pos;
+ c._isSet = true;
+ if (gen_outline > 0)
+ c._outline = true;
+}
+
+string AGSCreditz2::GetCredit(const ScriptMethodParams ¶ms) {
+ PARAMS2(int, sequence, int, ID);
+
+ return _state->_credits[sequence][ID]._text.c_str();
+}
+
+void AGSCreditz2::CreditsSettings(const ScriptMethodParams ¶ms) {
+ PARAMS1(int, emptylineheight);
+
+ if (emptylineheight >= 0)
+ _state->_emptyLineHeight = emptylineheight;
+}
+
+void AGSCreditz2::SequenceSettings(const ScriptMethodParams ¶ms) {
+ PARAMS6(int, sequence, int, startpoint, int, endpoint, int, speed, int, automatic, int, endwait);
+
+ _state->_seqSettings[sequence].startpoint = startpoint;
+ _state->_seqSettings[sequence].endpoint = endpoint;
+ _state->_seqSettings[sequence].speed = speed;
+ _state->_seqSettings[sequence].automatic = automatic;
+ _state->_seqSettings[sequence].endwait = endwait;
+}
+
+int AGSCreditz2::IsSequenceFinished(const ScriptMethodParams ¶ms) {
+ PARAMS1(int, sequence);
+
+ if (_state->_seqSettings[sequence].finished) {
+ _state->_seqSettings[sequence].finished = false;
+ return 1;
+ }
+
+ return 0;
+}
+
+void AGSCreditz2::PauseScrolling(const ScriptMethodParams ¶ms) {
+ if (_state->_creditsRunning) {
+ _state->_paused = !_state->_paused;
+ }
+}
+
+void AGSCreditz2::SetCreditImage(const ScriptMethodParams ¶ms) {
+ PARAMS5(int, sequence, int, line, int, xPos, int, slot, int, height);
+
+ assert(sequence >= 0 && sequence <= 10);
+ if (line >= (int)_state->_credits[sequence].size())
+ _state->_credits[sequence].resize(line + 1);
+
+ _state->_credits[sequence][line]._image = true;
+ _state->_credits[sequence][line]._isSet = true;
+ _state->_credits[sequence][line]._x = xPos;
+ _state->_credits[sequence][line]._fontSlot = slot;
+ _state->_credits[sequence][line]._colorHeight = height;
+}
+
+void AGSCreditz2::ResetSequence(const ScriptMethodParams ¶ms) {
+ PARAMS1(int, seqtype);
+
+ for (int i = 0; i < 10; ++i) {
+ if (seqtype != 2)
+ // Scrolling
+ _state->_credits[i].clear();
+ else
+ // Static
+ _state->_stCredits[i].clear();
+ }
+}
+
+void AGSCreditz2::SetStaticCredit(const ScriptMethodParams ¶ms) {
+ PARAMS8(int, sequence, int, id, string, credit, int, xPos, int, yPos,
+ int, font, int, color, int, genOutline);
+
+ assert(sequence >= 0 && sequence <= 10);
+ if (id >= (int)_state->_stCredits[sequence].size())
+ _state->_stCredits[sequence].resize(id + 1);
+
+ _state->_stCredits[sequence][id].credit = credit;
+ _state->_stCredits[sequence][id].x = xPos;
+ _state->_stCredits[sequence][id].y = yPos;
+ _state->_stCredits[sequence][id].font = font;
+ _state->_stCredits[sequence][id].color = color;
+
+ if (genOutline > 0)
+ _state->_stCredits[sequence][id].outline = true;
+}
+
+void AGSCreditz2::SetStaticCreditTitle(const ScriptMethodParams ¶ms) {
+ PARAMS8(int, sequence, int, id, string, title, int, xPos, int, yPos,
+ int, font, int, color, int, genOutline);
+
+ assert(sequence >= 0 && sequence < 10);
+ if (id >= (int)_state->_stCredits[sequence].size())
+ _state->_stCredits[sequence].resize(id + 1);
+
+ _state->_stCredits[sequence][id].title = title;
+ _state->_stCredits[sequence][id].title_x = xPos;
+ _state->_stCredits[sequence][id].title_y = yPos;
+ _state->_stCredits[sequence][id].title_font = font;
+ _state->_stCredits[sequence][id].title_color = color;
+
+ if (genOutline > 0)
+ _state->_stCredits[sequence][id].title_outline = true;
+}
+
+void AGSCreditz2::SetStaticPause(const ScriptMethodParams ¶ms) {
+ PARAMS3(int, sequence, int, id, int, length);
+
+ assert(sequence >= 0 && sequence <= 10);
+ if (id >= (int)_state->_stCredits[sequence].size())
+ _state->_stCredits[sequence].resize(id + 1);
+
+ _state->_stCredits[sequence][id].pause = length;
+}
+
+void AGSCreditz2::RunStaticCreditSequence(const ScriptMethodParams ¶ms) {
+ PARAMS2(int, sequence, int, speed);
+
+ if (!_state->_creditsRunning) {
+ _state->_stSeqSettings[sequence].finished = false;
+ _state->_stSeqSettings[sequence].speed = speed;
+ _state->_creditSequence = sequence;
+ _state->_staticCredits = true;
+ _state->_creditsRunning = true;
+ _state->_currentStatic = 1;
+ _state->_timer = 0;
+ draw();
+
+ } else {
+ _state->_staticCredits = false;
+ _state->_creditSequence = -1;
+ _state->_stSeqSettings[sequence].finished = false;
+ _state->_creditsRunning = false;
+ _state->_currentStatic = 0;
+ _state->_timer = 0;
+ }
+}
+
+int AGSCreditz2::IsStaticSequenceFinished(const ScriptMethodParams ¶ms) {
+ PARAMS1(int, sequence);
+
+ int result = (_state->_stSeqSettings[sequence].finished) ? 1 : 0;
+ _state->_stSeqSettings[sequence].finished = false;
+
+ return result;
+}
+
+void AGSCreditz2::ShowStaticCredit(const ScriptMethodParams ¶ms) {
+ PARAMS6(int, sequence, int, id, int, time, int, style,
+ int, styleSettings1, int, styleSettings2);
+
+ _state->_creditSequence = sequence;
+ _state->_creditsRunning = true;
+ _state->_staticCredits = true;
+ _state->_singleStatic.id = id;
+ _state->_singleStatic.time = time;
+ _state->_singleStatic.style = style;
+ _state->_singleStatic.settings1 = styleSettings1;
+ _state->_singleStatic.settings2 = styleSettings2;
+ _state->_singleStatic.bool_ = true;
+ _state->_stSeqSettings[sequence].finished = false;
+ _state->_timer = 0;
+ _state->_timer2 = 0;
+ _state->_numChars = 0;
+ draw();
+}
+
+void AGSCreditz2::SetStaticImage(const ScriptMethodParams ¶ms) {
+ PARAMS6(int, sequence, int, id, int, slot, int, xPos, int, yPos, int, length);
+
+ assert(sequence >= 0 && sequence < 10);
+ if (id >= (int)_state->_stCredits[sequence].size())
+ _state->_stCredits[sequence].resize(id + 1);
+
+ _state->_stCredits[sequence][id].image = true;
+ _state->_stCredits[sequence][id].image_slot = slot;
+ _state->_stCredits[sequence][id].x = xPos;
+ _state->_stCredits[sequence][id].y = yPos;
+ _state->_stCredits[sequence][id].image_time = length;
+}
+
+int AGSCreditz2::GetCurrentStaticCredit(const ScriptMethodParams ¶ms) {
+ int result = -1;
+ if (_state->_creditsRunning && _state->_staticCredits)
+ result = _state->_currentStatic;
+
+ return result;
+}
+
+void AGSCreditz2::calculateSequenceHeight(int sequence) {
+ int32 height, creditHeight, dum;
+ height = 0;
+
+ for (uint currentCredit = 0; currentCredit < _state->_credits[sequence].size();
+ ++currentCredit) {
+
+ if (_state->_credits[sequence][currentCredit]._isSet) {
+ if (_state->_credits[sequence][currentCredit]._image) {
+ if (_state->_credits[sequence][currentCredit]._colorHeight < 0)
+ creditHeight = _engine->GetSpriteHeight(_state->_credits[sequence][currentCredit]._fontSlot);
+ else
+ creditHeight = _state->_credits[sequence][currentCredit]._colorHeight;
+ } else {
+ _engine->GetTextExtent(_state->_credits[sequence][currentCredit]._fontSlot,
+ _state->_credits[sequence][currentCredit]._text.c_str(),
+ &dum, &creditHeight);
+ }
+
+ height += creditHeight;
+ } else {
+ height += VGACheck(_state->_emptyLineHeight);
+ }
+ }
+
+ _state->_calculatedSequenceHeight = height;
+}
+
+int AGSCreditz2::VGACheck(int value) {
+ int32 screenX, dum;
+ _engine->GetScreenDimensions(&screenX, &dum, &dum);
+
+ if (screenX == 640)
+ return value * 2;
+ else
+ return value;
+}
+
+void AGSCreditz2::draw() {
+}
+
+} // namespace AGSCreditz
+} // namespace Plugins
+} // namespace AGS3
diff --git a/engines/ags/plugins/ags_creditz/ags_creditz2.h b/engines/ags/plugins/ags_creditz/ags_creditz2.h
new file mode 100644
index 0000000000..300161ea12
--- /dev/null
+++ b/engines/ags/plugins/ags_creditz/ags_creditz2.h
@@ -0,0 +1,68 @@
+/* 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 2
+ * 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, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef AGS_PLUGINS_AGSCREDITZ_AGSCREDITZ2_H
+#define AGS_PLUGINS_AGSCREDITZ_AGSCREDITZ2_H
+
+#include "ags/plugins/ags_creditz/ags_creditz.h"
+
+namespace AGS3 {
+namespace Plugins {
+namespace AGSCreditz {
+
+class AGSCreditz2 : public AGSCreditz {
+private:
+ static const char *AGS_GetPluginName();
+ static void AGS_EngineStartup(IAGSEngine *engine);
+
+ static void RunCreditSequence(const ScriptMethodParams ¶ms);
+ static void SetCredit(const ScriptMethodParams ¶ms);
+ static string GetCredit(const ScriptMethodParams ¶ms);
+ static void CreditsSettings(const ScriptMethodParams ¶ms);
+ static void SequenceSettings(const ScriptMethodParams ¶ms);
+ static int IsSequenceFinished(const ScriptMethodParams ¶ms);
+ static void PauseScrolling(const ScriptMethodParams ¶ms);
+ static void SetCreditImage(const ScriptMethodParams ¶ms);
+ static void ResetSequence(const ScriptMethodParams ¶ms);
+
+ static void SetStaticCredit(const ScriptMethodParams ¶ms);
+ static void SetStaticCreditTitle(const ScriptMethodParams ¶ms);
+ static void SetStaticPause(const ScriptMethodParams ¶ms);
+ static void RunStaticCreditSequence(const ScriptMethodParams ¶ms);
+ static int IsStaticSequenceFinished(const ScriptMethodParams ¶ms);
+ static void ShowStaticCredit(const ScriptMethodParams ¶ms);
+ static void SetStaticImage(const ScriptMethodParams ¶ms);
+ static int GetCurrentStaticCredit(const ScriptMethodParams ¶ms);
+
+private:
+ static void calculateSequenceHeight(int sequence);
+ static int VGACheck(int value);
+ static void draw();
+public:
+ AGSCreditz2();
+};
+
+} // namespace AGSCreditz
+} // namespace Plugins
+} // namespace AGS3
+
+#endif
diff --git a/engines/ags/plugins/dll.cpp b/engines/ags/plugins/dll.cpp
index 4c2fdfca95..3d55eb963a 100644
--- a/engines/ags/plugins/dll.cpp
+++ b/engines/ags/plugins/dll.cpp
@@ -23,7 +23,8 @@
#include "ags/lib/allegro.h"
#include "ags/plugins/dll.h"
#include "ags/plugins/ags_blend/ags_blend.h"
-#include "ags/plugins/ags_creditz/ags_creditz.h"
+#include "ags/plugins/ags_creditz/ags_creditz1.h"
+#include "ags/plugins/ags_creditz/ags_creditz2.h"
#include "ags/plugins/ags_flashlight/ags_flashlight.h"
#include "ags/plugins/ags_galaxy_steam/ags_galaxy_steam.h"
#include "ags/plugins/ags_pal_render/ags_pal_render.h"
@@ -52,12 +53,11 @@ void *pluginOpen(const char *filename) {
if (fname.equalsIgnoreCase("AGSBlend"))
return new AGSBlend::AGSBlend();
- if (fname.equalsIgnoreCase("agsCreditz")) {
- if (version == 20)
- return new AGSCreditz::AGSCreditz20();
- else
- return new AGSCreditz::AGSCreditz11();
- }
+ if (fname.equalsIgnoreCase("agsCreditz"))
+ return new AGSCreditz::AGSCreditz1();
+
+ if (fname.equalsIgnoreCase("agsCreditz2"))
+ return new AGSCreditz::AGSCreditz2();
if (fname.equalsIgnoreCase("AGSFlashlight"))
return new AGSFlashlight::AGSFlashlight();
@@ -65,7 +65,7 @@ void *pluginOpen(const char *filename) {
if (fname.equalsIgnoreCase("AGSPalRender"))
return new AGSPalRender::AGSPalRender();
- if (fname.equalsIgnoreCase("AGSSnowRain"))
+ if (fname.equalsIgnoreCase("AGSSnowRain") || fname.equalsIgnoreCase("ags_snowrain"))
return new AGSSnowRain::AGSSnowRain();
if (fname.equalsIgnoreCase("AGSSpriteFont"))
Commit: 81cbe37db3204541891d89d8bb97229b03f58133
https://github.com/scummvm/scummvm/commit/81cbe37db3204541891d89d8bb97229b03f58133
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2021-02-07T20:26:52-08:00
Commit Message:
AGS: Fix plugins onEvent methods, skeleton for ags_tcp_ip
Changed paths:
A engines/ags/plugins/ags_tcp_ip/ags_tcp_ip.cpp
A engines/ags/plugins/ags_tcp_ip/ags_tcp_ip.h
engines/ags/module.mk
engines/ags/plugins/ags_flashlight/ags_flashlight.cpp
engines/ags/plugins/ags_flashlight/ags_flashlight.h
engines/ags/plugins/ags_pal_render/ags_pal_render.cpp
engines/ags/plugins/ags_pal_render/ags_pal_render.h
engines/ags/plugins/ags_parallax/ags_parallax.cpp
engines/ags/plugins/ags_parallax/ags_parallax.h
engines/ags/plugins/ags_snow_rain/ags_snow_rain.cpp
engines/ags/plugins/ags_snow_rain/ags_snow_rain.h
engines/ags/plugins/agsplugin.cpp
engines/ags/plugins/agsplugin.h
engines/ags/plugins/dll.cpp
engines/ags/shared/core/types.h
diff --git a/engines/ags/module.mk b/engines/ags/module.mk
index dfdfbc7bd7..efef4746f6 100644
--- a/engines/ags/module.mk
+++ b/engines/ags/module.mk
@@ -306,7 +306,8 @@ MODULE_OBJS = \
plugins/ags_sprite_font/sprite_font.o \
plugins/ags_sprite_font/sprite_font_renderer.o \
plugins/ags_sprite_font/variable_width_font.o \
- plugins/ags_sprite_font/variable_width_sprite_font.o
+ plugins/ags_sprite_font/variable_width_sprite_font.o \
+ plugins/ags_tcp_ip/ags_tcp_ip.o
ifdef ENABLE_AGS_SCANNER
MODULE_OBJS += \
diff --git a/engines/ags/plugins/ags_flashlight/ags_flashlight.cpp b/engines/ags/plugins/ags_flashlight/ags_flashlight.cpp
index 1203710358..5eb0abb02b 100644
--- a/engines/ags/plugins/ags_flashlight/ags_flashlight.cpp
+++ b/engines/ags/plugins/ags_flashlight/ags_flashlight.cpp
@@ -171,7 +171,7 @@ void AGSFlashlight::AGS_EngineStartup(IAGSEngine *engine) {
void AGSFlashlight::AGS_EngineShutdown() {
}
-int AGSFlashlight::AGS_EngineOnEvent(int event, int data) {
+NumberPtr AGSFlashlight::AGS_EngineOnEvent(int event, NumberPtr data) {
if (event == AGSE_PREGUIDRAW) {
Update();
} else if (event == AGSE_RESTOREGAME) {
diff --git a/engines/ags/plugins/ags_flashlight/ags_flashlight.h b/engines/ags/plugins/ags_flashlight/ags_flashlight.h
index 11572d8eac..ccb989a5da 100644
--- a/engines/ags/plugins/ags_flashlight/ags_flashlight.h
+++ b/engines/ags/plugins/ags_flashlight/ags_flashlight.h
@@ -67,7 +67,7 @@ private:
static const char *AGS_GetPluginName();
static void AGS_EngineStartup(IAGSEngine *engine);
static void AGS_EngineShutdown();
- static int AGS_EngineOnEvent(int event, int data);
+ static NumberPtr AGS_EngineOnEvent(int event, NumberPtr data);
private:
/**
diff --git a/engines/ags/plugins/ags_pal_render/ags_pal_render.cpp b/engines/ags/plugins/ags_pal_render/ags_pal_render.cpp
index f0f15c35f0..d21fe61da3 100644
--- a/engines/ags/plugins/ags_pal_render/ags_pal_render.cpp
+++ b/engines/ags/plugins/ags_pal_render/ags_pal_render.cpp
@@ -1602,7 +1602,7 @@ void AGSPalRender::AGS_EngineShutdown() {
//QuitCleanup();
}
-int AGSPalRender::AGS_EngineOnEvent(int event, int data) {
+NumberPtr AGSPalRender::AGS_EngineOnEvent(int event, NumberPtr data) {
if (event == AGSE_PRESCREENDRAW && clutslot > 0) {
if (drawreflections) {
int32 sh, sw = 0;
diff --git a/engines/ags/plugins/ags_pal_render/ags_pal_render.h b/engines/ags/plugins/ags_pal_render/ags_pal_render.h
index bf3247852a..730a43ea85 100644
--- a/engines/ags/plugins/ags_pal_render/ags_pal_render.h
+++ b/engines/ags/plugins/ags_pal_render/ags_pal_render.h
@@ -34,7 +34,7 @@ private:
static const char *AGS_GetPluginName();
static void AGS_EngineStartup(IAGSEngine *lpEngine);
static void AGS_EngineShutdown();
- static int AGS_EngineOnEvent(int event, int data);
+ static NumberPtr AGS_EngineOnEvent(int event, NumberPtr data);
public:
AGSPalRender();
diff --git a/engines/ags/plugins/ags_parallax/ags_parallax.cpp b/engines/ags/plugins/ags_parallax/ags_parallax.cpp
index ac76003b6a..004bfc2d76 100644
--- a/engines/ags/plugins/ags_parallax/ags_parallax.cpp
+++ b/engines/ags/plugins/ags_parallax/ags_parallax.cpp
@@ -72,7 +72,7 @@ void AGSParallax::AGS_EngineStartup(IAGSEngine *engine) {
_engine->RequestEventHook(AGSE_RESTOREGAME);
}
-int AGSParallax::AGS_EngineOnEvent(int event, int data) {
+NumberPtr AGSParallax::AGS_EngineOnEvent(int event, NumberPtr data) {
if (event == AGSE_PREGUIDRAW) {
Draw(true);
} else if (event == AGSE_PRESCREENDRAW) {
diff --git a/engines/ags/plugins/ags_parallax/ags_parallax.h b/engines/ags/plugins/ags_parallax/ags_parallax.h
index 1d0e37f555..3fa68e95de 100644
--- a/engines/ags/plugins/ags_parallax/ags_parallax.h
+++ b/engines/ags/plugins/ags_parallax/ags_parallax.h
@@ -58,7 +58,7 @@ private:
private:
static const char *AGS_GetPluginName();
static void AGS_EngineStartup(IAGSEngine *lpEngine);
- static int AGS_EngineOnEvent(int event, int data);
+ static NumberPtr AGS_EngineOnEvent(int event, NumberPtr data);
static void pxDrawSprite(int id, int x, int y, int slot, int speed);
static void pxDeleteSprite(int id);
diff --git a/engines/ags/plugins/ags_snow_rain/ags_snow_rain.cpp b/engines/ags/plugins/ags_snow_rain/ags_snow_rain.cpp
index 991b48eafa..557a427048 100644
--- a/engines/ags/plugins/ags_snow_rain/ags_snow_rain.cpp
+++ b/engines/ags/plugins/ags_snow_rain/ags_snow_rain.cpp
@@ -97,7 +97,7 @@ void AGSSnowRain::AGS_EngineShutdown() {
delete _snow;
}
-int AGSSnowRain::AGS_EngineOnEvent(int event, int data) {
+NumberPtr AGSSnowRain::AGS_EngineOnEvent(int event, NumberPtr data) {
if (event == AGSE_PREGUIDRAW) {
if (_rain->IsActive())
_rain->Update();
diff --git a/engines/ags/plugins/ags_snow_rain/ags_snow_rain.h b/engines/ags/plugins/ags_snow_rain/ags_snow_rain.h
index fe24a84de2..e307532df0 100644
--- a/engines/ags/plugins/ags_snow_rain/ags_snow_rain.h
+++ b/engines/ags/plugins/ags_snow_rain/ags_snow_rain.h
@@ -47,7 +47,7 @@ private:
static const char *AGS_GetPluginName();
static void AGS_EngineStartup(IAGSEngine *lpEngine);
static void AGS_EngineShutdown();
- static int AGS_EngineOnEvent(int event, int data);
+ static NumberPtr AGS_EngineOnEvent(int event, NumberPtr data);
private:
static void srSetWindSpeed(int value);
diff --git a/engines/ags/plugins/ags_tcp_ip/ags_tcp_ip.cpp b/engines/ags/plugins/ags_tcp_ip/ags_tcp_ip.cpp
new file mode 100644
index 0000000000..cf5bb82271
--- /dev/null
+++ b/engines/ags/plugins/ags_tcp_ip/ags_tcp_ip.cpp
@@ -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 2
+ * 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, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "ags/lib/allegro.h"
+#include "ags/plugins/ags_tcp_ip/ags_tcp_ip.h"
+
+namespace AGS3 {
+namespace Plugins {
+namespace AGSTcpIp {
+
+
+AGSTcpIp::AGSTcpIp() : DLL() {
+ DLL_METHOD(AGS_GetPluginName);
+ DLL_METHOD(AGS_EngineStartup);
+}
+
+const char *AGSTcpIp::AGS_GetPluginName() {
+ return "TCP/IP (a-v-o)";
+}
+
+void AGSTcpIp::AGS_EngineStartup(IAGSEngine *engine) {
+}
+
+} // namespace AGSTcpIp
+} // namespace Plugins
+} // namespace AGS3
diff --git a/engines/ags/plugins/ags_tcp_ip/ags_tcp_ip.h b/engines/ags/plugins/ags_tcp_ip/ags_tcp_ip.h
new file mode 100644
index 0000000000..cbcf43a06c
--- /dev/null
+++ b/engines/ags/plugins/ags_tcp_ip/ags_tcp_ip.h
@@ -0,0 +1,46 @@
+/* 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 2
+ * 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, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef AGS_PLUGINS_AGS_TCP_IP_AGS_TCP_IP_H
+#define AGS_PLUGINS_AGS_TCP_IP_AGS_TCP_IP_H
+
+#include "ags/plugins/dll.h"
+#include "ags/lib/allegro.h"
+
+namespace AGS3 {
+namespace Plugins {
+namespace AGSTcpIp {
+
+class AGSTcpIp : public DLL {
+private:
+ static const char *AGS_GetPluginName();
+ static void AGS_EngineStartup(IAGSEngine *engine);
+
+public:
+ AGSTcpIp();
+};
+
+} // namespace AGSTcpIp
+} // namespace Plugins
+} // namespace AGS3
+
+#endif
diff --git a/engines/ags/plugins/agsplugin.cpp b/engines/ags/plugins/agsplugin.cpp
index 01f7df28b6..026d09bcfc 100644
--- a/engines/ags/plugins/agsplugin.cpp
+++ b/engines/ags/plugins/agsplugin.cpp
@@ -908,83 +908,6 @@ int pl_register_builtin_plugin(InbuiltPluginDetails const &details) {
return 0;
}
-bool pl_use_builtin_plugin(EnginePlugin *apl) {
-#if defined(BUILTIN_PLUGINS)
- if (ags_stricmp(apl->filename, "agsflashlight") == 0) {
- apl->engineStartup = agsflashlight::AGS_EngineStartup;
- apl->engineShutdown = agsflashlight::AGS_EngineShutdown;
- apl->onEvent = agsflashlight::AGS_EngineOnEvent;
- apl->debugHook = agsflashlight::AGS_EngineDebugHook;
- apl->initGfxHook = agsflashlight::AGS_EngineInitGfx;
- apl->available = true;
- apl->builtin = true;
- return true;
- } else if (ags_stricmp(apl->filename, "agsblend") == 0) {
- apl->engineStartup = agsblend::AGS_EngineStartup;
- apl->engineShutdown = agsblend::AGS_EngineShutdown;
- apl->onEvent = agsblend::AGS_EngineOnEvent;
- apl->debugHook = agsblend::AGS_EngineDebugHook;
- apl->initGfxHook = agsblend::AGS_EngineInitGfx;
- apl->available = true;
- apl->builtin = true;
- return true;
- } else if (ags_stricmp(apl->filename, "ags_snowrain") == 0) {
- apl->engineStartup = ags_snowrain::AGS_EngineStartup;
- apl->engineShutdown = ags_snowrain::AGS_EngineShutdown;
- apl->onEvent = ags_snowrain::AGS_EngineOnEvent;
- apl->debugHook = ags_snowrain::AGS_EngineDebugHook;
- apl->initGfxHook = ags_snowrain::AGS_EngineInitGfx;
- apl->available = true;
- apl->builtin = true;
- return true;
- } else if (ags_stricmp(apl->filename, "ags_parallax") == 0) {
- apl->engineStartup = ags_parallax::AGS_EngineStartup;
- apl->engineShutdown = ags_parallax::AGS_EngineShutdown;
- apl->onEvent = ags_parallax::AGS_EngineOnEvent;
- apl->debugHook = ags_parallax::AGS_EngineDebugHook;
- apl->initGfxHook = ags_parallax::AGS_EngineInitGfx;
- apl->available = true;
- apl->builtin = true;
- return true;
- } else if (ags_stricmp(apl->filename, "agspalrender") == 0) {
- apl->engineStartup = agspalrender::AGS_EngineStartup;
- apl->engineShutdown = agspalrender::AGS_EngineShutdown;
- apl->onEvent = agspalrender::AGS_EngineOnEvent;
- apl->debugHook = agspalrender::AGS_EngineDebugHook;
- apl->initGfxHook = agspalrender::AGS_EngineInitGfx;
- apl->available = true;
- apl->builtin = true;
- return true;
- }
-#if AGS_PLATFORM_OS_IOS
- else if (ags_stricmp(apl->filename, "agstouch") == 0) {
- apl->engineStartup = agstouch::AGS_EngineStartup;
- apl->engineShutdown = agstouch::AGS_EngineShutdown;
- apl->onEvent = agstouch::AGS_EngineOnEvent;
- apl->debugHook = agstouch::AGS_EngineDebugHook;
- apl->initGfxHook = agstouch::AGS_EngineInitGfx;
- apl->available = true;
- apl->builtin = true;
- return true;
- }
-#endif // IOS_VERSION
-#endif // BUILTIN_PLUGINS
-
- for (std::vector<InbuiltPluginDetails>::iterator it = _registered_builtin_plugins.begin(); it != _registered_builtin_plugins.end(); ++it) {
- if (ags_stricmp(apl->filename, it->filename) == 0) {
- apl->engineStartup = it->engineStartup;
- apl->engineShutdown = it->engineShutdown;
- apl->onEvent = it->onEvent;
- apl->debugHook = it->debugHook;
- apl->initGfxHook = it->initGfxHook;
- apl->available = true;
- apl->builtin = true;
- return true;
- }
- }
- return false;
-}
-
Engine::GameInitError pl_register_plugins(const std::vector<Shared::PluginInfo> &infos) {
numPlugins = 0;
for (size_t inf_index = 0; inf_index < infos.size(); ++inf_index) {
@@ -1037,16 +960,13 @@ Engine::GameInitError pl_register_plugins(const std::vector<Shared::PluginInfo>
} else {
AGS::Shared::Debug::Printf(kDbgMsg_Info, "Plugin '%s' could not be loaded (expected '%s'), trying built-in plugins...",
apl->filename, expect_filename.GetCStr());
- if (pl_use_builtin_plugin(apl)) {
- AGS::Shared::Debug::Printf(kDbgMsg_Info, "Build-in plugin '%s' found and being used.", apl->filename);
- } else {
- // Plugin loading has failed at this point, try using built-in plugin function stubs
- if (RegisterPluginStubs((const char *)apl->filename))
- AGS::Shared::Debug::Printf(kDbgMsg_Info, "Placeholder functions for the plugin '%s' found.", apl->filename);
- else
- AGS::Shared::Debug::Printf(kDbgMsg_Info, "No placeholder functions for the plugin '%s' found. The game might fail to load!", apl->filename);
- continue;
- }
+
+ // Plugin loading has failed at this point, try using built-in plugin function stubs
+ if (RegisterPluginStubs((const char *)apl->filename))
+ AGS::Shared::Debug::Printf(kDbgMsg_Info, "Placeholder functions for the plugin '%s' found.", apl->filename);
+ else
+ AGS::Shared::Debug::Printf(kDbgMsg_Info, "No placeholder functions for the plugin '%s' found. The game might fail to load!", apl->filename);
+ continue;
}
apl->eiface.pluginId = numPlugins - 1;
diff --git a/engines/ags/plugins/agsplugin.h b/engines/ags/plugins/agsplugin.h
index 5322c87911..b37f1dfa0f 100644
--- a/engines/ags/plugins/agsplugin.h
+++ b/engines/ags/plugins/agsplugin.h
@@ -564,34 +564,6 @@ public:
AGSIFUNC(IAGSFontRenderer *) ReplaceFontRenderer(int fontNumber, IAGSFontRenderer *newRenderer);
};
-#ifdef THIS_IS_THE_PLUGIN
-
-#ifdef WINDOWS_VERSION
-#define DLLEXPORT extern "C" __declspec(dllexport)
-#else
-// MAC VERSION: compile with -fvisibility=hidden
-// gcc -dynamiclib -std=gnu99 agsplugin.c -fvisibility=hidden -o agsplugin.dylib
-#define DLLEXPORT extern "C" __attribute__((visibility("default")))
-#endif
-
-DLLEXPORT const char *AGS_GetPluginName(void);
-DLLEXPORT int AGS_EditorStartup(IAGSEditor *);
-DLLEXPORT void AGS_EditorShutdown(void);
-DLLEXPORT void AGS_EditorProperties(HWND);
-DLLEXPORT int AGS_EditorSaveGame(char *, int);
-DLLEXPORT void AGS_EditorLoadGame(char *, int);
-DLLEXPORT void AGS_EngineStartup(IAGSEngine *);
-DLLEXPORT void AGS_EngineShutdown(void);
-DLLEXPORT int AGS_EngineOnEvent(int, int);
-DLLEXPORT int AGS_EngineDebugHook(const char *, int, int);
-DLLEXPORT void AGS_EngineInitGfx(const char *driverID, void *data);
-// We export this to verify that we are an AGS Plugin
-DLLEXPORT int AGS_PluginV2() {
- return 1;
-}
-
-#endif // THIS_IS_THE_PLUGIN
-
} // namespace AGS3
#endif
diff --git a/engines/ags/plugins/dll.cpp b/engines/ags/plugins/dll.cpp
index 3d55eb963a..ebdec1f73a 100644
--- a/engines/ags/plugins/dll.cpp
+++ b/engines/ags/plugins/dll.cpp
@@ -30,6 +30,7 @@
#include "ags/plugins/ags_pal_render/ags_pal_render.h"
#include "ags/plugins/ags_snow_rain/ags_snow_rain.h"
#include "ags/plugins/ags_sprite_font/ags_sprite_font.h"
+#include "ags/plugins/ags_tcp_ip/ags_tcp_ip.h"
#include "ags/ags.h"
#include "ags/detection.h"
#include "common/str.h"
@@ -50,6 +51,9 @@ void *pluginOpen(const char *filename) {
}
}
+ if (fname.equalsIgnoreCase("ags_tcp_ip"))
+ return new AGSTcpIp::AGSTcpIp();
+
if (fname.equalsIgnoreCase("AGSBlend"))
return new AGSBlend::AGSBlend();
diff --git a/engines/ags/shared/core/types.h b/engines/ags/shared/core/types.h
index 35f839fb37..2464ca35d1 100644
--- a/engines/ags/shared/core/types.h
+++ b/engines/ags/shared/core/types.h
@@ -113,7 +113,7 @@ union NumberPtr {
NumberPtr(int value) { _ptr = nullptr; _value = value; }
NumberPtr(void *ptr) : _ptr(ptr) {}
- operator bool() const { return _ptr != nullptr; }
+ operator int() const { return _value; }
};
} // namespace AGS3
More information about the Scummvm-git-logs
mailing list