本文整理汇总了C++中core::array::size方法的典型用法代码示例。如果您正苦于以下问题:C++ array::size方法的具体用法?C++ array::size怎么用?C++ array::size使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类core::array
的用法示例。
在下文中一共展示了array::size方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: clear
void CSMFile::clear()
{
header.clear();
cameraData.clear();
u32 x =0;
for( x= 0; x < groups.size(); x++)
delete groups[x];
groups.clear();
for(x= 0; x < visgroups.size(); x++)
delete visgroups[x];
visgroups.clear();
for(x= 0; x < lightmaps.size(); x++)
delete lightmaps[x];
lightmaps.clear();
for(x= 0; x < meshes.size(); x++)
delete meshes[x];
meshes.clear();
for(x= 0; x < entities.size(); x++)
delete entities[x];
entities.clear();
}
示例2: writeElement
//! Writes an xml element with any number of attributes
void CXMLWriter::writeElement(const c8* name, bool empty,
core::array<core::stringc> &names, core::array<core::stringc> &values)
{
IRR_ASSERT(sizeof(name) > 0);
if (Tabs > 0)
{
for (int i = 0; i < Tabs; ++i)
File->write("\t", sizeof(c8));
}
// write name
File->write("<", sizeof(c8));
File->write(name, strlen(name) * sizeof(c8));
// write attributes
u32 i = 0;
for (; i < names.size() && i < values.size(); ++i)
writeAttribute(names[i].cStr(), values[i].cStr());
// write closing tag
if (empty)
File->write(" />", 3 * sizeof(c8));
else
{
File->write(">", sizeof(c8));
++Tabs;
}
TextWrittenLast = false;
}
示例3: writeElement
//! Writes an xml element with any number of attributes
void CXMLWriter::writeElement(const wchar_t* name, bool empty,
core::array<core::stringw> &names,
core::array<core::stringw> &values)
{
if (!File || !name)
return;
if (Tabs > 0)
{
for (int i=0; i<Tabs; ++i)
File->write(L"\t", sizeof(wchar_t));
}
// write name
File->write(L"<", sizeof(wchar_t));
File->write(name, wcslen(name)*sizeof(wchar_t));
// write attributes
u32 i=0;
for (; i < names.size() && i < values.size(); ++i)
writeAttribute(names[i].c_str(), values[i].c_str());
// write closing tag
if (empty)
File->write(L" />", 3*sizeof(wchar_t));
else
{
File->write(L">", sizeof(wchar_t));
++Tabs;
}
TextWrittenLast = false;
}
示例4:
//! Moves a mesh
core::array<bool> CBatchingMesh::moveMesh(const core::array<s32>& bufferIDs, const core::matrix4 &newMatrix)
{
core::array<bool> result;
result.reallocate(bufferIDs.size());
for (u32 i=0; i<bufferIDs.size(); ++i)
result.push_back(moveMeshBuffer(bufferIDs[i], newMatrix));
return result;
}
示例5: drawElements
// this function is for 32bit indices
void drawElements(
IVideoDriver* driver,
const core::array<video::S3DVertex>& vertices,
const core::array<s32>& indices,
scene::E_PRIMITIVE_TYPE primType)
{
if (!driver)
return;
u32 primCount = 0;
const u32& indexCount = indices.size();
switch (primType)
{
case scene::EPT_POINTS:
primCount = indexCount;
break;
case scene::EPT_LINE_STRIP:
primCount = indexCount-1;
break;
case scene::EPT_LINE_LOOP:
primCount = indexCount-1;
break;
case scene::EPT_LINES:
primCount = indexCount/2;
break;
case scene::EPT_TRIANGLE_STRIP:
primCount = (indexCount-2)/3;
break;
case scene::EPT_TRIANGLE_FAN:
primCount = (indexCount-2)/3;
break;
case scene::EPT_TRIANGLES:
primCount = indexCount/3;
break;
case scene::EPT_QUAD_STRIP:
primCount = (indexCount-2)/4;
break;
case scene::EPT_QUADS:
primCount = indexCount/4;
break;
case scene::EPT_POLYGON:
primCount = indexCount-1;
break;
case scene::EPT_POINT_SPRITES:
primCount = indexCount;
break;
default:
break;
}
driver->drawVertexPrimitiveList( vertices.const_pointer(),
vertices.size(), indices.const_pointer(),
primCount, video::EVT_STANDARD,
primType, video::EIT_32BIT);
}
示例6: getTextureName
std::string TextureSource::getTextureName(u32 id)
{
JMutexAutoLock lock(m_atlaspointer_cache_mutex);
if(id >= m_atlaspointer_cache.size())
{
errorstream<<"TextureSource::getTextureName(): id="<<id
<<" >= m_atlaspointer_cache.size()="
<<m_atlaspointer_cache.size()<<std::endl;
return "";
}
return m_atlaspointer_cache[id].name;
}
示例7: setTexture
void CSoftwareRenderTarget::setTexture(const core::array<ITexture*>& texture, ITexture* depthStencil)
{
if (Texture != texture)
{
if (Texture[0])
Texture[0]->drop();
bool textureDetected = false;
for (u32 i = 0; i < texture.size(); ++i)
{
if (texture[i] && texture[i]->getDriverType() == EDT_SOFTWARE)
{
Texture[0] = texture[i];
Texture[0]->grab();
textureDetected = true;
break;
}
}
if (!textureDetected)
Texture[0] = 0;
}
}
示例8: addUsableSlotArray
//! Adds the slots in the array to the usable slots
void CGUIIcon::addUsableSlotArray(const core::array<IGUIElement*>& slotArray)
{
s32 arraySize = slotArray.size();
for(s32 i = 0; i < arraySize; i++)
{
UsableSlots->push_back(slotArray[i]);
}
}
示例9: OnRenderPassPostRender
virtual void OnRenderPassPostRender(scene::E_SCENE_NODE_RENDER_PASS renderPass)
{
// I only want solid nodes to be lit, so after the solid pass, turn all lights off.
if(scene::ESNRP_SOLID == renderPass)
{
for(u32 i = 0; i < SceneLightList->size(); ++i)
(*SceneLightList)[i]->setVisible(false);
}
}
示例10: OnPostRender
// Called after the last scene node is rendered.
virtual void OnPostRender()
{
// Since light management might be switched off in the event handler, we'll turn all
// lights on to ensure that they are in a consistent state. You wouldn't normally have
// to do this when using a light manager, since you'd continue to do light management
// yourself.
for(u32 i = 0; i < SceneLightList->size(); i++)
(*SceneLightList)[i]->setVisible(true);
}
示例11: getTexture
AtlasPointer TextureSource::getTexture(u32 id)
{
JMutexAutoLock lock(m_atlaspointer_cache_mutex);
if(id >= m_atlaspointer_cache.size())
return AtlasPointer(0, NULL);
return m_atlaspointer_cache[id].a;
}
示例12: sizeof
bool CIrrDeviceWin32::activateJoysticks(core::array<SJoystickInfo> & joystickInfo)
{
#if defined _IRR_COMPILE_WITH_JOYSTICK_EVENTS_
joystickInfo.clear();
ActiveJoysticks.clear();
const u32 numberOfJoysticks = ::joyGetNumDevs();
JOYINFOEX info;
info.dwSize = sizeof(info);
info.dwFlags = JOY_RETURNALL;
JoystickInfo activeJoystick;
SJoystickInfo returnInfo;
joystickInfo.reallocate(numberOfJoysticks);
ActiveJoysticks.reallocate(numberOfJoysticks);
u32 joystick = 0;
for(; joystick < numberOfJoysticks; ++joystick)
{
if(JOYERR_NOERROR == joyGetPosEx(joystick, &info)
&&
JOYERR_NOERROR == joyGetDevCaps(joystick,
&activeJoystick.Caps,
sizeof(activeJoystick.Caps)))
{
activeJoystick.Index = joystick;
ActiveJoysticks.push_back(activeJoystick);
returnInfo.Joystick = (u8)joystick;
returnInfo.Axes = activeJoystick.Caps.wNumAxes;
returnInfo.Buttons = activeJoystick.Caps.wNumButtons;
returnInfo.Name = activeJoystick.Caps.szPname;
returnInfo.PovHat = ((activeJoystick.Caps.wCaps & JOYCAPS_HASPOV) == JOYCAPS_HASPOV)
? SJoystickInfo::POV_HAT_PRESENT : SJoystickInfo::POV_HAT_ABSENT;
joystickInfo.push_back(returnInfo);
}
}
for(joystick = 0; joystick < joystickInfo.size(); ++joystick)
{
char logString[256];
(void)sprintf(logString, "Found joystick %d, %d axes, %d buttons '%s'",
joystick, joystickInfo[joystick].Axes,
joystickInfo[joystick].Buttons, joystickInfo[joystick].Name.c_str());
os::Printer::log(logString, ELL_INFORMATION);
}
return true;
#else
return false;
#endif // _IRR_COMPILE_WITH_JOYSTICK_EVENTS_
}
示例13: clear
void Mesh::clear()
{
flags = 0;
groupId = 0;
visgroupId = 0;
props = "";
color.clear();
position.set(0,0,0);
for(u32 s = 0; s < surfaces.size(); s++)
{
delete surfaces[s];
}
surfaces.clear();
}
示例14: setFramesDirectionSet
void CSceneNodeAnimatorTexture::setFramesDirectionSet(
u32 direction_idx, const core::array<SAnimationFrame> &frames)
{
if (direction_idx >= m_DirectionSets.size())
for (u32 d = m_DirectionSets.size(); d <= direction_idx; d++)
m_DirectionSets.push_back(core::array<SAnimationFrame>());
u32 i=0;
for (i=0; i < m_DirectionSets[direction_idx].size(); ++i)
SAFE_DROP(m_DirectionSets[direction_idx][i].Texture);
m_DirectionSets[direction_idx].set_used(0);
for (i = 0; i < frames.size(); ++i)
{
m_DirectionSets[direction_idx].push_back(frames[i]);
SAFE_GRAB(frames[i].Texture);
}
}
示例15: create
void CFontTextTag::create( IExtendedText* text, const core::stringw& tag, const core::array<core::stringw>& params )
{
if ( params.size() == 0 )
{
text->setCurrentFont( text->getDefaultFont() );
}
else
{
core::map<core::stringw,IGUIFont*>::Node* node = FontMap.find( params[0] );
if ( node != NULL )
{
text->setCurrentFont( node->getValue() );
}
}
}