[Scummvm-git-logs] scummvm master -> 711375de61b8ef1db86e042469d5364676a1478a

Strangerke noreply at scummvm.org
Mon May 6 07:19:06 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:
711375de61 BAGEL: Remove color definitions in dossier, text and variable objects, move it to text.h


Commit: 711375de61b8ef1db86e042469d5364676a1478a
    https://github.com/scummvm/scummvm/commit/711375de61b8ef1db86e042469d5364676a1478a
Author: Strangerke (arnaud.boutonne at gmail.com)
Date: 2024-05-06T08:18:57+01:00

Commit Message:
BAGEL: Remove color definitions in dossier, text and variable objects, move it to text.h

Changed paths:
    devtools/create_prince
    engines/bagel/baglib/dossier_object.cpp
    engines/bagel/baglib/text_object.cpp
    engines/bagel/baglib/variable_object.cpp
    engines/bagel/boflib/gfx/text.h


diff --git a/devtools/create_prince b/devtools/create_prince
index 4e2acb737c9..63b0b1e18bf 160000
--- a/devtools/create_prince
+++ b/devtools/create_prince
@@ -1 +1 @@
-Subproject commit 4e2acb737c936a576dee19927bb0cab5a0ae3b2d
+Subproject commit 63b0b1e18bf16fa725922d1025b28367a0b5cf4c
diff --git a/engines/bagel/baglib/dossier_object.cpp b/engines/bagel/baglib/dossier_object.cpp
index 66921d51a7d..79ab9c5b052 100644
--- a/engines/bagel/baglib/dossier_object.cpp
+++ b/engines/bagel/baglib/dossier_object.cpp
@@ -182,8 +182,6 @@ ParseCodes CBagDossierObject::setInfo(CBagIfstream &istr) {
 			//
 			//  COLOR n - n color index
 			//
-#define CTEXT_YELLOW RGB(255, 255, 0)
-#define CTEXT_WHITE RGB(255, 255, 255)
 		case 'C':
 			getAlphaNumFromStream(istr, sStr);
 
diff --git a/engines/bagel/baglib/text_object.cpp b/engines/bagel/baglib/text_object.cpp
index 5fb68d741ee..56d3bb70c16 100644
--- a/engines/bagel/baglib/text_object.cpp
+++ b/engines/bagel/baglib/text_object.cpp
@@ -31,8 +31,6 @@
 
 namespace Bagel {
 
-#define CTEXT_WHITE RGB(255, 255, 255)
-
 extern bool g_pauseTimerFl;
 
 CBagTextObject::CBagTextObject() : CBagObject() {
@@ -425,7 +423,7 @@ void CBagTextObject::setColor(int nColor) {
 		_nFGColor = CTEXT_WHITE;
 		break; // White
 	case 8:
-		_nFGColor = RGB(255, 255, 0);
+		_nFGColor = CTEXT_YELLOW;
 		break; // Yellow (chat highlight)
 	default:
 		break;
diff --git a/engines/bagel/baglib/variable_object.cpp b/engines/bagel/baglib/variable_object.cpp
index ab60eed1a77..20e7f5d9260 100644
--- a/engines/bagel/baglib/variable_object.cpp
+++ b/engines/bagel/baglib/variable_object.cpp
@@ -34,7 +34,7 @@ CBagVariableObject::CBagVariableObject() : CBagObject() {
 }
 
 CBagVariableObject::~CBagVariableObject() {
-	detach();
+	CBagVariableObject::detach();
 }
 
 ErrorCode CBagVariableObject::attach() {
@@ -61,12 +61,11 @@ CBofRect CBagVariableObject::getRect() {
 //   Takes in info and then removes the relative information and returns the info
 //   without the relevant info.
 ParseCodes CBagVariableObject::setInfo(CBagIfstream &istr) {
-	int nChanged;
 	bool nObjectUpdated = false;
 	char ch;
 
 	while (!istr.eof()) {
-		nChanged = 0;
+		int nChanged = 0;
 
 		istr.eatWhite();
 
@@ -95,8 +94,6 @@ ParseCodes CBagVariableObject::setInfo(CBagIfstream &istr) {
 		//
 		// COLOR n - n color index
 		//
-		#define		CTEXT_YELLOW		RGB(255,255,0)
-		#define     CTEXT_WHITE			RGB(255,255,255)
 		case 'C': {
 			char szLocalStr[256];
 			szLocalStr[0] = 0;
diff --git a/engines/bagel/boflib/gfx/text.h b/engines/bagel/boflib/gfx/text.h
index 5b5af232551..d753a385b9e 100644
--- a/engines/bagel/boflib/gfx/text.h
+++ b/engines/bagel/boflib/gfx/text.h
@@ -35,6 +35,8 @@ namespace Bagel {
 // Text color and offset definitions
 #define CTEXT_COLOR         RGB(0,0,0)
 #define CTEXT_SHADOW_COLOR  RGB(0,0,0)
+#define CTEXT_YELLOW        RGB(255, 255, 0)
+#define CTEXT_WHITE         RGB(255, 255, 255)
 
 #define CTEXT_SHADOW_DX     2
 #define CTEXT_SHADOW_DY     2




More information about the Scummvm-git-logs mailing list