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

C++ setArea函数代码示例

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

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



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

示例1: switch

bool CPetControl::VirtualKeyCharMsg(CVirtualKeyCharMsg *msg) {
	if (isInputLocked())
		return false;

	bool result = _sections[_currentArea]->VirtualKeyCharMsg(msg);

	if (!result) {
		switch (msg->_keyState.keycode) {
		case Common::KEYCODE_F1:
			result = true;
			setArea(PET_INVENTORY);
			break;
		case Common::KEYCODE_F2:
			result = true;
			setArea(PET_CONVERSATION);
			break;
		case Common::KEYCODE_F3:
			result = true;
			setArea(PET_REMOTE);
			break;
		case Common::KEYCODE_F4:
			result = true;
			setArea(PET_ROOMS);
			break;
		case Common::KEYCODE_F5:
			result = true;
			setArea(PET_REAL_LIFE);
			break;
		default:
			break;
		}
	}

	return result;
}
开发者ID:86400,项目名称:scummvm,代码行数:35,代码来源:pet_control.cpp


示例2: setArea

CGO_Player::CGO_Player ()
{
	ani = NULL;
	shadow = &a_shadow;
	setArea(ea_gameBoard);
	moveAbs(0, 0);

	dx = CGO_Player::dy = 3;
	setActive(false);
	setLifeState(LALIVE);
	setAniDirState(SSTAND, ASOUTH);
	setRunState(XSTAND);
	setColor(cred);
	setType(GOT_PLAYER);
	setName("Unnamed Player");
	setTeam(TEAM_RED);
	dropedBombs = 0;

	powerups[PBOMB ] = BWBOMB;
	powerups[PFLAME ] = BWFLAME;
	powerups[PSKATE ] = BWSKATE;
	powerups[PKICKER ] = BWKICKER;
	powerups[PJELLY ] = BWJELLY;
	powerups[PTRIGGER ] = BWTRIGGER;
	powerups[PPUNCH ] = BWPUNCH;
	powerups[PGRAB ] = BWGRAB;
	powerups[PSPOOGE ] = BWSPOOGE;
	powerups[PGOLDFLAME] = BWGOLDFLAME;
	powerups[PDISEASE ] = BWDISEASE;
	powerups[PDISEASE3 ] = BWDISEASE3;
}
开发者ID:sobotkami,项目名称:openatomic,代码行数:31,代码来源:go_player.cpp


示例3: setArea

//----------------------------------------------------------------------------//
void Element::onNonClientChanged(ElementEventArgs& e)
{
    // TODO: Be less wasteful with this update
    setArea(getArea());

    fireEvent(EventNonClientChanged, e, EventNamespace);
}
开发者ID:AjaxWang1989,项目名称:cegui,代码行数:8,代码来源:Element.cpp


示例4: setArea

//----------------------------------------------------------------------------//
void NullTextureTarget::declareRenderSize(const Size& sz)
{
	Rect r;
	r.setSize(sz);
	r.setPosition(Point(0, 0));
    setArea(r);
}
开发者ID:B2O,项目名称:IV-Network,代码行数:8,代码来源:CEGUINullTextureTarget.cpp


示例5: nullTheData

/**
 * Creates a 3D area based on the supplied start and end points.
 *
 * @param startX the leftmost X position
 * @param startY the topmost Y position
 * @param startZ the frontmost Z position
 * @param endX the rightmost X position
 * @param endY the bottommost Y position
 * @param endZ the backmost Z position
 */
Area3D::Area3D(const Displacement &startX, const Displacement &startY,
               const Displacement &startZ,
               const Displacement &endX, const Displacement &endY,
               const Displacement &endZ) {
    nullTheData();
    setArea(startX, startY, startZ, endX, endY, endZ);
}
开发者ID:jlaura,项目名称:isis3,代码行数:17,代码来源:Area3D.cpp


示例6: setArea

