[Scummvm-cvs-logs] scummvm master -> 252e7a1ec323fc6cccb91dbdcae92db7efd851a6

fingolfin max at quendi.de
Mon May 23 13:07:09 CEST 2011


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

Summary:
e7c642b010 AUDIO: Explicitly instantiate & name RandomSource used by MAME OPL
90d3fc9f5b GRAPHICS: Rename some members of NewFont
0bca049ce8 TEEN: Change Inventory members to comple with CFG
808221a36f TSAGE: Remove redundant semicolons
d25363c675 BASE: Sync COPYING with latest version of the GPL 2.1 text
252e7a1ec3 SWORD25: Fix ambiguous typing


Commit: e7c642b010c47d2520d21ea5b3c041d861bc1532
    https://github.com/scummvm/scummvm/commit/e7c642b010c47d2520d21ea5b3c041d861bc1532
Author: Max Horn (max at quendi.de)
Date: 2011-05-23T03:13:01-07:00

Commit Message:
AUDIO: Explicitly instantiate & name RandomSource used by MAME OPL

Changed paths:
    audio/fmopl.h
    audio/softsynth/opl/mame.cpp
    audio/softsynth/opl/mame.h



diff --git a/audio/fmopl.h b/audio/fmopl.h
index fbce36f..b88325a 100644
--- a/audio/fmopl.h
+++ b/audio/fmopl.h
@@ -23,7 +23,10 @@
 #define SOUND_FMOPL_H
 
 #include "common/scummsys.h"
-#include "common/str.h"
+
+namespace Common {
+class String;
+}
 
 namespace OPL {
 
diff --git a/audio/softsynth/opl/mame.cpp b/audio/softsynth/opl/mame.cpp
index b380a15..9cc3597 100644
--- a/audio/softsynth/opl/mame.cpp
+++ b/audio/softsynth/opl/mame.cpp
@@ -546,7 +546,7 @@ inline void OPL_CALC_RH(FM_OPL *OPL, OPL_CH *CH) {
 	// but EG_STEP = 96.0/EG_ENT, and WHITE_NOISE_db=6.0. So, that's equivalent to
 	// int(OPL->rnd.getRandomBit() * EG_ENT/16). We know that EG_ENT is 4096, or 1024,
 	// or 128, so we can safely avoid any FP ops.
-	int whitenoise = OPL->rnd.getRandomBit() * (EG_ENT>>4);
+	int whitenoise = OPL->rnd->getRandomBit() * (EG_ENT>>4);
 
 	int tone8;
 
@@ -1126,6 +1126,15 @@ FM_OPL *OPLCreate(int type, int clock, int rate) {
 	OPL->rate  = rate;
 	OPL->max_ch = max_ch;
 
+	// Init the random source. Note: We use a fixed name for it here.
+	// So if multiple FM_OPL objects exist in parallel, then their
+	// random sources will have an equal name. At least in the
+	// current EventRecorder implementation, this causes no problems;
+	// but this is probably not guaranteed.
+	// Alas, it does not seem worthwhile to bother much with this
+	// at the time, so I am leaving it as it is.
+	OPL->rnd = new Common::RandomSource("mame");
+
 	/* init grobal tables */
 	OPL_initalize(OPL);
 
@@ -1134,9 +1143,10 @@ FM_OPL *OPLCreate(int type, int clock, int rate) {
 	return OPL;
 }
 
-/* ----------  Destroy one of vietual YM3812 ----------       */
+/* ----------  Destroy one of virtual YM3812 ----------       */
 void OPLDestroy(FM_OPL *OPL) {
 	OPL_UnLockTable();
+	delete OPL->rnd;
 	free(OPL);
 }
 
diff --git a/audio/softsynth/opl/mame.h b/audio/softsynth/opl/mame.h
index 4c40949..803ca89 100644
--- a/audio/softsynth/opl/mame.h
+++ b/audio/softsynth/opl/mame.h
@@ -147,7 +147,7 @@ typedef struct fm_opl_f {
 	OPL_UPDATEHANDLER UpdateHandler;	/* stream update handler   */
 	int UpdateParam;					/* stream update parameter */
 
-	Common::RandomSource rnd;
+	Common::RandomSource *rnd;
 } FM_OPL;
 
 /* ---------- Generic interface section ---------- */


Commit: 90d3fc9f5be7bdfc789c9739db017e9e464e3943
    https://github.com/scummvm/scummvm/commit/90d3fc9f5be7bdfc789c9739db017e9e464e3943
Author: Max Horn (max at quendi.de)
Date: 2011-05-23T03:13:02-07:00

Commit Message:
GRAPHICS: Rename some members of NewFont

Changed paths:
    graphics/font.cpp
    graphics/font.h



diff --git a/graphics/font.cpp b/graphics/font.cpp
index 5f5a9b2..cdf9090 100644
--- a/graphics/font.cpp
+++ b/graphics/font.cpp
@@ -30,23 +30,23 @@
 
 namespace Graphics {
 
-void free_font(NewFontData* pf);
+void free_font(NewFontData *pf);
 
 NewFont::~NewFont() {
-	if (font) {
-		free_font(font);
+	if (_font) {
+		free_font(_font);
 	}
 }
 
 int NewFont::getCharWidth(byte chr) const {
 	// If no width table is specified, return the maximum width
-	if (!desc.width)
-		return desc.maxwidth;
+	if (!_desc.width)
+		return _desc.maxwidth;
 	// If this character is not included in the font, use the default char.
-	if (chr < desc.firstchar || desc.firstchar + desc.size < chr) {
-		chr = desc.defaultchar;
+	if (chr < _desc.firstchar || _desc.firstchar + _desc.size < chr) {
+		chr = _desc.defaultchar;
 	}
-	return desc.width[chr - desc.firstchar];
+	return _desc.width[chr - _desc.firstchar];
 }
 
 
@@ -74,38 +74,38 @@ void drawCharIntern(byte *ptr, uint pitch, const bitmap_t *src, int h, int minX,
 void NewFont::drawChar(Surface *dst, byte chr, const int tx, const int ty, const uint32 color) const {
 	assert(dst != 0);
 
-	assert(desc.bits != 0 && desc.maxwidth <= 16);
+	assert(_desc.bits != 0 && _desc.maxwidth <= 16);
 	assert(dst->format.bytesPerPixel == 1 || dst->format.bytesPerPixel == 2);
 
 	// If this character is not included in the font, use the default char.
-	if (chr < desc.firstchar || chr >= desc.firstchar + desc.size) {
-		chr = desc.defaultchar;
+	if (chr < _desc.firstchar || chr >= _desc.firstchar + _desc.size) {
+		chr = _desc.defaultchar;
 	}
 
-	chr -= desc.firstchar;
+	chr -= _desc.firstchar;
 
 	int bbw, bbh, bbx, bby;
 
 	// Get the bounding box of the character
-	if (!desc.bbx) {
-		bbw = desc.fbbw;
-		bbh = desc.fbbh;
-		bbx = desc.fbbx;
-		bby = desc.fbby;
+	if (!_desc.bbx) {
+		bbw = _desc.fbbw;
+		bbh = _desc.fbbh;
+		bbx = _desc.fbbx;
+		bby = _desc.fbby;
 	} else {
-		bbw = desc.bbx[chr].w;
-		bbh = desc.bbx[chr].h;
-		bbx = desc.bbx[chr].x;
-		bby = desc.bbx[chr].y;
+		bbw = _desc.bbx[chr].w;
+		bbh = _desc.bbx[chr].h;
+		bbx = _desc.bbx[chr].x;
+		bby = _desc.bbx[chr].y;
 	}
 
-	byte *ptr = (byte *)dst->getBasePtr(tx + bbx, ty + desc.ascent - bby - bbh);
+	byte *ptr = (byte *)dst->getBasePtr(tx + bbx, ty + _desc.ascent - bby - bbh);
 
-	const bitmap_t *tmp = desc.bits + (desc.offset ? desc.offset[chr] : (chr * desc.fbbh));
+	const bitmap_t *tmp = _desc.bits + (_desc.offset ? _desc.offset[chr] : (chr * _desc.fbbh));
 
-	int y = MIN(bbh, ty + desc.ascent - bby);
+	int y = MIN(bbh, ty + _desc.ascent - bby);
 	tmp += bbh - y;
-	y -= MAX(0, ty + desc.ascent - bby - dst->h);
+	y -= MAX(0, ty + _desc.ascent - bby - dst->h);
 
 	if (dst->format.bytesPerPixel == 1)
 		drawCharIntern<byte>(ptr, dst->pitch, tmp, y, MAX(0, -(tx + bbx)), MIN(bbw, dst->w - tx - bbx), color);
@@ -615,47 +615,47 @@ bool NewFont::cacheFontData(const NewFont &font, const Common::String &filename)
 		return false;
 	}
 
-	cacheFile.writeUint16BE(font.desc.maxwidth);
-	cacheFile.writeUint16BE(font.desc.height);
-	cacheFile.writeUint16BE(font.desc.fbbw);
-	cacheFile.writeUint16BE(font.desc.fbbh);
-	cacheFile.writeSint16BE(font.desc.fbbx);
-	cacheFile.writeSint16BE(font.desc.fbby);
-	cacheFile.writeUint16BE(font.desc.ascent);
-	cacheFile.writeUint16BE(font.desc.firstchar);
-	cacheFile.writeUint16BE(font.desc.size);
-	cacheFile.writeUint16BE(font.desc.defaultchar);
-	cacheFile.writeUint32BE(font.desc.bits_size);
+	cacheFile.writeUint16BE(font._desc.maxwidth);
+	cacheFile.writeUint16BE(font._desc.height);
+	cacheFile.writeUint16BE(font._desc.fbbw);
+	cacheFile.writeUint16BE(font._desc.fbbh);
+	cacheFile.writeSint16BE(font._desc.fbbx);
+	cacheFile.writeSint16BE(font._desc.fbby);
+	cacheFile.writeUint16BE(font._desc.ascent);
+	cacheFile.writeUint16BE(font._desc.firstchar);
+	cacheFile.writeUint16BE(font._desc.size);
+	cacheFile.writeUint16BE(font._desc.defaultchar);
+	cacheFile.writeUint32BE(font._desc.bits_size);
 
-	for (long i = 0; i < font.desc.bits_size; ++i) {
-		cacheFile.writeUint16BE(font.desc.bits[i]);
+	for (long i = 0; i < font._desc.bits_size; ++i) {
+		cacheFile.writeUint16BE(font._desc.bits[i]);
 	}
 
-	if (font.desc.offset) {
+	if (font._desc.offset) {
 		cacheFile.writeByte(1);
-		for (int i = 0; i < font.desc.size; ++i) {
-			cacheFile.writeUint32BE(font.desc.offset[i]);
+		for (int i = 0; i < font._desc.size; ++i) {
+			cacheFile.writeUint32BE(font._desc.offset[i]);
 		}
 	} else {
 		cacheFile.writeByte(0);
 	}
 
-	if (font.desc.width) {
+	if (font._desc.width) {
 		cacheFile.writeByte(1);
-		for (int i = 0; i < font.desc.size; ++i) {
-			cacheFile.writeByte(font.desc.width[i]);
+		for (int i = 0; i < font._desc.size; ++i) {
+			cacheFile.writeByte(font._desc.width[i]);
 		}
 	} else {
 		cacheFile.writeByte(0);
 	}
 
-	if (font.desc.bbx) {
+	if (font._desc.bbx) {
 		cacheFile.writeByte(1);
-		for (int i = 0; i < font.desc.size; ++i) {
-			cacheFile.writeByte(font.desc.bbx[i].w);
-			cacheFile.writeByte(font.desc.bbx[i].h);
-			cacheFile.writeByte(font.desc.bbx[i].x);
-			cacheFile.writeByte(font.desc.bbx[i].y);
+		for (int i = 0; i < font._desc.size; ++i) {
+			cacheFile.writeByte(font._desc.bbx[i].w);
+			cacheFile.writeByte(font._desc.bbx[i].h);
+			cacheFile.writeByte(font._desc.bbx[i].x);
+			cacheFile.writeByte(font._desc.bbx[i].y);
 		}
 	} else {
 		cacheFile.writeByte(0);
diff --git a/graphics/font.h b/graphics/font.h
index f68f491..7a99267 100644
--- a/graphics/font.h
+++ b/graphics/font.h
@@ -157,15 +157,15 @@ struct NewFontData;
 
 class NewFont : public Font {
 protected:
-	FontDesc desc;
-	NewFontData *font;
+	FontDesc _desc;
+	NewFontData *_font;
 
 public:
-	NewFont(const FontDesc &d, NewFontData *font_ = 0) : desc(d), font(font_) {}
+	NewFont(const FontDesc &desc, NewFontData *font = 0) : _desc(desc), _font(font) {}
 	~NewFont();
 
-	virtual int getFontHeight() const { return desc.height; }
-	virtual int getMaxCharWidth() const { return desc.maxwidth; }
+	virtual int getFontHeight() const { return _desc.height; }
+	virtual int getMaxCharWidth() const { return _desc.maxwidth; }
 
 	virtual int getCharWidth(byte chr) const;
 	virtual void drawChar(Surface *dst, byte chr, int x, int y, uint32 color) const;


Commit: 0bca049ce84cf3f1285cd6da580b547afd3cb686
    https://github.com/scummvm/scummvm/commit/0bca049ce84cf3f1285cd6da580b547afd3cb686
Author: Max Horn (max at quendi.de)
Date: 2011-05-23T03:13:02-07:00

Commit Message:
TEEN: Change Inventory members to comple with CFG

Changed paths:
    engines/teenagent/inventory.cpp
    engines/teenagent/inventory.h



diff --git a/engines/teenagent/inventory.cpp b/engines/teenagent/inventory.cpp
index 0f9766d..8430f42 100644
--- a/engines/teenagent/inventory.cpp
+++ b/engines/teenagent/inventory.cpp
@@ -43,22 +43,22 @@ Inventory::Inventory(TeenAgentEngine *engine) {
 		if (!s)
 			error("no inventory background");
 		debug(0, "loading inventory background...");
-		background.load(s, Surface::kTypeOns);
+		_background.load(s, Surface::kTypeOns);
 	}
 
 	uint32 items_size = varia.getSize(4);
 	if (items_size == 0)
 		error("invalid inventory items size");
 	debug(0, "loading items, size: %u", items_size);
-	items = new byte[items_size];
-	varia.read(4, items, items_size);
+	_items = new byte[items_size];
+	varia.read(4, _items, items_size);
 
-	byte offsets = items[0];
+	byte offsets = _items[0];
 	assert(offsets == 92);
 	for (byte i = 0; i < offsets; ++i) {
-		offset[i] = READ_LE_UINT16(items + i * 2 + 1);
+		_offset[i] = READ_LE_UINT16(_items + i * 2 + 1);
 	}
-	offset[92] = items_size; 
+	_offset[92] = items_size; 
 
 	Resources *res = Resources::instance();
 	for (byte i = 0; i <= 92; ++i) {
@@ -66,31 +66,31 @@ Inventory::Inventory(TeenAgentEngine *engine) {
 		uint16 obj_addr = res->dseg.get_word(0xc4a4 + i * 2);
 		if (obj_addr != 0)
 			io.load(res->dseg.ptr(obj_addr));
-		objects.push_back(io);
+		_objects.push_back(io);
 	}
 
-	inventory = res->dseg.ptr(0xc48d);
+	_inventory = res->dseg.ptr(0xc48d);
 
 	for (int y = 0; y < 4; ++y)
 		for (int x = 0; x < 6; ++x) {
 			int i = y * 6 + x;
-			graphics[i].rect.left = 28 + 45 * x - 1;
-			graphics[i].rect.top = 23 + 31 * y - 1;
-			graphics[i].rect.right = graphics[i].rect.left + 40;
-			graphics[i].rect.bottom = graphics[i].rect.top + 26;
+			_graphics[i]._rect.left = 28 + 45 * x - 1;
+			_graphics[i]._rect.top = 23 + 31 * y - 1;
+			_graphics[i]._rect.right = _graphics[i]._rect.left + 40;
+			_graphics[i]._rect.bottom = _graphics[i]._rect.top + 26;
 		}
 
 	varia.close();
-	hovered_obj = selected_obj = NULL;
+	_hoveredObj = _selectedObj = NULL;
 }
 
 Inventory::~Inventory() {
-	delete[] items;
+	delete[] _items;
 }
 
 bool Inventory::has(byte item) const {
 	for (int i = 0; i < 24; ++i) {
-		if (inventory[i] == item)
+		if (_inventory[i] == item)
 			return true;
 	}
 	return false;
@@ -100,32 +100,32 @@ void Inventory::remove(byte item) {
 	debug(0, "removing %u from inventory", item);
 	int i;
 	for (i = 0; i < 24; ++i) {
-		if (inventory[i] == item) {
+		if (_inventory[i] == item) {
 			break;
 		}
 	}
 	for (; i < 23; ++i) {
-		inventory[i] = inventory[i + 1];
-		graphics[i].free();
+		_inventory[i] = _inventory[i + 1];
+		_graphics[i].free();
 	}
-	inventory[23] = 0;
-	graphics[23].free();
+	_inventory[23] = 0;
+	_graphics[23].free();
 }
 
 void Inventory::clear() {
 	debug(0, "clearing inventory");
 	for (int i = 0; i < 24; ++i) {
-		inventory[i] = 0;
-		graphics[i].free();
+		_inventory[i] = 0;
+		_graphics[i].free();
 	}
 }
 
 void Inventory::reload() {
 	for (int i = 0; i < 24; ++i) {
-		graphics[i].free();
-		uint item = inventory[i];
+		_graphics[i].free();
+		uint item = _inventory[i];
 		if (item != 0)
-			graphics[i].load(this, item);
+			_graphics[i].load(this, item);
 	}
 }
 
@@ -134,8 +134,8 @@ void Inventory::add(byte item) {
 		return;
 	debug(0, "adding %u to inventory", item);
 	for (int i = 0; i < 24; ++i) {
-		if (inventory[i] == 0) {
-			inventory[i] = item;
+		if (_inventory[i] == 0) {
+			_inventory[i] = item;
 			return;
 		}
 	}
@@ -165,27 +165,27 @@ bool Inventory::processEvent(const Common::Event &event) {
 		if (!_active) {
 			if (event.mouse.y < 5)
 				activate(true);
-			mouse = event.mouse;
+			_mouse = event.mouse;
 			return false;
 		}
 
-		if (event.mouse.x < 17 || event.mouse.x >= 303 || (event.mouse.y - mouse.y > 0 && event.mouse.y >= 153)) {
+		if (event.mouse.x < 17 || event.mouse.x >= 303 || (event.mouse.y - _mouse.y > 0 && event.mouse.y >= 153)) {
 			activate(false);
-			mouse = event.mouse;
+			_mouse = event.mouse;
 			return false;
 		}
 
-		mouse = event.mouse;
-		hovered_obj = NULL;
+		_mouse = event.mouse;
+		_hoveredObj = NULL;
 
 		for (int i = 0; i < 24; ++i) {
-			byte item = inventory[i];
+			byte item = _inventory[i];
 			if (item == 0)
 				continue;
 
-			graphics[i].hovered = graphics[i].rect.in(mouse);
-			if (graphics[i].hovered)
-				hovered_obj = &objects[item];
+			_graphics[i]._hovered = _graphics[i]._rect.in(_mouse);
+			if (_graphics[i]._hovered)
+				_hoveredObj = &_objects[item];
 		}
 		return true;
 
@@ -194,22 +194,22 @@ bool Inventory::processEvent(const Common::Event &event) {
 		if (!_active)
 			return false;
 
-		if (hovered_obj == NULL)
+		if (_hoveredObj == NULL)
 			return true;
 
-		debug(0, "lclick on %u:%s", hovered_obj->id, hovered_obj->name.c_str());
+		debug(0, "lclick on %u:%s", _hoveredObj->id, _hoveredObj->name.c_str());
 
-		if (selected_obj == NULL) {
-			if (tryObjectCallback(hovered_obj))
+		if (_selectedObj == NULL) {
+			if (tryObjectCallback(_hoveredObj))
 				return true;
 			//activate(false);
-			int w = res->font7.render(NULL, 0, 0, hovered_obj->description, 0xd1);
-			_engine->scene->displayMessage(hovered_obj->description, 0xd1, Common::Point((320 - w) / 2, 162));
+			int w = res->font7.render(NULL, 0, 0, _hoveredObj->description, 0xd1);
+			_engine->scene->displayMessage(_hoveredObj->description, 0xd1, Common::Point((320 - w) / 2, 162));
 			return true;
 		}
 
-		int id1 = selected_obj->id;
-		int id2 = hovered_obj->id;
+		int id1 = _selectedObj->id;
+		int id2 = _hoveredObj->id;
 		if (id1 == id2)
 			return true;
 
@@ -246,15 +246,15 @@ bool Inventory::processEvent(const Common::Event &event) {
 		if (!_active)
 			return false;
 
-		if (hovered_obj != NULL) {
-			debug(0, "rclick object %u:%s", hovered_obj->id, hovered_obj->name.c_str());
-			if (hovered_obj->id != 51 && tryObjectCallback(hovered_obj)) //do not process callback for banknote on r-click
+		if (_hoveredObj != NULL) {
+			debug(0, "rclick object %u:%s", _hoveredObj->id, _hoveredObj->name.c_str());
+			if (_hoveredObj->id != 51 && tryObjectCallback(_hoveredObj)) //do not process callback for banknote on r-click
 				return true;
 		}
 
-		selected_obj = hovered_obj;
-		if (selected_obj)
-			debug(0, "selected object %s", selected_obj->name.c_str());
+		_selectedObj = _hoveredObj;
+		if (_selectedObj)
+			debug(0, "selected object %s", _selectedObj->name.c_str());
 		return true;
 
 	case Common::EVENT_KEYDOWN:
@@ -279,13 +279,13 @@ bool Inventory::processEvent(const Common::Event &event) {
 
 
 void Inventory::Item::free() {
-	animation.free();
-	surface.free();
+	_animation.free();
+	_surface.free();
 }
 
 void Inventory::Item::backgroundEffect(Graphics::Surface *s) {
-	uint w = rect.right - rect.left, h = rect.bottom - rect.top;
-	byte *line = (byte *)s->getBasePtr(rect.left, rect.top);
+	uint w = _rect.right - _rect.left, h = _rect.bottom - _rect.top;
+	byte *line = (byte *)s->getBasePtr(_rect.left, _rect.top);
 	for(uint y = 0; y < h; ++y, line += s->pitch) {
 		byte *dst = line;
 		for(uint x = 0; x < w; ++x, ++dst) {
@@ -295,54 +295,54 @@ void Inventory::Item::backgroundEffect(Graphics::Surface *s) {
 }
 
 void Inventory::Item::load(Inventory *inventory, uint item_id) {
-	InventoryObject *obj = &inventory->objects[item_id];
+	InventoryObject *obj = &inventory->_objects[item_id];
 	if (obj->animated) {
-		if (animation.empty()) {
-			debug(0, "loading item %d from offset %x", obj->id, inventory->offset[obj->id - 1]);
-			Common::MemoryReadStream s(inventory->items + inventory->offset[obj->id - 1], inventory->offset[obj->id] - inventory->offset[obj->id - 1]);
-			animation.load(&s, Animation::kTypeInventory);
+		if (_animation.empty()) {
+			debug(0, "loading item %d from offset %x", obj->id, inventory->_offset[obj->id - 1]);
+			Common::MemoryReadStream s(inventory->_items + inventory->_offset[obj->id - 1], inventory->_offset[obj->id] - inventory->_offset[obj->id - 1]);
+			_animation.load(&s, Animation::kTypeInventory);
 		}
 	} else {
-		if (surface.empty()) {
-			debug(0, "loading item %d from offset %x", obj->id, inventory->offset[obj->id - 1]);
-			Common::MemoryReadStream s(inventory->items + inventory->offset[obj->id - 1], inventory->offset[obj->id] - inventory->offset[obj->id - 1]);
-			surface.load(&s, Surface::kTypeOns);
+		if (_surface.empty()) {
+			debug(0, "loading item %d from offset %x", obj->id, inventory->_offset[obj->id - 1]);
+			Common::MemoryReadStream s(inventory->_items + inventory->_offset[obj->id - 1], inventory->_offset[obj->id] - inventory->_offset[obj->id - 1]);
+			_surface.load(&s, Surface::kTypeOns);
 		}
 	}
 }
 
 void Inventory::Item::render(Inventory *inventory, uint item_id, Graphics::Surface *dst, int delta) {
-	InventoryObject *obj = &inventory->objects[item_id];
+	InventoryObject *obj = &inventory->_objects[item_id];
 	Resources *res = Resources::instance();
 
 	backgroundEffect(dst);
-	rect.render(dst, hovered ? 233 : 234);
+	_rect.render(dst, _hovered ? 233 : 234);
 	load(inventory, item_id);
 	if (obj->animated) {
-		if (hovered) {
-			Surface *s = animation.currentFrame(delta);
-			if (animation.currentIndex() == 0)
-				s = animation.currentFrame(1); //force index to be 1 here
+		if (_hovered) {
+			Surface *s = _animation.currentFrame(delta);
+			if (_animation.currentIndex() == 0)
+				s = _animation.currentFrame(1); //force index to be 1 here
 			if (s != NULL)
-				s->render(dst, rect.left + 1, rect.top + 1);
+				s->render(dst, _rect.left + 1, _rect.top + 1);
 		} else {
-			Surface *s = animation.firstFrame();
+			Surface *s = _animation.firstFrame();
 			if (s != NULL)
-				s->render(dst, rect.left + 1, rect.top + 1);
+				s->render(dst, _rect.left + 1, _rect.top + 1);
 		}
 	} else {
-		surface.render(dst, rect.left + 1, rect.top + 1);
+		_surface.render(dst, _rect.left + 1, _rect.top + 1);
 	}
 
 	Common::String name;
-	if (inventory->selected_obj) {
-		name = inventory->selected_obj->name;
+	if (inventory->_selectedObj) {
+		name = inventory->_selectedObj->name;
 		name += " & ";
 	}
-	if (inventory->selected_obj != inventory->hovered_obj)
+	if (inventory->_selectedObj != inventory->_hoveredObj)
 		name += obj->name;
 
-	if (hovered && inventory->_engine->scene->getMessage().empty()) {
+	if (_hovered && inventory->_engine->scene->getMessage().empty()) {
 		int w = res->font7.render(NULL, 0, 0, name, 0xd1, true);
 		res->font7.render(dst, (320 - w) / 2, 180, name, 0xd1, true);
 	}
@@ -352,17 +352,17 @@ void Inventory::render(Graphics::Surface *surface, int delta) {
 	if (!_active)
 		return;
 
-	background.render(surface);
+	_background.render(surface);
 
 	for (int y = 0; y < 4; y++) {
 		for (int x = 0; x < 6; x++) {
 			int idx = x + 6 * y;
-			byte item = inventory[idx];
+			byte item = _inventory[idx];
 			if (item == 0)
 				continue;
 
 			//debug(0, "%d,%d -> %u", x0, y0, item);
-			graphics[idx].render(this, item, surface, delta);
+			_graphics[idx].render(this, item, surface, delta);
 		}
 	}
 }
diff --git a/engines/teenagent/inventory.h b/engines/teenagent/inventory.h
index 23a2e8d..55c58a1 100644
--- a/engines/teenagent/inventory.h
+++ b/engines/teenagent/inventory.h
@@ -51,37 +51,40 @@ public:
 
 	bool processEvent(const Common::Event &event);
 
-	InventoryObject *selectedObject() { return selected_obj; }
-	void resetSelectedObject() { selected_obj = NULL; }
+	InventoryObject *selectedObject() { return _selectedObj; }
+	void resetSelectedObject() { _selectedObj = NULL; }
 
 private:
 	TeenAgentEngine *_engine;
-	Surface background;
-	byte *items;
-	uint offset[93];
+	Surface _background;
+	byte *_items;
+	uint _offset[93];
+
+	Common::Array<InventoryObject> _objects;
+	byte *_inventory;
 
-	Common::Array<InventoryObject> objects;
-	byte *inventory;
 	struct Item {
-		Animation animation;
-		Surface surface;
-		Rect rect;
-		bool hovered;
+		Animation _animation;
+		Surface _surface;
+		Rect _rect;
+		bool _hovered;
 
-		Item() : hovered(false) {}
+		Item() : _hovered(false) {}
 		void free();
 		void load(Inventory *inventory, uint item_id);
 		void backgroundEffect(Graphics::Surface *s);
 		void render(Inventory *inventory, uint item_id, Graphics::Surface *surface, int delta);
-	} graphics[24];
+	};
+	
+	Item _graphics[24];
 
 	bool _active;
-	Common::Point mouse;
-	int hovered;
+	Common::Point _mouse;
 	
 	bool tryObjectCallback(InventoryObject *obj);
 
-	InventoryObject *hovered_obj, *selected_obj;
+	InventoryObject *_hoveredObj;
+	InventoryObject *_selectedObj;
 };
 
 } // End of namespace TeenAgent


Commit: 808221a36fd8a3eff2172174e8998a9e068629c9
    https://github.com/scummvm/scummvm/commit/808221a36fd8a3eff2172174e8998a9e068629c9
Author: Max Horn (max at quendi.de)
Date: 2011-05-23T03:13:02-07:00

Commit Message:
TSAGE: Remove redundant semicolons

Changed paths:
    engines/tsage/graphics.h



diff --git a/engines/tsage/graphics.h b/engines/tsage/graphics.h
index c90833a..b269520 100644
--- a/engines/tsage/graphics.h
+++ b/engines/tsage/graphics.h
@@ -40,8 +40,8 @@ class Region;
  */
 class Rect : public Common::Rect, public Serialisable {
 public:
-	Rect() : Common::Rect() {};
-	Rect(int16 x1, int16 y1, int16 x2, int16 y2) : Common::Rect(x1, y1, x2, y2) {};
+	Rect() : Common::Rect() {}
+	Rect(int16 x1, int16 y1, int16 x2, int16 y2) : Common::Rect(x1, y1, x2, y2) {}
 
 	void set(int16 x1, int16 y1, int16 x2, int16 y2);
 	void collapse(int dx, int dy);
@@ -60,7 +60,7 @@ public:
 	uint8 foreground;
 	uint8 background;
 
-	GfxColors() : foreground(0), background(0) {};
+	GfxColors() : foreground(0), background(0) {}
 };
 
 class LineSlice {
@@ -92,8 +92,8 @@ public:
 	Graphics::Surface lockSurface();
 	void unlockSurface();
 	void create(int width, int height);
-	void setBounds(const Rect &bounds) { _bounds = bounds; };
-	const Rect &getBounds() const { return _bounds; };
+	void setBounds(const Rect &bounds) { _bounds = bounds; }
+	const Rect &getBounds() const { return _bounds; }
 
 	void copyFrom(GfxSurface &src, Rect srcBounds, Rect destBounds, Region *priorityRegion = NULL);
 	void copyFrom(GfxSurface &src, Rect destBounds, Region *priorityRegion = NULL) {
@@ -187,8 +187,8 @@ public:
 	virtual void setDefaults();
 	virtual void remove() { _owner = NULL; }
 	virtual void highlight();
-	virtual void draw() {};
-	virtual bool process(Event &event) { return false; };
+	virtual void draw() {}
+	virtual bool process(Event &event) { return false; }
 	virtual bool focusedEvent(Event &event);
 };
 
@@ -229,7 +229,7 @@ private:
 public:
 	Common::String _message;
 public:
-	GfxButton() : GfxElement() {};
+	GfxButton() : GfxElement() {}
 	virtual ~GfxButton() {}
 
 	void setText(const Common::String &s) {
@@ -271,7 +271,7 @@ public:
 		_surface.setBounds(_bounds);
 		return _surface.lockSurface();
 	}
-	void unlockSurface() { _surface.unlockSurface(); };
+	void unlockSurface() { _surface.unlockSurface(); }
 	void fillArea(int xp, int yp, int color);
 	void fillRect(const Rect &bounds, int color);
 	void fillRect2(int xs, int ys, int width, int height, int color);


Commit: d25363c6758f4a6bc787621e75385e74a556c9e3
    https://github.com/scummvm/scummvm/commit/d25363c6758f4a6bc787621e75385e74a556c9e3
Author: Max Horn (max at quendi.de)
Date: 2011-05-23T04:04:51-07:00

Commit Message:
BASE: Sync COPYING with latest version of the GPL 2.1 text

Changed paths:
    COPYING



diff --git a/COPYING b/COPYING
index b6f92f3..75a1ad8 100644
--- a/COPYING
+++ b/COPYING
@@ -1,8 +1,8 @@
 		    GNU GENERAL PUBLIC LICENSE
 		       Version 2, June 1991
 
- Copyright (C) 1989, 1991 Free Software Foundation, Inc.
-                 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  Everyone is permitted to copy and distribute verbatim copies
  of this license document, but changing it is not allowed.
 
@@ -15,7 +15,7 @@ software--to make sure the software is free for all its users.  This
 General Public License applies to most of the Free Software
 Foundation's software and to any other program whose authors commit to
 using it.  (Some other Free Software Foundation software is covered by
-the GNU Library General Public License instead.)  You can apply it to
+the GNU Lesser General Public License instead.)  You can apply it to
 your programs, too.
 
   When we speak of free software, we are referring to freedom, not
@@ -303,10 +303,9 @@ the "copyright" line and a pointer to where the full notice is found.
     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     GNU General Public License for more details.
 
-    You should have received a copy of the GNU General Public License
-    along with this program; if not, write to the Free Software
-    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
-
+    You should have received a copy of the GNU General Public License along
+    with this program; if not, write to the Free Software Foundation, Inc.,
+    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 
 Also add information on how to contact you by electronic and paper mail.
 
@@ -336,5 +335,5 @@ necessary.  Here is a sample; alter the names:
 This General Public License does not permit incorporating your program into
 proprietary programs.  If your program is a subroutine library, you may
 consider it more useful to permit linking proprietary applications with the
-library.  If this is what you want to do, use the GNU Library General
-Public License instead of this License.
+library.  If this is what you want to do, use the GNU Lesser General
+Public License instead of this License.
\ No newline at end of file


Commit: 252e7a1ec323fc6cccb91dbdcae92db7efd851a6
    https://github.com/scummvm/scummvm/commit/252e7a1ec323fc6cccb91dbdcae92db7efd851a6
Author: Max Horn (max at quendi.de)
Date: 2011-05-23T04:05:35-07:00

Commit Message:
SWORD25: Fix ambiguous typing

Changed paths:
    engines/sword25/util/lua/scummvm_file.cpp



diff --git a/engines/sword25/util/lua/scummvm_file.cpp b/engines/sword25/util/lua/scummvm_file.cpp
index 98fc127..659f5a3 100644
--- a/engines/sword25/util/lua/scummvm_file.cpp
+++ b/engines/sword25/util/lua/scummvm_file.cpp
@@ -59,7 +59,7 @@ Sword25FileProxy::~Sword25FileProxy() {
 }
 
 size_t Sword25FileProxy::read(void *ptr, size_t size, size_t count) {
-	size_t bytesRead = MIN(_readData.size() - _readPos, size * count);
+	size_t bytesRead = MIN<size_t>(_readData.size() - _readPos, size * count);
 	memmove(ptr, &_readData.c_str()[_readPos], bytesRead);
 	_readPos += bytesRead;
 	return bytesRead / size;






More information about the Scummvm-git-logs mailing list