[Scummvm-git-logs] scummvm master -> 9856dd930364e19e378b180c19a50eb43a52979b
salty-horse
ori at avtalion.name
Mon Feb 15 17:13:46 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:
be8fe20fff TINSEL: Remove redundant struct initialization
9856dd9303 TINSEL: Silence g++ warnings
Commit: be8fe20fffce1b082cbec73b08dc2c7c9b558662
https://github.com/scummvm/scummvm/commit/be8fe20fffce1b082cbec73b08dc2c7c9b558662
Author: Ori Avtalion (ori at avtalion.name)
Date: 2021-02-15T18:55:18+02:00
Commit Message:
TINSEL: Remove redundant struct initialization
Changed paths:
engines/tinsel/background.cpp
diff --git a/engines/tinsel/background.cpp b/engines/tinsel/background.cpp
index 740236e1ad..1a6ffa5628 100644
--- a/engines/tinsel/background.cpp
+++ b/engines/tinsel/background.cpp
@@ -77,24 +77,6 @@ void Background::InitBackground() {
// init background sky color
SetBgndColor(_pCurBgnd->rgbSkyColor);
-
- // for each background playfield
- for (int i = 0; i < _pCurBgnd->fieldArray.size(); i++) {
- PLAYFIELD cur = _pCurBgnd->fieldArray[i];
- // init playfield pos
- cur.fieldX = intToFrac(_pCurBgnd->ptInitWorld.x);
- cur.fieldY = intToFrac(_pCurBgnd->ptInitWorld.y);
-
- // no scrolling
- cur.fieldXvel = intToFrac(0);
- cur.fieldYvel = intToFrac(0);
-
- // clear playfield display list
- cur.pDispList = nullptr;
-
- // clear playfield moved flag
- cur.bMoved = false;
- }
}
/**
Commit: 9856dd930364e19e378b180c19a50eb43a52979b
https://github.com/scummvm/scummvm/commit/9856dd930364e19e378b180c19a50eb43a52979b
Author: Ori Avtalion (ori at avtalion.name)
Date: 2021-02-15T19:08:30+02:00
Commit Message:
TINSEL: Silence g++ warnings
Changed paths:
engines/tinsel/background.cpp
engines/tinsel/background.h
engines/tinsel/dialogs.cpp
engines/tinsel/tinlib.cpp
diff --git a/engines/tinsel/background.cpp b/engines/tinsel/background.cpp
index 1a6ffa5628..19da3f51cb 100644
--- a/engines/tinsel/background.cpp
+++ b/engines/tinsel/background.cpp
@@ -86,14 +86,14 @@ void Background::InitBackground() {
* @param newYpos New y position
*/
-void Background::PlayfieldSetPos(int which, int newXpos, int newYpos) {
+void Background::PlayfieldSetPos(unsigned int which, int newXpos, int newYpos) {
PLAYFIELD *pPlayfield; // pointer to relavent playfield
// make sure there is a background
assert(_pCurBgnd != NULL);
// make sure the playfield number is in range
- assert(which >= 0 && which < _pCurBgnd->fieldArray.size());
+ assert(which < _pCurBgnd->fieldArray.size());
// get playfield pointer
pPlayfield = &_pCurBgnd->fieldArray[which];
@@ -113,14 +113,14 @@ void Background::PlayfieldSetPos(int which, int newXpos, int newYpos) {
* @param pYpos Returns current y position
*/
-void Background::PlayfieldGetPos(int which, int *pXpos, int *pYpos) {
+void Background::PlayfieldGetPos(unsigned int which, int *pXpos, int *pYpos) {
PLAYFIELD *pPlayfield; // pointer to relavent playfield
// make sure there is a background
assert(_pCurBgnd != NULL);
// make sure the playfield number is in range
- assert(which >= 0 && which < _pCurBgnd->fieldArray.size());
+ assert(which < _pCurBgnd->fieldArray.size());
// get playfield pointer
pPlayfield = &_pCurBgnd->fieldArray[which];
@@ -135,14 +135,14 @@ void Background::PlayfieldGetPos(int which, int *pXpos, int *pYpos) {
* @param which Which playfield
*/
-int Background::PlayfieldGetCenterX(int which) {
+int Background::PlayfieldGetCenterX(unsigned int which) {
PLAYFIELD *pPlayfield; // pointer to relavent playfield
// make sure there is a background
assert(_pCurBgnd != NULL);
// make sure the playfield number is in range
- assert(which >= 0 && which < _pCurBgnd->fieldArray.size());
+ assert(which < _pCurBgnd->fieldArray.size());
// get playfield pointer
pPlayfield = &_pCurBgnd->fieldArray[which];
@@ -156,14 +156,14 @@ int Background::PlayfieldGetCenterX(int which) {
* @param which Which playfield
*/
-OBJECT **Background::GetPlayfieldList(int which) {
+OBJECT **Background::GetPlayfieldList(unsigned int which) {
PLAYFIELD *pPlayfield; // pointer to relavent playfield
// make sure there is a background
assert(_pCurBgnd != NULL);
// make sure the playfield number is in range
- assert(which >= 0 && which < _pCurBgnd->fieldArray.size());
+ assert(which < _pCurBgnd->fieldArray.size());
// get playfield pointer
pPlayfield = &_pCurBgnd->fieldArray[which];
@@ -179,7 +179,6 @@ OBJECT **Background::GetPlayfieldList(int which) {
*/
void Background::DrawBackgnd() {
- int i; // playfield counter
PLAYFIELD *pPlay; // playfield pointer
int prevX, prevY; // save interger part of position
Common::Point ptWin; // window top left
@@ -188,7 +187,7 @@ void Background::DrawBackgnd() {
return; // no current background
// scroll each background playfield
- for (i = 0; i < _pCurBgnd->fieldArray.size(); i++) {
+ for (unsigned int i = 0; i < _pCurBgnd->fieldArray.size(); i++) {
// get pointer to correct playfield
pPlay = &_pCurBgnd->fieldArray[i];
@@ -227,7 +226,7 @@ void Background::DrawBackgnd() {
for (RectList::const_iterator r = clipRects.begin(); r != clipRects.end(); ++r) {
// clear the clip rectangle on the virtual screen
// for each background playfield
- for (i = 0; i < _pCurBgnd->fieldArray.size(); i++) {
+ for (unsigned int i = 0; i < _pCurBgnd->fieldArray.size(); i++) {
Common::Rect rcPlayClip; // clip rect for this playfield
// get pointer to correct playfield
diff --git a/engines/tinsel/background.h b/engines/tinsel/background.h
index 312ae6d09d..bb6660acef 100644
--- a/engines/tinsel/background.h
+++ b/engines/tinsel/background.h
@@ -101,20 +101,20 @@ public:
void StartupBackground(CORO_PARAM, SCNHANDLE hFilm);
void PlayfieldSetPos( // Sets the xy position of the specified playfield in the current background
- int which, // which playfield
+ unsigned int which, // which playfield
int newXpos, // new x position
int newYpos); // new y position
void PlayfieldGetPos( // Returns the xy position of the specified playfield in the current background
- int which, // which playfield
+ unsigned int which, // which playfield
int* pXpos, // returns current x position
int* pYpos); // returns current y position
int PlayfieldGetCenterX( // Returns the xy position of the specified playfield in the current background
- int which); // which playfield
+ unsigned int which); // which playfield
OBJECT** GetPlayfieldList( // Returns the display list for the specified playfield
- int which); // which playfield
+ unsigned int which); // which playfield
OBJECT* GetBgObject() { return _pBG[0]; }
diff --git a/engines/tinsel/dialogs.cpp b/engines/tinsel/dialogs.cpp
index 9d2c81a234..adff91d201 100644
--- a/engines/tinsel/dialogs.cpp
+++ b/engines/tinsel/dialogs.cpp
@@ -1661,7 +1661,7 @@ enum { I_NOTIN,
I_ENDCHANGE
};
-#define EXTRA 1 // This was introduced when we decided to increase \
+#define EXTRA 1 // This was introduced when we decided to increase
// the active area of the borders for re-sizing.
/*---------------------------------*/
diff --git a/engines/tinsel/tinlib.cpp b/engines/tinsel/tinlib.cpp
index f0d28efbd2..69e11bc473 100644
--- a/engines/tinsel/tinlib.cpp
+++ b/engines/tinsel/tinlib.cpp
@@ -331,7 +331,7 @@ void ResetVarsTinlib() {
}
/**
- * For Scroll() and Offset(), work out top left for a
+ * For ScrollScreen() and Offset(), work out top left for a
* given screen position.
*/
static void DecodeExtreme(EXTREME extreme, int *px, int *py) {
@@ -884,9 +884,9 @@ static void ConvTopic(int icon) {
}
/**
- * Cursor(on/off)
+ * ToggleCursor(on/off)
*/
-void Cursor(int onoff) {
+void ToggleCursor(int onoff) {
if (onoff) {
// Re-instate cursor
_vm->_cursor->UnHideCursor();
@@ -2514,7 +2514,7 @@ static int ScanIcon() {
/**
* Scroll the screen to target co-ordinates.
*/
-static void Scroll(CORO_PARAM, EXTREME extreme, int xp, int yp, int xIter, int yIter, bool bComp, bool escOn, int myEscape) {
+static void ScrollScreen(CORO_PARAM, EXTREME extreme, int xp, int yp, int xIter, int yIter, bool bComp, bool escOn, int myEscape) {
CORO_BEGIN_CONTEXT;
int thisScroll;
int x, y;
@@ -4535,7 +4535,7 @@ int CallLibraryRoutine(CORO_PARAM, int operand, int32 *pp, const INT_CONTEXT *pi
case CURSOR:
// DW2 only
- Cursor(pp[0]);
+ ToggleCursor(pp[0]);
return -1;
case CURSORXPOS:
@@ -5200,11 +5200,11 @@ int CallLibraryRoutine(CORO_PARAM, int operand, int32 *pp, const INT_CONTEXT *pi
// Common to both DW1 & DW2
if (TinselV2) {
pp -= 5; // 6 parameters
- Scroll(coroParam, (EXTREME)pp[0], pp[1], pp[2], pp[3], pp[4], pp[5], pic->escOn, pic->myEscape);
+ ScrollScreen(coroParam, (EXTREME)pp[0], pp[1], pp[2], pp[3], pp[4], pp[5], pic->escOn, pic->myEscape);
return -6;
} else {
pp -= 3; // 4 parameters
- Scroll(coroParam, EX_USEXY, pp[0], pp[1], pp[2], pp[2], pp[3], pic->escOn, pic->myEscape);
+ ScrollScreen(coroParam, EX_USEXY, pp[0], pp[1], pp[2], pp[2], pp[3], pic->escOn, pic->myEscape);
return -4;
}
More information about the Scummvm-git-logs
mailing list