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

C++ ROCKET_ASSERT函数代码示例

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

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



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

示例1: ROCKET_ASSERT

// Returns on the layer's textures.
const Texture* FontFaceLayer::GetTexture(int index)
{
	ROCKET_ASSERT(index >= 0);
	ROCKET_ASSERT(index < GetNumTextures());

	return textures[index];
}
开发者ID:czbming,项目名称:libRocket,代码行数:8,代码来源:FontFaceLayer.cpp


示例2: ROCKET_ASSERT

// Returns one of the layout's textures.
TextureLayoutTexture& TextureLayout::GetTexture(int index)
{
	ROCKET_ASSERT(index >= 0);
	ROCKET_ASSERT(index < GetNumTextures());

	return textures[index];
}
开发者ID:ppiecuch,项目名称:libRocket,代码行数:8,代码来源:TextureLayout.cpp


示例3: ROCKET_ASSERT

UnicodeRange::UnicodeRange(int _min_codepoint, int _max_codepoint)
{
	min_codepoint = _min_codepoint;
	max_codepoint = _max_codepoint;

	ROCKET_ASSERT(min_codepoint <= max_codepoint);
}
开发者ID:MatiasNAmendola,项目名称:libRocket,代码行数:7,代码来源:UnicodeRange.cpp


示例4: function_name

bool EventListener::Compile()
{
	Rocket::Core::String function_name(64, "Event_%x", this);
	Rocket::Core::String function_code(64, "def %s():", function_name.CString());

	Rocket::Core::StringList lines;
	Rocket::Core::StringUtilities::ExpandString(lines, source_code, ';');
	for (size_t i = 0; i < lines.size(); i++)
	{
		// Python doesn't handle \r's, strip em and indent the code correctly
		function_code += Rocket::Core::String(1024, "\n\t%s", lines[i].CString()).Replace("\r", "");
	}

	ROCKET_ASSERT(element != NULL);

	PyObject* py_namespace = GetGlobalNamespace();

	// Add our function to the namespace
	PyObject* result = PyRun_String(function_code.CString(), Py_file_input, py_namespace, py_namespace);
	if (!result)
	{
		Rocket::Core::Python::Utilities::PrintError();		
		return false;
	}
	Py_DECREF(result);

	// Get a handle to our function
	callable = PyDict_GetItemString(py_namespace, function_name.CString());
	Py_INCREF(callable);

	return true;
}
开发者ID:AlexKordic,项目名称:libRocket,代码行数:32,代码来源:EventListener.cpp


示例5: OnUpdate

// Adds a new option to the select control.
int ElementFormControlSelect::Add(const Rocket::Core::String& rml, const Rocket::Core::String& value, int before, bool selectable)
{
	OnUpdate();

	ROCKET_ASSERT(widget != NULL);
	return widget->AddOption(rml, value, before, false, selectable);
}
开发者ID:CarverLab,项目名称:libRocket-1,代码行数:8,代码来源:ElementFormControlSelect.cpp


示例6: ROCKET_ASSERT

// Closes one of the line box's inline boxes.
void LayoutLineBox::CloseInlineBox(LayoutInlineBox* inline_box)
{
	ROCKET_ASSERT(open_inline_box == inline_box);

	open_inline_box = inline_box->GetParent();
	box_cursor += GetSpacing(inline_box->GetBox(), Box::RIGHT);
}
开发者ID:BlueMustache,项目名称:Unvanquished,代码行数:8,代码来源:LayoutLineBox.cpp


示例7: ROCKET_ASSERT

HighScores::~HighScores()
{
	ROCKET_ASSERT(instance == this);

	SaveScores();

	instance = NULL;
}
开发者ID:AlexKordic,项目名称:libRocket,代码行数:8,代码来源:HighScores.cpp


示例8: ROCKET_ASSERT

void ElementDocument::LockLayout(bool lock)
{
	if (lock)
		lock_layout++;
	else
		lock_layout--;
	
	ROCKET_ASSERT(lock_layout >= 0);
}
开发者ID:Kaperstone,项目名称:warsow,代码行数:9,代码来源:ElementDocument.cpp


示例9: ROCKET_ASSERT

// Returns a reference to one of the rows of the filter kernel.
float* ConvolutionFilter::operator[](int index)
{
	ROCKET_ASSERT(kernel != NULL);

	index = Math::Max(index, 0);
	index = Math::Min(index, kernel_size - 1);

	return kernel + kernel_size * index;
}
开发者ID:MatiasNAmendola,项目名称:libRocket,代码行数:10,代码来源:ConvolutionFilter.cpp


