[Scummvm-git-logs] scummvm master -> 1518218af59bcf5bb3f9b40dc1a31b9f144566c3
Strangerke
noreply at scummvm.org
Tue May 7 08:33:37 UTC 2024
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:
1518218af5 BAGEL: Some renaming in movie_object, remove useless asignments of rc in runObject() (CIC 1544842)
Commit: 1518218af59bcf5bb3f9b40dc1a31b9f144566c3
https://github.com/scummvm/scummvm/commit/1518218af59bcf5bb3f9b40dc1a31b9f144566c3
Author: Strangerke (arnaud.boutonne at gmail.com)
Date: 2024-05-07T09:33:29+01:00
Commit Message:
BAGEL: Some renaming in movie_object, remove useless asignments of rc in runObject() (CIC 1544842)
Changed paths:
engines/bagel/baglib/movie_object.cpp
engines/bagel/baglib/movie_object.h
diff --git a/engines/bagel/baglib/movie_object.cpp b/engines/bagel/baglib/movie_object.cpp
index e84cc63b742..609918f2be1 100644
--- a/engines/bagel/baglib/movie_object.cpp
+++ b/engines/bagel/baglib/movie_object.cpp
@@ -39,7 +39,7 @@ namespace Bagel {
CBagMovieObject::CBagMovieObject() {
_xObjType = MOVIE_OBJ;
setVisible(true);
- _xDisplayType = DISP_TYPE::MOVIE;
+ _xDisplayType = dispType::MOVIE;
_bFlyThru = false;
// Initialize asynch flags to be off by default.
@@ -60,7 +60,7 @@ CBagMovieObject::~CBagMovieObject() {
// Could still by lying around in the pda movie queue,
// Make sure it has been removed.
- if (_xDisplayType == DISP_TYPE::ASYNCH_PDAMSG) {
+ if (_xDisplayType == dispType::ASYNCH_PDA_MSG) {
CBagPDA::removeFromMovieQueue(this);
}
@@ -156,7 +156,7 @@ bool CBagMovieObject::runObject() {
// If we have an asnych movie to play, make sure it is a good
// time to play it, if not, then queue it up so it can play at a much better time.
- if (_xDisplayType == DISP_TYPE::ASYNCH_PDAMSG) {
+ if (_xDisplayType == dispType::ASYNCH_PDA_MSG) {
if (asynchPDAMovieCanPlay() == false) {
pPDA->addToMovieQueue(this);
return rc;
@@ -172,7 +172,7 @@ bool CBagMovieObject::runObject() {
}
}
- if (_xDisplayType == DISP_TYPE::EXAMINE) {
+ if (_xDisplayType == dispType::EXAMINE) {
CBofRect r(160, 60, 480, 300);
// Offset the rect for the movies to compensate for all screen sizes
@@ -199,7 +199,6 @@ bool CBagMovieObject::runObject() {
wnd->flushAllMessages();
pMovie->initExam();
delete pMovie;
- rc = true;
// As soon as we're done, detach (this will also stop the sound).
if (pSObj) {
@@ -213,10 +212,10 @@ bool CBagMovieObject::runObject() {
// Offset the rect for the movies to compensate for all screen sizes
r.offsetRect(((CBofWindow *)pMainWin)->getWindowRect().topLeft());
- if (_xDisplayType == DISP_TYPE::PDAMSG || _xDisplayType == DISP_TYPE::ASYNCH_PDAMSG) {
+ if (_xDisplayType == dispType::PDA_MSG || _xDisplayType == dispType::ASYNCH_PDA_MSG) {
// Pull up the PDA (if it exists)
// Only pull up the PDA if we're not playing an asynch movie
- if (_xDisplayType == DISP_TYPE::PDAMSG) {
+ if (_xDisplayType == dispType::PDA_MSG) {
// Increment timer one, pda message counts as one turn
// Allow scripter to override timer increment
if (isIncrement()) {
@@ -269,7 +268,6 @@ bool CBagMovieObject::runObject() {
pWnd->flushAllMessages();
pMovie->play(false);
delete pMovie;
- rc = true;
} else {
logError(buildString("Movie file could not be read: %s. How? You removed that CD again didn't you", sFileName.getBuffer()));
}
@@ -280,7 +278,7 @@ bool CBagMovieObject::runObject() {
}
} else {
// Hack.. allow script to override some other movies.
- if ((_xDisplayType == DISP_TYPE::PDAMSG) && pMainWin->isCIC() && isDontOverride() == false) {
+ if ((_xDisplayType == dispType::PDA_MSG) && pMainWin->isCIC() && isDontOverride() == false) {
char szLocalBuff[256];
CBofString cStr(szLocalBuff, 256);
@@ -292,7 +290,7 @@ bool CBagMovieObject::runObject() {
sFileName = cStr;
}
- if (_xDisplayType == DISP_TYPE::ASYNCH_PDAMSG) {
+ if (_xDisplayType == dispType::ASYNCH_PDA_MSG) {
// Tell our PDA to switch gears to do asynch movie time.
if (pPDA) {
if (pPDA->showMovie()) { // Returns false if another movie playing
@@ -304,7 +302,7 @@ bool CBagMovieObject::runObject() {
} else {
CBofMovie *pMovie;
- if (bZoomed && _xDisplayType != DISP_TYPE::ASYNCH_PDAMSG && _xDisplayType != DISP_TYPE::PDAMSG) {
+ if (bZoomed && _xDisplayType != dispType::ASYNCH_PDA_MSG && _xDisplayType != dispType::PDA_MSG) {
pNewWin = new CBofWindow();
if (pNewWin) {
pNewWin->create("BLACK", 0, 0, 640, 480, CBofApp::getApp()->getMainWindow(), 0);
@@ -314,7 +312,7 @@ bool CBagMovieObject::runObject() {
}
// If playing a PDA message while the PDA is zoomed
- if (_xDisplayType == DISP_TYPE::PDAMSG && bZoomed) {
+ if (_xDisplayType == dispType::PDA_MSG && bZoomed) {
// Then stretch it to fit into the PDA's viewscreen
r.setRect(24, 47, 28 + 600 - 1, 47 + 302 - 1);
pMovie = new CBofMovie(CBofApp::getApp()->getMainWindow(), sFileName, &r, true);
@@ -332,7 +330,6 @@ bool CBagMovieObject::runObject() {
pWnd->flushAllMessages();
pMovie->play(false);
delete pMovie;
- rc = true;
} else {
logError(buildString("Movie file could not be read: %s. How? You removed that CD again didn't you", sFileName.getBuffer()));
}
@@ -346,13 +343,13 @@ bool CBagMovieObject::runObject() {
}
// Put the pda down if we brought it up. (8638)
- if (_xDisplayType != DISP_TYPE::ASYNCH_PDAMSG && bActivated) {
+ if (_xDisplayType != dispType::ASYNCH_PDA_MSG && bActivated) {
((CBagPanWindow *)pMainWin)->deactivatePDA();
((CBagPanWindow *)pMainWin)->waitForPDA();
}
// If we're asynch, then let it know to deactivate when done playing.
- if (_xDisplayType == DISP_TYPE::ASYNCH_PDAMSG) {
+ if (_xDisplayType == dispType::ASYNCH_PDA_MSG) {
pPDA->setDeactivate(bActivated);
}
}
@@ -369,7 +366,6 @@ bool CBagMovieObject::runObject() {
if (pSound) {
pSound->play();
delete pSound;
- rc = true;
} else {
logError(buildString("Movie SOUND file could not be read: %s. Where? Not in Kansas ...", sFileName.getBuffer()));
}
@@ -380,7 +376,6 @@ bool CBagMovieObject::runObject() {
bofMessageBox(line.c_str(), "Incoming Message...");
f.close();
- rc = true;
} else {
logError(buildString("Movie TEXT file could not be read: %s. Why? because we like you ...", sFileName.getBuffer()));
}
@@ -412,17 +407,17 @@ ParseCodes CBagMovieObject::setInfo(CBagIfstream &istr) {
istr.eatWhite();
getAlphaNumFromStream(istr, sStr);
if (!sStr.find("EXAMINE")) {
- _xDisplayType = DISP_TYPE::EXAMINE;
+ _xDisplayType = dispType::EXAMINE;
} else if (!sStr.find("MOVIE")) {
- _xDisplayType = DISP_TYPE::MOVIE;
+ _xDisplayType = dispType::MOVIE;
} else if (!sStr.find("FLYTHRU")) {
- _xDisplayType = DISP_TYPE::MOVIE;
+ _xDisplayType = dispType::MOVIE;
_bFlyThru = true;
} else if (!sStr.find("PDAMSG")) {
- _xDisplayType = DISP_TYPE::PDAMSG;
+ _xDisplayType = dispType::PDA_MSG;
} else if (!sStr.find("ASYNCH_PDAMSG")) {
- _xDisplayType = DISP_TYPE::ASYNCH_PDAMSG;
+ _xDisplayType = dispType::ASYNCH_PDA_MSG;
// see if this improves performance any...
setPreload(true);
diff --git a/engines/bagel/baglib/movie_object.h b/engines/bagel/baglib/movie_object.h
index ccb758f8c0c..dc2276e72c8 100644
--- a/engines/bagel/baglib/movie_object.h
+++ b/engines/bagel/baglib/movie_object.h
@@ -28,19 +28,19 @@
namespace Bagel {
-#define ASYNCH_DONTQUEUE 0x0001
-#define ASYNCH_PLAYIMMEDIATE 0x0002
-#define ASYNCH_DONTOVERRIDE 0x0004
+#define ASYNCH_DONT_QUEUE 0x0001
+#define ASYNCH_PLAY_IMMEDIATE 0x0002
+#define ASYNCH_DONT_OVERRIDE 0x0004
/**
* CBagMovieObject is an object that can be place within the slide window.
*/
class CBagMovieObject : public CBagObject {
public:
- enum class DISP_TYPE { MOVIE, EXAMINE, PDAMSG, ASYNCH_PDAMSG };
+ enum class dispType { MOVIE, EXAMINE, PDA_MSG, ASYNCH_PDA_MSG };
private:
- DISP_TYPE _xDisplayType;
+ dispType _xDisplayType;
byte _bFlyThru;
int16 _nAsynchFlags;
bool _bIncrement : 1; // Increment timer for this movie?
@@ -55,46 +55,55 @@ public:
void setAssociatedSound(CBagSoundObject *p) {
_pSndObj = p;
}
+
CBagSoundObject *getAssociatedSound() const {
return _pSndObj;
}
- ParseCodes setInfo(CBagIfstream &istr);
+ ParseCodes setInfo(CBagIfstream &istr) override;
- virtual bool runObject();
+ bool runObject() override;
// Return true if this asynch zelda movie can play right now
bool asynchPDAMovieCanPlay();
// Special routines for handling asynch zelda movies
void setDontQueue() {
- _nAsynchFlags |= ASYNCH_DONTQUEUE;
+ _nAsynchFlags |= ASYNCH_DONT_QUEUE;
}
+
void setDontOverride() {
- _nAsynchFlags |= ASYNCH_DONTOVERRIDE;
+ _nAsynchFlags |= ASYNCH_DONT_OVERRIDE;
}
+
void setPlayImmediate() {
- _nAsynchFlags |= ASYNCH_PLAYIMMEDIATE;
+ _nAsynchFlags |= ASYNCH_PLAY_IMMEDIATE;
}
+
void setIncrement(bool b = true) {
_bIncrement = b;
}
+
void setOnBlack(bool b = true) {
_bOnBlack = b;
}
bool isDontQueue() const {
- return (_nAsynchFlags & ASYNCH_DONTQUEUE) != 0;
+ return (_nAsynchFlags & ASYNCH_DONT_QUEUE) != 0;
}
+
bool isDontOverride() const {
- return (_nAsynchFlags & ASYNCH_DONTOVERRIDE) != 0;
+ return (_nAsynchFlags & ASYNCH_DONT_OVERRIDE) != 0;
}
+
bool isPlayImmediate() const {
- return (_nAsynchFlags & ASYNCH_PLAYIMMEDIATE) != 0;
+ return (_nAsynchFlags & ASYNCH_PLAY_IMMEDIATE) != 0;
}
+
bool isIncrement() const {
return _bIncrement;
}
+
bool isOnBlack() const {
return _bOnBlack;
}
More information about the Scummvm-git-logs
mailing list