[Scummvm-git-logs] scummvm master -> 78b0bee9fc71357bfa6069b749c1e78467ce6a37

a-yyg 76591232+a-yyg at users.noreply.github.com
Thu Jul 29 08:00:59 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:
aa7671bc9d SAGA2: Fix parchment close button rect
78b0bee9fc SAGA2: Fix pointer arrow in documents


Commit: aa7671bc9d71f2fbe45970e2b4beef86aa62f3b4
    https://github.com/scummvm/scummvm/commit/aa7671bc9d71f2fbe45970e2b4beef86aa62f3b4
Author: a/ (yuri.kgpps at gmail.com)
Date: 2021-07-29T16:59:01+09:00

Commit Message:
SAGA2: Fix parchment close button rect

Changed paths:
    engines/saga2/document.cpp


diff --git a/engines/saga2/document.cpp b/engines/saga2/document.cpp
index 67b21ebbc9..de9631e5a7 100644
--- a/engines/saga2/document.cpp
+++ b/engines/saga2/document.cpp
@@ -119,7 +119,7 @@ CDocumentAppearance parchAppearance = {
 	pageOrientVertical,
 	bookTextColors,
 	{ {27, 18, 149, 212}, {0, 0, 0, 0} },
-	{64, 229,  20,  20},
+	{164, 229,  20,  20},
 	parchDecorations,
 	ARRAYSIZE(parchDecorations),
 	MKTAG('P', 'A', 'R', 'C'),
@@ -787,7 +787,6 @@ int16 openBook(uint16 textScript) {
 	rInfo.result    = -1;
 	rInfo.running   = true;
 
-	warning("STUB: openBook()");
 
 	// point to book
 	CDocument       *win = NULL;
@@ -834,7 +833,6 @@ int16 openParchment(uint16 textScript) {
 	rInfo.result    = -1;
 	rInfo.running   = true;
 
-	warning("STUB: openParchment()");
 
 	// point to book
 	CDocument       *win = NULL;


Commit: 78b0bee9fc71357bfa6069b749c1e78467ce6a37
    https://github.com/scummvm/scummvm/commit/78b0bee9fc71357bfa6069b749c1e78467ce6a37
Author: a/ (yuri.kgpps at gmail.com)
Date: 2021-07-29T16:59:01+09:00

Commit Message:
SAGA2: Fix pointer arrow in documents

Changed paths:
    engines/saga2/mouseimg.cpp


diff --git a/engines/saga2/mouseimg.cpp b/engines/saga2/mouseimg.cpp
index 531ec2da0a..260b84e164 100644
--- a/engines/saga2/mouseimg.cpp
+++ b/engines/saga2/mouseimg.cpp
@@ -148,12 +148,16 @@ void freeCursors() {
 	delete combinedImage;
 }
 
-void createStackedImage(gPixelMap *newImage, int *newImageCenter, gPixelMap **imageArray, int *imageCenterArray, int images) {
+void createStackedImage(gPixelMap **newImage, int *newImageCenter, gPixelMap **imageArray, int *imageCenterArray, int images) {
 	assert(images != 0);
-	assert(newImage->data == nullptr);
 
-	newImage->size.x = 0;
-	newImage->size.y = 0;
+	if (*newImage)
+		delete *newImage;
+
+	*newImage = new gPixelMap;
+
+	(*newImage)->size.x = 0;
+	(*newImage)->size.y = 0;
 	*newImageCenter = 0;
 
 	for (int i = 0; i < images; i++) {
@@ -164,27 +168,27 @@ void createStackedImage(gPixelMap *newImage, int *newImageCenter, gPixelMap **im
 	for (int i = 0; i < images; i++) {
 		int16  rightImageBoundary;
 
-		newImage->size.y += imageArray[i]->size.y;
+		(*newImage)->size.y += imageArray[i]->size.y;
 
 		rightImageBoundary = *newImageCenter + (imageArray[i]->size.x - imageCenterArray[i]);
 
-		if (rightImageBoundary > newImage->size.x)
-			newImage->size.x = rightImageBoundary;
+		if (rightImageBoundary > (*newImage)->size.x)
+			(*newImage)->size.x = rightImageBoundary;
 	}
 
-	newImage->size.y += images - 1;
+	(*newImage)->size.y += images - 1;
 
-	int newImageBytes = newImage->bytes();
+	int newImageBytes = (*newImage)->bytes();
 
-	newImage->data = (uint8 *)malloc(newImageBytes) ;
+	(*newImage)->data = (uint8 *)malloc(newImageBytes) ;
 
-	memset(newImage->data, 0, newImageBytes);
+	memset((*newImage)->data, 0, newImageBytes);
 
 	int newImageRow = 0;
 	for (int i = 0; i < images; i++) {
 		gPixelMap *currentImage = imageArray[i];
 
-		TBlit(newImage, currentImage, *newImageCenter - imageCenterArray[i], newImageRow);
+		TBlit((*newImage), currentImage, *newImageCenter - imageCenterArray[i], newImageRow);
 
 		newImageRow += currentImage->size.y + 1;
 	}
@@ -193,11 +197,14 @@ void createStackedImage(gPixelMap *newImage, int *newImageCenter, gPixelMap **im
 //-----------------------------------------------------------------------
 //	Dispose of an image created with createStackedImage
 
-inline void disposeStackedImage(gPixelMap *image) {
-	assert(image->data != nullptr);
+inline void disposeStackedImage(gPixelMap **image) {
+	if (*image) {
+		free((*image)->data);
+		(*image)->data = nullptr;
 
-	free(image->data);
-	image->data = nullptr;
+		delete *image;
+		*image = nullptr;
+	}
 }
 
 //-----------------------------------------------------------------------
@@ -207,7 +214,7 @@ inline void disposeStackedImage(gPixelMap *image) {
 
 void cleanupMousePointer(void) {
 	if (combinedImage->data != nullptr)
-		disposeStackedImage(combinedImage);
+		disposeStackedImage(&combinedImage);
 }
 
 void setupMousePointer(void) {
@@ -233,9 +240,9 @@ void setupMousePointer(void) {
 	}
 
 	if (combinedImage->data != nullptr)
-		disposeStackedImage(combinedImage);
+		disposeStackedImage(&combinedImage);
 
-	createStackedImage(combinedImage, &combinedImageCenter, imageArray, imageCenterArray, imageIndex);
+	createStackedImage(&combinedImage, &combinedImageCenter, imageArray, imageCenterArray, imageIndex);
 
 	imageOffset.x = combinedImageCenter - mouseImage->size.x / 2;
 	imageOffset.y = 0;




More information about the Scummvm-git-logs mailing list