void MI0283QT9::fillCircle(uint16_t x0, uint16_t y0, uint16_t radius, uint16_t color)
{
  int16_t err, x, y;
  
  err = -radius;
  x   = radius;
  y   = 0;

  setArea(0, 0, lcd_width-1, lcd_height-1);

  while(x >= y)
  {
    drawLine(x0 - x, y0 + y, x0 + x, y0 + y, color);
    drawLine(x0 - x, y0 - y, x0 + x, y0 - y, color);
    drawLine(x0 - y, y0 + x, x0 + y, y0 + x, color);
    drawLine(x0 - y, y0 - x, x0 + y, y0 - x, color);

    err += y;
    y++;
    err += y;
    if(err >= 0)
    {
      x--;
      err -= x;
      err -= x;
    }
  }

  return;
}
开发者ID:D4p0up,项目名称:mSD-Shield,代码行数:30,代码来源:MI0283QT9.cpp


示例7: setArea

void CPetControl::addToInventory(CGameObject *item) {
	item->detach();

	if (item->getName() == "CarryParcel") {
		CCarry *child = dynamic_cast<CCarry *>(getLastChild());
		if (child)
			child->detach();

		item->petMoveToHiddenRoom();
		if (!child)
			return;

		item = child;
	}

	item->addUnder(this);
	_inventory.itemsChanged();

	setArea(PET_INVENTORY);
	if (_currentArea == PET_INVENTORY)
		_inventory.highlightItem(item);

	makeDirty();
	CPETGainedObjectMsg msg;
	msg.execute(item);
}
开发者ID:86400,项目名称:scummvm,代码行数:26,代码来源:pet_control.cpp


示例8: setArea

void Radiosity::Reset() {
  delete [] area;
  delete [] undistributed;
  delete [] absorbed;
  delete [] radiance;

  // create and fill the data structures
  num_faces = mesh->numFaces();
  area = new float[num_faces];
  undistributed = new glm::vec3[num_faces];
  absorbed = new glm::vec3[num_faces];
  radiance = new glm::vec3[num_faces];
  for (int i = 0; i < num_faces; i++) {
    Face *f = mesh->getFace(i);
    f->setRadiosityPatchIndex(i);
    setArea(i,f->getArea());
    glm::vec3 emit = f->getMaterial()->getEmittedColor();
    setUndistributed(i,emit);
    setAbsorbed(i,glm::vec3(0,0,0));
    setRadiance(i,emit);
  }

  // find the patch with the most undistributed energy
  findMaxUndistributed();
}
开发者ID:jonwrona,项目名称:ACG-Final,代码行数:25,代码来源:radiosity.cpp


示例9: setArea

void markupText::setText( QString textIn )
{
    text = textIn;

    // Update the area to accommodate the new text
    setArea();
}
开发者ID:andrewrhyder,项目名称:epicsqt,代码行数:7,代码来源:markupText.cpp


示例10: setArea

void DirtyArea::setTextDisplay(const TextDisplay *textDisplay) {
	_bounds.left = textDisplay->_bounds.left;
	_bounds.top = textDisplay->_bounds.top;

	setArea(textDisplay->_bounds.width(), textDisplay->_bounds.height(),
		MADS_SCREEN_WIDTH, MADS_SCENE_HEIGHT);
}
开发者ID:CobaltBlues,项目名称:scummvm,代码行数:7,代码来源:screen.cpp


示例11: transformToWndCoord

	bool FrameWindow::onMouseMove(void)
	{
		if(m_tracking)
		{
			point pt = transformToWndCoord(m_system.getCursor().getPosition());
			point newpos = pt - m_offset;

			Rect testarea(m_area);
			testarea.setPosition(newpos);

			if(m_clampToScreen && m_parent)
			{
				Size me = m_area.getSize();
				Size max = m_parent->getSize();
				if(testarea.m_left < 0.f)
					testarea.m_left = 0.f;
				if(testarea.m_top < 0.f)
					testarea.m_top = 0.f;
				if(testarea.m_right > max.width)
					testarea.m_left = max.width - me.width;
				if(testarea.m_bottom > max.height)
					testarea.m_top = max.height - me.height;

				testarea.setSize(me);
			}
			
			setArea(testarea);

			EventArgs a;
			a.name = "On_Move";
			callHandler(&a);
		}
		return true;
	}
