[Scummvm-git-logs] scummvm master -> 0156bf61211e0052f5e8d723917ca8a054b2c327
Strangerke
noreply at scummvm.org
Sun May 5 21:06:08 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:
0156bf6121 BAGEL: in time_object, move assignments out of if statements
Commit: 0156bf61211e0052f5e8d723917ca8a054b2c327
https://github.com/scummvm/scummvm/commit/0156bf61211e0052f5e8d723917ca8a054b2c327
Author: Strangerke (arnaud.boutonne at gmail.com)
Date: 2024-05-05T22:06:02+01:00
Commit Message:
BAGEL: in time_object, move assignments out of if statements
Changed paths:
engines/bagel/baglib/time_object.cpp
diff --git a/engines/bagel/baglib/time_object.cpp b/engines/bagel/baglib/time_object.cpp
index d5f90794b0e..fe5caa3334e 100644
--- a/engines/bagel/baglib/time_object.cpp
+++ b/engines/bagel/baglib/time_object.cpp
@@ -46,7 +46,8 @@ CBagTimeObject::~CBagTimeObject() {
ErrorCode CBagTimeObject::attach() {
CBofPoint p = CBagObject::getPosition();
- if ((_xDig1 = new CBofSprite()) != nullptr) {
+ _xDig1 = new CBofSprite();
+ if (_xDig1 != nullptr) {
if (_xDig1->loadSprite(getFileName(), getCels()) != 0 && (_xDig1->width() != 0) && (_xDig1->height() != 0)) {
_xDig1->setAnimated(false);
_xDig1->setPosition(p.x, p.y);
@@ -61,7 +62,8 @@ ErrorCode CBagTimeObject::attach() {
reportError(ERR_MEMORY, "Could not allocate Dig1 sprite");
}
- if ((_xDig2 = new CBofSprite()) != nullptr) {
+ _xDig2 = new CBofSprite();
+ if (_xDig2 != nullptr) {
if (_xDig2->loadSprite(getFileName(), getCels()) != 0 && (_xDig2->width() != 0) && (_xDig2->height() != 0)) {
_xDig2->setAnimated(false);
_xDig2->setPosition(p.x, p.y);
@@ -73,7 +75,8 @@ ErrorCode CBagTimeObject::attach() {
reportError(ERR_MEMORY, "Could not allocate Dig2 sprite");
}
- if ((_xColon = new CBofSprite()) != nullptr) {
+ _xColon = new CBofSprite();
+ if (_xColon != nullptr) {
if (_xColon->loadSprite(getFileName(), getCels()) != 0 && (_xColon->width() != 0) && (_xColon->height() != 0)) {
_xColon->setAnimated(false);
@@ -90,7 +93,8 @@ ErrorCode CBagTimeObject::attach() {
reportError(ERR_MEMORY, "Could not allocate Colon sprite");
}
- if ((_xDig3 = new CBofSprite()) != nullptr) {
+ _xDig3 = new CBofSprite();
+ if (_xDig3 != nullptr) {
if (_xDig3->loadSprite(getFileName(), getCels()) != 0 && (_xDig3->width() != 0) && (_xDig3->height() != 0)) {
_xDig3->setAnimated(false);
_xDig3->setPosition(p.x, p.y);
@@ -102,7 +106,8 @@ ErrorCode CBagTimeObject::attach() {
reportError(ERR_MEMORY, "Could not allocate Dig3 sprite");
}
- if ((_xDig4 = new CBofSprite()) != nullptr) {
+ _xDig4 = new CBofSprite();
+ if (_xDig4 != nullptr) {
if (_xDig4->loadSprite(getFileName(), getCels()) != 0 && (_xDig4->width() != 0) && (_xDig4->height() != 0)) {
_xDig4->setAnimated(false);
_xDig4->setPosition(p.x, p.y);
More information about the Scummvm-git-logs
mailing list