• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ ZonePtr类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中ZonePtr的典型用法代码示例。如果您正苦于以下问题:C++ ZonePtr类的具体用法?C++ ZonePtr怎么用?C++ ZonePtr使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了ZonePtr类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: parseGetData

void LocationParser_ns::parseGetData(ZonePtr z) {
	TypeData *data = &z->u;
	if (!scumm_stricmp(_tokens[0], "file")) {
		GfxObj *obj = _vm->_gfx->loadGet(_tokens[1]);
		obj->frame = 0;
		obj->x = z->getX();
		obj->y = z->getY();
		obj->_prog = _zoneProg;

		// WORKAROUND for script bug #2969913
		// The katana object has the same default z index (kGfxObjGetZ or -100)
		// as the cripta object (the safe) - a script bug.
		// Game scripts do not set an explicit z for the katana (as it isn't an
		// animation), but rather rely on the draw order to draw it over the
		// safe. In this particular case, the safe is added to the scene after
		// the katana, thus it is drawn over the katana. We explicitly set the
		// z index of the katana to be higher than the safe, so that the katana
		// is drawn correctly over it.
		// This is a regression from the graphics rewrite (commits be2c5d3,
		// 3c2c16c and 44906f5).
		if (!scumm_stricmp(obj->getName(), "katana"))
			obj->z = 0;

		bool visible = (z->_flags & kFlagsRemove) == 0;
		_vm->_gfx->showGfxObj(obj, visible);
		data->_gfxobj = obj;
	} else
	if (!scumm_stricmp(_tokens[0], "icon")) {
		data->_getIcon = 4 + _vm->_objectsNames->lookup(_tokens[1]);
	}
}
开发者ID:CatalystG,项目名称:scummvm,代码行数:31,代码来源:parser_ns.cpp


示例2: checkZoneBox

bool Parallaction::checkZoneBox(ZonePtr z, uint32 type, uint x, uint y) {
	if (z->_flags & kFlagsRemove)
		return false;

	debugC(5, kDebugExec, "checkZoneBox for %s (type = %x, x = %i, y = %i)", z->_name, type, x, y);

	if (!z->hitRect(x, y)) {
		// check for special zones (items defined in common.loc)
		if (checkSpecialZoneBox(z, type, x, y))
			return true;

		// check if self-use zone (nothing to do with kFlagsSelfuse)
		if (_gameType == GType_Nippon) {
			if (z->getX() != -1) {	// no explicit self-use flag in NS
				return false;
			}
		}
		if (_gameType == GType_BRA) {
			if (!(z->_flags & kFlagsYourself)) {
				return false;
			}
		}
		if (!_char._ani->hitFrameRect(x, y)) {
			return false;
		}
		// we get here only if (x,y) hits the character and the zone is marked as self-use
	}

	return checkZoneType(z, type);
}
开发者ID:AdamRi,项目名称:scummvm-pink,代码行数:30,代码来源:parallaction.cpp


示例3: parseDoorData

void LocationParser_br::parseDoorData(ZonePtr z) {
	TypeData *data = &z->u;
	if (!scumm_stricmp(_tokens[0], "slidetext")) {
		_vm->_location._slideText[0] = _tokens[1];
		_vm->_location._slideText[1] = _tokens[2];
	} else
	if (!scumm_stricmp(_tokens[0], "location")) {
		data->_doorLocation = _tokens[1];
	} else
	if (!scumm_stricmp(_tokens[0], "file")) {
		GfxObj *obj = _vm->_gfx->loadDoor(_tokens[1]);
		obj->frame = z->_flags & kFlagsClosed ? 0 : 1;
		obj->x = z->getX();
		obj->y = z->getY();
		_vm->_gfx->showGfxObj(obj, true);
		data->_gfxobj = obj;
	} else
	if (!scumm_stricmp(_tokens[0],	"startpos")) {
		data->_doorStartPos.x = atoi(_tokens[1]);
		data->_doorStartPos.y = atoi(_tokens[2]);
		data->_doorStartFrame = atoi(_tokens[3]);
	} else
	if (!scumm_stricmp(_tokens[0],	"startpos2")) {
		data->_doorStartPos2_br.x = atoi(_tokens[1]);
		data->_doorStartPos2_br.y = atoi(_tokens[2]);
		data->_doorStartFrame2_br = atoi(_tokens[3]);
	}
}
开发者ID:vladborovtsov,项目名称:scummvm,代码行数:28,代码来源:parser_br.cpp


示例4: DebugPrintf

