本文整理汇总了C++中ROCKET_ASSERT函数的典型用法代码示例。如果您正苦于以下问题:C++ ROCKET_ASSERT函数的具体用法?C++ ROCKET_ASSERT怎么用?C++ ROCKET_ASSERT使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ROCKET_ASSERT函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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];
}
示例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];
}
示例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);
}
示例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;
}
示例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);
}
示例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);
}
示例7: ROCKET_ASSERT
HighScores::~HighScores()
{
ROCKET_ASSERT(instance == this);
SaveScores();
instance = NULL;
}
示例8: ROCKET_ASSERT
void ElementDocument::LockLayout(bool lock)
{
if (lock)
lock_layout++;
else
lock_layout--;
ROCKET_ASSERT(lock_layout >= 0);
}
示例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;
}
示例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);
}
}
示例11: ROCKET_ASSERT
// Removes a reference from the object.
void ReferenceCountable::RemoveReference()
{
ROCKET_ASSERT(reference_count > 0);
reference_count--;
if (reference_count == 0)
{
OnReferenceDeactivate();
}
}
示例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;
}
示例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
}
示例14: ROCKET_ASSERT
// Closes the box.
void LayoutInlineBox::Close()
{
if (chain)
chain->Close();
else
{
ROCKET_ASSERT(line != NULL);
line->CloseInlineBox(this);
}
}
示例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
}