开发者ID:strelkovsky,项目名称:gamegui,代码行数:34,代码来源:framewindow.cpp


示例12: setArea

void GraphicsLib::fillRect(int_least16_t x0, int_least16_t y0, int_least16_t w, int_least16_t h, uint_least16_t color)
{
    uint_least32_t size;

    if(x0   >= lcd_width)  {
        x0 = lcd_width-1;
    }
    if(y0   >= lcd_height) {
        y0 = lcd_height-1;
    }
    if(x0+w >= lcd_width)  {
        w  = lcd_width-x0;
    }
    if(y0+h >= lcd_height) {
        h  = lcd_height-y0;
    }

    setArea(x0, y0, x0+w-1, y0+h-1);

    drawStart();

    for(size=((uint_least32_t)w*h); size!=0; size--)
    {
        draw(color);
    }

    drawStop();

    return;
}
开发者ID:lenjivac123,项目名称:Arduino-Libs,代码行数:30,代码来源:GraphicsLib.cpp


示例13: DEBUG_M

RigidBody::~RigidBody() {
	DEBUG_M("Entering function...");
	setArea(NULL);
	delete body_;
	delete shape_;
	delete motionState_;
}
开发者ID:bagobor,项目名称:tx,代码行数:7,代码来源:RigidBody.cpp


示例14: init_area

//----------------------------------------------------------------------------//
void OgreTextureTarget::declareRenderSize(const Sizef& sz)
{
    // exit if current size is enough
    if ((d_area.getWidth() >= sz.d_width) && (d_area.getHeight() >=sz.d_height))
        return;

    Ogre::TexturePtr rttTex = Ogre::TextureManager::getSingleton().createManual(
        OgreTexture::getUniqueName(),
        Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME,
        Ogre::TEX_TYPE_2D, sz.d_width, sz.d_height, 1, 0, Ogre::PF_A8R8G8B8,
        Ogre::TU_RENDERTARGET);

    d_renderTarget = rttTex->getBuffer()->getRenderTarget();

    Rectf init_area(
        Vector2f(0, 0),
        Sizef(d_renderTarget->getWidth(), d_renderTarget->getHeight())
    );

    setArea(init_area);

    // delete viewport and reset ptr so a new one is generated.  This is
    // required because we have changed d_renderTarget so need a new VP also.
    delete d_viewport;
    d_viewport = 0;

    // because Texture takes ownership, the act of setting the new ogre texture
    // also ensures any previous ogre texture is released.
    d_CEGUITexture->setOgreTexture(rttTex, true);

    clear();
}
开发者ID:AjaxWang1989,项目名称:cegui,代码行数:33,代码来源:TextureTarget.cpp


示例15: setArea

//----------------------------------------------------------------------------//
void NullTextureTarget::declareRenderSize(const Sizef& sz)
{
	Rectf r;
	r.setSize(sz);
    r.setPosition(glm::vec2(0, 0));
    setArea(r);
}
开发者ID:OpenTechEngine-Libraries,项目名称:CEGUI,代码行数:8,代码来源:TextureTarget.cpp


示例16: QTabBar

TabBarWidget::TabBarWidget(QWidget *parent) : QTabBar(parent),
	m_previewWidget(NULL),
	m_tabSize(0),
	m_maximumTabSize(40),
	m_minimumTabSize(250),
	m_pinnedTabsAmount(0),
	m_clickedTab(-1),
	m_hoveredTab(-1),
	m_previewTimer(0),
	m_showCloseButton(true),
	m_showUrlIcon(true),
	m_enablePreviews(true)
{
	qRegisterMetaType<WindowLoadingState>("WindowLoadingState");
	setDrawBase(false);
	setExpanding(false);
	setMovable(true);
	setSelectionBehaviorOnRemove(QTabBar::SelectPreviousTab);
	setElideMode(Qt::ElideRight);
	setMouseTracking(true);
	setDocumentMode(true);
	setMaximumSize(0, 0);
	setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred);
	setStyle(new TabBarStyle());

	m_closeButtonPosition = static_cast<QTabBar::ButtonPosition>(QApplication::style()->styleHint(QStyle::SH_TabBar_CloseButtonPosition));
	m_iconButtonPosition = ((m_closeButtonPosition == QTabBar::RightSide) ? QTabBar::LeftSide : QTabBar::RightSide);

	optionChanged(QLatin1String("TabBar/ShowCloseButton"), SettingsManager::getValue(QLatin1String("TabBar/ShowCloseButton")));
	optionChanged(QLatin1String("TabBar/ShowUrlIcon"), SettingsManager::getValue(QLatin1String("TabBar/ShowUrlIcon")));
	optionChanged(QLatin1String("TabBar/EnablePreviews"), SettingsManager::getValue(QLatin1String("TabBar/EnablePreviews")));
	optionChanged(QLatin1String("TabBar/MaximumTabSize"), SettingsManager::getValue(QLatin1String("TabBar/MaximumTabSize")));
	optionChanged(QLatin1String("TabBar/MinimumTabSize"), SettingsManager::getValue(QLatin1String("TabBar/MinimumTabSize")));

	ToolBarWidget *toolBar = qobject_cast<ToolBarWidget*>(parent);

	if (toolBar)
	{
		setArea(toolBar->getArea());

		connect(toolBar, SIGNAL(areaChanged(Qt::ToolBarArea)), this, SLOT(setArea(Qt::ToolBarArea)));
	}

	connect(SettingsManager::getInstance(), SIGNAL(valueChanged(QString,QVariant)), this, SLOT(optionChanged(QString,QVariant)));
	connect(this, SIGNAL(currentChanged(int)), this, SLOT(currentTabChanged(int)));
}
开发者ID:aurhat,项目名称:otter-browser,代码行数:46,代码来源:TabBarWidget.cpp


示例17: setArea

void Image::setAround(unsigned x, unsigned y, unsigned pixelSize, Color color) {
	unsigned halfSize = (double)pixelSize/2;
	unsigned top = y > halfSize ? y - halfSize : 0;
	unsigned left = x > halfSize ? x - halfSize : 0;
	unsigned bottom = y + halfSize < height ? y + halfSize : height;
	unsigned right = x + halfSize < width ? x + halfSize : width;
	setArea(top, left, bottom, right, color);
}
开发者ID:DeadNight,项目名称:robotics,代码行数:8,代码来源:Image.cpp


示例18: callback

ClickableArea::ClickableArea(CIntObject * object, CFunctionList<void()> callback):
	callback(callback),
	area(nullptr)
{
	if (object)
		pos = object->pos;
	setArea(object);
}
开发者ID:COJIDAT,项目名称:vcmi-ios,代码行数:8,代码来源:Buttons.cpp


示例19: limitPointToImage

void markupText::moveTo( const QPoint posIn )
{
    // Limit position to within the image
    QPoint limPos = limitPointToImage( posIn );

    rect.translate( limPos - owner->grabOffset );

    setArea();
}
开发者ID:andrewrhyder,项目名称:epicsqt,代码行数:9,代码来源:markupText.cpp


示例20: setArea

//----------------------------------------------------------------------------//
void OpenGLFBOTextureTarget::declareRenderSize(const Size& sz)
{
    // exit if current size is enough
    if ((d_area.getWidth() >= sz.d_width) && (d_area.getHeight() >=sz.d_height))
        return;

    setArea(Rect(d_area.getPosition(), d_owner.getAdjustedTextureSize(sz)));
    resizeRenderTexture();
}
开发者ID:graag,项目名称:OrxCraft,代码行数:10,代码来源:CEGUIOpenGLFBOTextureTarget.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ setArray函数代码示例发布时间:2022-05-30
下一篇:
C++ setApplicationName函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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