bool Debugger::Cmd_Zones(int argc, const char **argv) {

	ZoneList::iterator b = _vm->_location._zones.begin();
	ZoneList::iterator e = _vm->_location._zones.end();
	Common::Rect r;

	DebugPrintf("+--------------------+---+---+---+---+--------+--------+\n"
				"| name               | l | t | r | b |  type  |  flag  |\n"
				"+--------------------+---+---+---+---+--------+--------+\n");
	for ( ; b != e; ++b) {
		ZonePtr z = *b;
		z->getRect(r);
		DebugPrintf("|%-20s|%3i|%3i|%3i|%3i|%8x|%8x|\n", z->_name, r.left, r.top, r.right, r.bottom, z->_type, z->_flags );
	}
	DebugPrintf("+--------------------+---+---+---+---+--------+--------+\n");


	return true;
}
开发者ID:St0rmcrow,项目名称:scummvm,代码行数:19,代码来源:debug.cpp


示例5: parseGetData

void LocationParser_br::parseGetData(ZonePtr z) {
	TypeData *data = &z->u;
	if (!scumm_stricmp(_tokens[0], "file")) {
		GfxObj *obj = _vm->_gfx->loadGet(_tokens[1]);
		obj->frame = 0;
		obj->x = z->getX();
		obj->y = z->getY();
		obj->_prog = _zoneProg;
		data->_gfxobj = obj;
	} else
	if (!scumm_stricmp(_tokens[0], "mask")) {
		_out->_info->loadGfxObjMask(_tokens[1], data->_gfxobj);
	} else
	if (!scumm_stricmp(_tokens[0], "path")) {
		_out->_info->loadGfxObjPath(_tokens[1], data->_gfxobj);
	} else
	if (!scumm_stricmp(_tokens[0], "icon")) {
		data->_getIcon = 4 + _vm->_objectsNames->lookup(_tokens[1]);
	}
}
开发者ID:vladborovtsov,项目名称:scummvm,代码行数:20,代码来源:parser_br.cpp


示例6: drawZone

void Parallaction::drawZone(ZonePtr zone) {
    if (!zone) {
        return;
    }

    GfxObj *obj = 0;
    if (ACTIONTYPE(zone) == kZoneGet) {
        obj = zone->u._gfxobj;
    } else if (ACTIONTYPE(zone) == kZoneDoor) {
        obj = zone->u._gfxobj;
    }

    if (!obj) {
        return;
    }

    obj->x = zone->getX();
    obj->y = zone->getY();
    _gfx->addObjectToScene(obj);
}
开发者ID:peres,项目名称:scummvm,代码行数:20,代码来源:parallaction.cpp


示例7: checkSpecialZoneBox

bool Parallaction::checkSpecialZoneBox(ZonePtr z, uint32 type, uint x, uint y) {
	// check if really a special zone
	if (_gameType == GType_Nippon) {
		// so-called special zones in NS have special x coordinates
		if ((z->getX() != -2) && (z->getX() != -3)) {
			return false;
		}
	}
	if (_gameType == GType_BRA) {
		// so far, special zones in BRA are only merge zones
		if (ACTIONTYPE(z) != kZoneMerge) {
			return false;
		}
	}

	// WORKAROUND: this huge condition is needed because we made TypeData a collection of structs
	// instead of an union. So, merge->_obj1 and get->_icon were just aliases in the original engine,
	// but we need to check it separately here. The same workaround is applied in freeZones.
	if (((ACTIONTYPE(z) == kZoneMerge) && (((x == z->u._mergeObj1) && (y == z->u._mergeObj2)) || ((x == z->u._mergeObj2) && (y == z->u._mergeObj1)))) ||
		((ACTIONTYPE(z) == kZoneGet) && ((x == z->u._getIcon) || (y == z->u._getIcon)))) {

		// WORKAROUND for bug 2070751: special zones are only used in NS, to allow the
		// the EXAMINE/USE action to be applied on some particular item in the inventory.
		// The usage a verb requires at least an item match, so type can't be 0, as it
		// was in the original code. This bug has been here since the beginning, and was
		// hidden by label code, which filtered the bogus matches produced here.

		// look for action + item match
		if (z->_type == type)
			return true;
		// look for item match, but don't accept 0 types
		if ((ITEMTYPE(z) == type) && (type))
			return true;
	}

	return false;
}
开发者ID:AdamRi,项目名称:scummvm-pink,代码行数:37,代码来源:parallaction.cpp


示例8: keepZone_ns

bool Location::keepZone_ns(ZonePtr z) {
	return (z->getY() == -1) || (z->getX() == -2);
}
开发者ID:AdamRi,项目名称:scummvm-pink,代码行数:3,代码来源:parallaction.cpp



注:本文中的ZonePtr类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ ZoneServer类代码示例发布时间:2022-05-31
下一篇:
C++ Zone类代码示例发布时间:2022-05-31
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap