[Scummvm-cvs-logs] scummvm master -> aa74254f23d40893c16981209cee00057bec13c9

sev- sev at scummvm.org
Tue Nov 17 23:37:34 CET 2015


This automated email contains information about 3 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
4dc23ea289 SWORD25: Fix text rendering
5d0f38d747 GRAPHICS: Fix rendering in some corner cases
aa74254f23 SWORD25: Translate comments


Commit: 4dc23ea2893ad60c683e12a34c4667a5e14f5ccf
    https://github.com/scummvm/scummvm/commit/4dc23ea2893ad60c683e12a34c4667a5e14f5ccf
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2015-11-17T23:17:20+01:00

Commit Message:
SWORD25: Fix text rendering

Changed paths:
    engines/sword25/gfx/text.cpp



diff --git a/engines/sword25/gfx/text.cpp b/engines/sword25/gfx/text.cpp
index 904435f..54eb02f 100644
--- a/engines/sword25/gfx/text.cpp
+++ b/engines/sword25/gfx/text.cpp
@@ -99,7 +99,7 @@ void Text::setText(const Common::String &text) {
 }
 
 void Text::setColor(uint32 modulationColor) {
-	uint32 newModulationColor = (modulationColor & 0xffffff00) | (_modulationColor & 0x000000ff);
+	uint32 newModulationColor = (modulationColor & 0x00ffffff) | (_modulationColor & 0xff000000);
 	if (newModulationColor != _modulationColor) {
 		_modulationColor = newModulationColor;
 		forceRefresh();
@@ -108,7 +108,7 @@ void Text::setColor(uint32 modulationColor) {
 
 void Text::setAlpha(int alpha) {
 	assert(alpha >= 0 && alpha < 256);
-	uint32 newModulationColor = (_modulationColor & 0xffffff00) | alpha;
+	uint32 newModulationColor = (_modulationColor & 0xffffff) | (alpha << 24);
 	if (newModulationColor != _modulationColor) {
 		_modulationColor = newModulationColor;
 		forceRefresh();


Commit: 5d0f38d747e7583d0ca5959cd642468ba67cd04c
    https://github.com/scummvm/scummvm/commit/5d0f38d747e7583d0ca5959cd642468ba67cd04c
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2015-11-17T23:17:48+01:00

Commit Message:
GRAPHICS: Fix rendering in some corner cases

Changed paths:
    graphics/transparent_surface.cpp



diff --git a/graphics/transparent_surface.cpp b/graphics/transparent_surface.cpp
index f6e8cac..992a5dc 100644
--- a/graphics/transparent_surface.cpp
+++ b/graphics/transparent_surface.cpp
@@ -41,8 +41,6 @@
 
 namespace Graphics {
 
-static const int kAShift = 0;//img->format.aShift;
-
 static const int kBModShift = 0;//img->format.bShift;
 static const int kGModShift = 8;//img->format.gShift;
 static const int kRModShift = 16;//img->format.rShift;
@@ -118,7 +116,7 @@ void doBlitBinaryFast(byte *ino, byte *outo, uint32 width, uint32 height, uint32
 		in = ino;
 		for (uint32 j = 0; j < width; j++) {
 			uint32 pix = *(uint32 *)in;
-			int a = (pix >> kAShift) & 0xff;
+			int a = (pix >> kAModShift) & 0xff;
 
 			if (a != 0) {   // Full opacity (Any value not exactly 0 is Opaque here)
 				*(uint32 *)out = pix;
@@ -338,7 +336,7 @@ Common::Rect TransparentSurface::blit(Graphics::Surface &target, int posX, int p
 	retSize.setWidth(0);
 	retSize.setHeight(0);
 	// Check if we need to draw anything at all
-	int ca = (color >> 24) & 0xff;
+	int ca = (color >> kAModShift) & 0xff;
 
 	if (ca == 0) {
 		return retSize;


Commit: aa74254f23d40893c16981209cee00057bec13c9
    https://github.com/scummvm/scummvm/commit/aa74254f23d40893c16981209cee00057bec13c9
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2015-11-17T23:28:57+01:00

Commit Message:
SWORD25: Translate comments

Changed paths:
    engines/sword25/gfx/text.cpp



diff --git a/engines/sword25/gfx/text.cpp b/engines/sword25/gfx/text.cpp
index 54eb02f..d409c53 100644
--- a/engines/sword25/gfx/text.cpp
+++ b/engines/sword25/gfx/text.cpp
@@ -29,10 +29,6 @@
  *
  */
 
-// TODO:
-// Entweder Fontfile absolut abspeichern, oder Verzeichniswechseln verbieten
-// Eine relative Fontfile-Angabe könnte verwandt werden nachdem das Verzeichnis bereits gewechselt wurde und die Datei würde nicht mehr gefunden
-
 #include "sword25/kernel/kernel.h"
 #include "sword25/kernel/outputpersistenceblock.h"
 #include "sword25/kernel/inputpersistenceblock.h"
@@ -132,12 +128,12 @@ void Text::setAutoWrapThreshold(uint32 autoWrapThreshold) {
 }
 
 bool Text::doRender(RectangleList *updateRects) {
-	// Font-Resource locken.
+	// lock Font Resource
 	FontResource *fontPtr = lockFontResource();
 	if (!fontPtr)
 		return false;
 
-	// Charactermap-Resource locken.
+	// lock Character map resource
 	ResourceManager *rmPtr = getResourceManager();
 	BitmapResource *charMapPtr;
 	{
@@ -154,18 +150,18 @@ bool Text::doRender(RectangleList *updateRects) {
 		charMapPtr = static_cast<BitmapResource *>(pResource);
 	}
 
-	// Framebufferobjekt holen.
+	// Getting frame buffer object
 	GraphicEngine *gfxPtr = Kernel::getInstance()->getGfx();
 	assert(gfxPtr);
 
 	bool result = true;
 	Common::Array<Line>::iterator iter = _lines.begin();
 	for (; iter != _lines.end(); ++iter) {
-		// Feststellen, ob überhaupt Buchstaben der aktuellen Zeile vom Update betroffen sind.
+		// Determine whether any letters of the current line are affected by the update.
 		Common::Rect checkRect = (*iter).bbox;
 		checkRect.translate(_absoluteX, _absoluteY);
 
-		// Jeden Buchstaben einzeln Rendern.
+		// Render each letter individually.
 		int curX = _absoluteX + (*iter).bbox.left;
 		int curY = _absoluteY + (*iter).bbox.top;
 		for (uint i = 0; i < (*iter).text.size(); ++i) {
@@ -181,24 +177,24 @@ bool Text::doRender(RectangleList *updateRects) {
 		}
 	}
 
-	// Charactermap-Resource freigeben.
+	// Free Character map resource
 	charMapPtr->release();
 
-	// Font-Resource freigeben.
+	// Free Font resource
 	fontPtr->release();
 
 	return result;
 }
 
 ResourceManager *Text::getResourceManager() {
-	// Pointer auf den Resource-Manager holen.
+	// Getting pointer to resource manager
 	return Kernel::getInstance()->getResourceManager();
 }
 
 FontResource *Text::lockFontResource() {
 	ResourceManager *rmPtr = getResourceManager();
 
-	// Font-Resource locken.
+	// Lock font resource
 	FontResource *fontPtr;
 	{
 		Resource *resourcePtr = rmPtr->requestResource(_font);
@@ -278,7 +274,7 @@ void Text::updateFormat() {
 			i = lastSpace;
 		}
 
-		// Bounding-Box der einzelnen Zeilen relativ zur ersten festlegen (vor allem zentrieren).
+		// Bounding box of each line relative to the first set (center aligned).
 		_height = 0;
 		Common::Array<Line>::iterator iter = _lines.begin();
 		for (; iter != _lines.end(); ++iter) {
@@ -290,7 +286,7 @@ void Text::updateFormat() {
 			_height += bbox.height();
 		}
 	} else {
-		// Keine automatische Formatierung, also wird der gesamte Text in nur eine Zeile kopiert.
+		// No auto format, so all the text is copied to a single line.
 		_lines[0].text = _text;
 		_lines[0].bbox = Common::Rect(0, 0, _width, _height);
 	}
@@ -333,11 +329,11 @@ bool Text::unpersist(InputPersistenceBlock &reader) {
 
 	result &= RenderObject::unpersist(reader);
 
-	// Farbe und Alpha einlesen.
+	// Read color and alpha
 	reader.read(_modulationColor);
 
-	// Beim Laden der anderen Member werden die Set-Methoden benutzt statt der tatsächlichen Member.
-	// So wird das Layout automatisch aktualisiert und auch alle anderen notwendigen Methoden ausgeführt.
+	// Run all methods on loading relevant members.
+	// So, the layout is automatically updated and all necessary logic is executed.
 
 	Common::String font;
 	reader.readString(font);






More information about the Scummvm-git-logs mailing list