[Scummvm-git-logs] scummvm master -> 54e6707abf48e4fdb6f5b0331a2e4274ee741853
dreammaster
dreammaster at scummvm.org
Sat Mar 20 02:48:29 UTC 2021
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
54e6707abf AGS: Further AGSCreditz1 methods
Commit: 54e6707abf48e4fdb6f5b0331a2e4274ee741853
https://github.com/scummvm/scummvm/commit/54e6707abf48e4fdb6f5b0331a2e4274ee741853
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2021-03-19T19:48:17-07:00
Commit Message:
AGS: Further AGSCreditz1 methods
Changed paths:
engines/ags/plugins/ags_creditz/ags_creditz.h
engines/ags/plugins/ags_creditz/ags_creditz1.cpp
diff --git a/engines/ags/plugins/ags_creditz/ags_creditz.h b/engines/ags/plugins/ags_creditz/ags_creditz.h
index c5275a4615..153041b798 100644
--- a/engines/ags/plugins/ags_creditz/ags_creditz.h
+++ b/engines/ags/plugins/ags_creditz/ags_creditz.h
@@ -112,6 +112,8 @@ struct State {
// Version 1.1 specific
bool _resolutionFlag = false;
int32 _screenWidth = 0, _screenHeight = 0, _screenColorDepth = 0;
+ int32 _staticScreenWidth = 0;
+ bool _staticWidthMatches = false;
};
class AGSCreditz : public PluginBase {
diff --git a/engines/ags/plugins/ags_creditz/ags_creditz1.cpp b/engines/ags/plugins/ags_creditz/ags_creditz1.cpp
index edafa77532..8d7f170e77 100644
--- a/engines/ags/plugins/ags_creditz/ags_creditz1.cpp
+++ b/engines/ags/plugins/ags_creditz/ags_creditz1.cpp
@@ -182,7 +182,22 @@ void AGSCreditz1::GetStaticCredit(ScriptMethodParams ¶ms) {
}
void AGSCreditz1::StartEndStaticCredits(ScriptMethodParams ¶ms) {
- //PARAMS2(int, onoff, int, res);
+ PARAMS2(bool, onoff, int, res);
+
+ if (!onoff) {
+ _state->_staticCredits = false;
+
+ } else if (res != 1 && res != 2) {
+ _engine->AbortGame("StartEndStaticCredits: Wrong resolution");
+
+ } else {
+ _state->_currentStatic = 0;
+ _engine->GetScreenDimensions(&_state->_screenWidth,
+ &_state->_screenHeight, &_state->_screenColorDepth);
+
+ _state->_staticScreenWidth = (res == 1) ? 320 : 640;
+ _state->_staticWidthMatches = _state->_screenWidth == _state->_staticScreenWidth;
+ }
}
void AGSCreditz1::GetCurrentStaticCredit(ScriptMethodParams ¶ms) {
@@ -214,7 +229,31 @@ void AGSCreditz1::SetStaticCreditTitle(ScriptMethodParams ¶ms) {
}
void AGSCreditz1::ShowStaticCredit(ScriptMethodParams ¶ms) {
- //PARAMS6(int, ID, int, time, int, style, int, transtime, int, sound, int, resolution);
+ PARAMS6(int, ID, int, time, int, style, int, transtime, \
+ int, sound, int, res);
+ const StCredit &c = _state->_stCredits[0][ID];
+
+ if (!_state->_staticCredits) {
+ if (c.credit.empty() && c.title.empty()) {
+ _engine->AbortGame("ShowStaticCredit: Credit not set!");
+ } else if (res == 1 || (res == 2 && c.credit != "P=A=U=S=E")) {
+ if (style == 1) {
+ // TODO: style 1 setup
+ warning("TODO: Use %d %d", transtime, sound);
+ }
+
+ _engine->GetScreenDimensions(&_state->_screenWidth,
+ &_state->_screenHeight, &_state->_screenColorDepth);
+
+ _state->_staticScreenWidth = (res == 1) ? 320 : 640;
+ _state->_staticWidthMatches = _state->_screenWidth == _state->_staticScreenWidth;
+ _state->_currentStatic = ID;
+
+ // TODO: Final static setup
+ }
+ }
+
+ params._result = 0;
}
void AGSCreditz1::StaticReset(ScriptMethodParams ¶ms) {
More information about the Scummvm-git-logs
mailing list