示例10: ROCKET_ASSERT

void DataQuery::LoadRow()
{
	ROCKET_ASSERT(current_row <= (int)rows.size());
	if (current_row >= (int)rows.size())
	{
		rows.push_back(Rocket::Core::StringList());
		data_source->GetRow(rows[current_row], table, offset + current_row, fields);
	}
}
开发者ID:Aggroo,项目名称:nebula-trifid,代码行数:9,代码来源:DataQuery.cpp


示例11: ROCKET_ASSERT

// Removes a reference from the object.
void ReferenceCountable::RemoveReference()
{
    ROCKET_ASSERT(reference_count > 0);
    reference_count--;
    if (reference_count == 0)
    {
        OnReferenceDeactivate();
    }
}
开发者ID:BlueMustache,项目名称:Unvanquished,代码行数:10,代码来源:ReferenceCountable.cpp


示例12: ROCKET_ASSERT

Core::Element* XMLNodeHandlerDataGrid::ElementStart(Core::XMLParser* parser, const Rocket::Core::String& name, const Rocket::Core::XMLAttributes& attributes)
{
	Core::Element* element = NULL;
	Core::Element* parent = parser->GetParseFrame()->element;

	ROCKET_ASSERT(name == "datagrid" ||
			   name == "col");

	if (name == "datagrid")
	{
		// Attempt to instance the grid.
		element = Core::Factory::InstanceElement(parent, name, name, attributes);
		ElementDataGrid* grid = dynamic_cast< ElementDataGrid* >(element);
		if (grid == NULL)
		{
			if (element != NULL)
				element->RemoveReference();

			Core::Log::Message(Rocket::Core::Log::LT_ERROR, "Instancer failed to create data grid for tag %s.", name.CString());
			return NULL;
		}

		// Set the data source and table on the data grid.
		Rocket::Core::String data_source = attributes.Get< Rocket::Core::String >("source", "");
		grid->SetDataSource(data_source);

		parent->AppendChild(grid);
		grid->RemoveReference();

		// Switch to this handler for all columns.
		parser->PushHandler("datagrid");
	}
	else if (name == "col")
	{
		// Make a new node handler to handle the header elements.		
		element = Core::Factory::InstanceElement(parent, "datagridcolumn", "datagridcolumn", attributes);
		if (element == NULL)
			return NULL;

		ElementDataGrid* grid = dynamic_cast< ElementDataGrid* >(parent);
		if (grid != NULL)
		{
			grid->AddColumn(attributes.Get< Rocket::Core::String >("fields", ""), attributes.Get< Rocket::Core::String >("formatter", ""), attributes.Get< float >("width", 0), element);
			element->RemoveReference();
		}

		// Switch to element handler for all children.
		parser->PushDefaultHandler();
	}
	else
	{
		ROCKET_ERROR;
	}

	return element;
}
开发者ID:ABuus,项目名称:RuntimeCompiledCPlusPlus,代码行数:56,代码来源:XMLNodeHandlerDataGrid.cpp


示例13: delete

// Called by Rocket when it wants to release application-compiled geometry.		
void RocketSFMLRenderer::ReleaseCompiledGeometry(Rocket::Core::CompiledGeometryHandle geometry)
{
#ifdef ENABLE_GLEW
	MyWindow->SetActive();

	delete (RocketSFMLRendererGeometryHandler *)geometry;
#else
	ROCKET_ASSERT(false /*& "Not Implemented"*/);
#endif
}
开发者ID:AlexKordic,项目名称:libRocket,代码行数:11,代码来源:RenderInterfaceSFML.cpp


示例14: ROCKET_ASSERT

// Closes the box.
void LayoutInlineBox::Close()
{
    if (chain)
        chain->Close();
    else
    {
        ROCKET_ASSERT(line != NULL);
        line->CloseInlineBox(this);
    }
}
开发者ID:keynslug,项目名称:librocket,代码行数:11,代码来源:LayoutInlineBox.cpp


示例15: glPushMatrix

