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

lordhoto lordhoto at gmail.com
Thu Aug 9 03:14:35 CEST 2012


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:
5521261fde OPENGL: Fix RGBA8888 mode setup.
b4196e48b1 GRAPHICS: Add a DPI parameter to loadTTFFont.


Commit: 5521261fdebb9388026457d7c2a92ad6abc149f1
    https://github.com/scummvm/scummvm/commit/5521261fdebb9388026457d7c2a92ad6abc149f1
Author: Johannes Schickel (lordhoto at scummvm.org)
Date: 2012-08-08T18:09:01-07:00

Commit Message:
OPENGL: Fix RGBA8888 mode setup.

Changed paths:
    backends/graphics/opengl/opengl-graphics.cpp



diff --git a/backends/graphics/opengl/opengl-graphics.cpp b/backends/graphics/opengl/opengl-graphics.cpp
index c99652d..48e2663 100644
--- a/backends/graphics/opengl/opengl-graphics.cpp
+++ b/backends/graphics/opengl/opengl-graphics.cpp
@@ -902,7 +902,7 @@ void OpenGLGraphicsManager::getGLPixelFormat(Graphics::PixelFormat pixelFormat,
 		bpp = 4;
 		intFormat = GL_RGBA;
 		glFormat = GL_RGBA;
-		gltype = GL_UNSIGNED_BYTE;
+		gltype = GL_UNSIGNED_INT_8_8_8_8;
 	} else if (pixelFormat == Graphics::PixelFormat(3, 8, 8, 8, 0, 16, 8, 0, 0)) { // RGB888
 		bpp = 3;
 		intFormat = GL_RGB;


Commit: b4196e48b16c458ef6564a051495525ff5a282f0
    https://github.com/scummvm/scummvm/commit/b4196e48b16c458ef6564a051495525ff5a282f0
Author: Johannes Schickel (lordhoto at scummvm.org)
Date: 2012-08-08T18:13:00-07:00

Commit Message:
GRAPHICS: Add a DPI parameter to loadTTFFont.

Will be used by WME.

Changed paths:
    graphics/fonts/ttf.cpp
    graphics/fonts/ttf.h
    gui/ThemeEngine.cpp



diff --git a/graphics/fonts/ttf.cpp b/graphics/fonts/ttf.cpp
index 96241e9..2b1dca1 100644
--- a/graphics/fonts/ttf.cpp
+++ b/graphics/fonts/ttf.cpp
@@ -101,7 +101,7 @@ public:
 	TTFFont();
 	virtual ~TTFFont();
 
-	bool load(Common::SeekableReadStream &stream, int size, bool monochrome, const uint32 *mapping);
+	bool load(Common::SeekableReadStream &stream, int size, uint dpi, bool monochrome, const uint32 *mapping);
 
 	virtual int getFontHeight() const;
 
@@ -157,7 +157,7 @@ TTFFont::~TTFFont() {
 	}
 }
 
-bool TTFFont::load(Common::SeekableReadStream &stream, int size, bool monochrome, const uint32 *mapping) {
+bool TTFFont::load(Common::SeekableReadStream &stream, int size, uint dpi, bool monochrome, const uint32 *mapping) {
 	if (!g_ttf.isInitialized())
 		return false;
 
@@ -195,7 +195,7 @@ bool TTFFont::load(Common::SeekableReadStream &stream, int size, bool monochrome
 	// Check whether we have kerning support
 	_hasKerning = (FT_HAS_KERNING(_face) != 0);
 
-	if (FT_Set_Char_Size(_face, 0, size * 64, 0, 0)) {
+	if (FT_Set_Char_Size(_face, 0, size * 64, dpi, dpi)) {
 		delete[] _ttfFile;
 		_ttfFile = 0;
 
@@ -462,10 +462,10 @@ bool TTFFont::cacheGlyph(Glyph &glyph, FT_UInt &slot, uint chr) {
 	return true;
 }
 
-Font *loadTTFFont(Common::SeekableReadStream &stream, int size, bool monochrome, const uint32 *mapping) {
+Font *loadTTFFont(Common::SeekableReadStream &stream, int size, uint dpi, bool monochrome, const uint32 *mapping) {
 	TTFFont *font = new TTFFont();
 
-	if (!font->load(stream, size, monochrome, mapping)) {
+	if (!font->load(stream, size, dpi, monochrome, mapping)) {
 		delete font;
 		return 0;
 	}
diff --git a/graphics/fonts/ttf.h b/graphics/fonts/ttf.h
index ec7dbe0..e1464b1 100644
--- a/graphics/fonts/ttf.h
+++ b/graphics/fonts/ttf.h
@@ -32,7 +32,7 @@
 namespace Graphics {
 
 class Font;
-Font *loadTTFFont(Common::SeekableReadStream &stream, int size, bool monochrome = false, const uint32 *mapping = 0);
+Font *loadTTFFont(Common::SeekableReadStream &stream, int size, uint dpi = 0, bool monochrome = false, const uint32 *mapping = 0);
 
 void shutdownTTF();
 
diff --git a/gui/ThemeEngine.cpp b/gui/ThemeEngine.cpp
index e37022f..2fff92c 100644
--- a/gui/ThemeEngine.cpp
+++ b/gui/ThemeEngine.cpp
@@ -1422,7 +1422,7 @@ const Graphics::Font *ThemeEngine::loadScalableFont(const Common::String &filena
 	for (Common::ArchiveMemberList::const_iterator i = members.begin(), end = members.end(); i != end; ++i) {
 		Common::SeekableReadStream *stream = (*i)->createReadStream();
 		if (stream) {
-			font = Graphics::loadTTFFont(*stream, pointsize, false,
+			font = Graphics::loadTTFFont(*stream, pointsize, 0, false,
 #ifdef USE_TRANSLATION
 			                             TransMan.getCharsetMapping()
 #else






More information about the Scummvm-git-logs mailing list