// Called by Rocket when it wants to render application-compiled geometry.
void RocketSFMLRenderer::RenderCompiledGeometry(Rocket::Core::CompiledGeometryHandle geometry, const Rocket::Core::Vector2f& translation)
{

#ifdef ENABLE_GLEW
    MyWindow->setActive();

    RocketSFMLRendererGeometryHandler *RealGeometry = (RocketSFMLRendererGeometryHandler *)geometry;

    glPushMatrix();
    glTranslatef(translation.x, translation.y, 0);
    glEnable(GL_BLEND);
    glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);

    sf::Texture *sfTexture = (sf::Texture *)RealGeometry->Texture;

    if(sfTexture)
    {
        sf::Texture::bind(sfTexture);
    }
    else
    {
        glBindTexture(GL_TEXTURE_2D, 0);
    };

    glEnable(GL_VERTEX_ARRAY);
    glEnable(GL_TEXTURE_COORD_ARRAY);
    glEnable(GL_COLOR_ARRAY);

#define BUFFER_OFFSET(x) ((char*)0 + x)

    glBindBuffer(GL_ARRAY_BUFFER, RealGeometry->VertexID);
    glVertexPointer(2, GL_FLOAT, sizeof(RocketSFMLRendererVertex), BUFFER_OFFSET(0));
    glTexCoordPointer(2, GL_FLOAT, sizeof(RocketSFMLRendererVertex), BUFFER_OFFSET(sizeof(sf::Vector2f)));
    glColorPointer(4, GL_UNSIGNED_BYTE, sizeof(RocketSFMLRendererVertex), BUFFER_OFFSET(sizeof(sf::Vector2f[2])));

    glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, RealGeometry->IndexID);
    glDrawElements(GL_TRIANGLES, RealGeometry->NumVertices, GL_UNSIGNED_INT, BUFFER_OFFSET(0));

    glBindBuffer(GL_ARRAY_BUFFER, 0);

    glDisable(GL_COLOR_ARRAY);
    glDisable(GL_TEXTURE_COORD_ARRAY);
    glDisable(GL_VERTEX_ARRAY);

    glColor4f(1, 1, 1, 1);

    glPopMatrix();
#else
    ROCKET_ASSERT(false /*& "Not Implemented"*/);
#endif

}
开发者ID:hahahahaman,项目名称:Lights-Demo,代码行数:53,代码来源:RenderInterfaceSFML.cpp


示例16: ROCKET_ASSERT

ConsoleBuffer::ConsoleBuffer() : Rocket::Controls::DataSource("console_buffer") {
    ROCKET_ASSERT(instance == NULL);
    instance = this;

    systemMsgColor = Rocket::Core::Colourb(255, 255, 255);
    Rocket::Core::TypeConverter< Rocket::Core::Colourb, Rocket::Core::String >::Convert(systemMsgColor,systemMsgColorString);
    moveMsgColor = Rocket::Core::Colourb(0, 0, 255);
    Rocket::Core::TypeConverter< Rocket::Core::Colourb, Rocket::Core::String >::Convert(moveMsgColor,moveMsgColorString);
    attackMsgColor = Rocket::Core::Colourb(255, 0, 0);
    Rocket::Core::TypeConverter< Rocket::Core::Colourb, Rocket::Core::String >::Convert(attackMsgColor,attackMsgColorString);

    this->messages.resize(BUFFER_SIZE);
}
开发者ID:rmaloney77,项目名称:crimson,代码行数:13,代码来源:ConsoleBuffer.cpp


示例17: ROCKET_ASSERT

Plugin::Plugin()
{
	ROCKET_ASSERT(instance == NULL);
	instance = this;
	host_context = NULL;
	debug_context = NULL;
	log_hook = NULL;

	menu_element = NULL;
	info_element = NULL;
	log_element = NULL;

	render_outlines = false;
}
开发者ID:1vanK,项目名称:libRocket-Urho3D,代码行数:14,代码来源:Plugin.cpp


示例18: SetBox

// Builds and sets the box for an element.
static void SetBox(Element* element)
{
	Element* parent = element->GetParentNode();
	ROCKET_ASSERT(parent != NULL);

	Vector2f containing_block = parent->GetBox().GetSize();
	containing_block.x -= parent->GetElementScroll()->GetScrollbarSize(ElementScroll::VERTICAL);
	containing_block.y -= parent->GetElementScroll()->GetScrollbarSize(ElementScroll::HORIZONTAL);

	Box box;
	LayoutEngine::BuildBox(box, containing_block, element);
	if (element->GetLocalProperty(HEIGHT) == NULL)
		box.SetContent(Vector2f(box.GetSize().x, containing_block.y));

	element->SetBox(box);
}
开发者ID:keynslug,项目名称:librocket,代码行数:17,代码来源:ElementUtilities.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ ROL函数代码示例发布时间:2022-05-30
下一篇:
C++ RNOK函数代码示例发布时间: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