void point(const MC2Point& p, ExternalRenderer* renderer) { PixelBox pBox(p + MC2Point(-1, -1), p + MC2Point(1, 1)); renderer->drawPixelBox(pBox, 0.0f, 1.0f, 0.0f, MC2Point(0, 0), 1.0f, 0.0f); }
void CNodeLocations::InsertNode(const void* apObject, EObjectShapes aObjectShape, const std::vector<wxPoint>& arCoords) { CShapeLocation* pShape = GetShape(aObjectShape, arCoords); if (pShape) { CShapeLocationPtr pBox(pShape); mNodeLocations.insert(std::make_pair(apObject, pBox)); } }
Terrain* SnowTerrain::getTerrain() { if(!mTerrainGroup) return NULL; Terrain *t = mTerrainGroup->getTerrain(0,0); return t; TerrainGroup::TerrainIterator ti = mTerrainGroup->getTerrainIterator(); while (ti.hasMoreElements()) { Ogre::uint32 tkey = ti.peekNextKey(); TerrainGroup::TerrainSlot* ts = ti.getNext(); if (ts->instance && ts->instance->isLoaded()) { float* heights = ts->instance->getHeightData(); //PixelBox* pBox = ts->instance->calculateNormals()); TexturePtr texturePtr = ts->instance->getTerrainNormalMap(); HardwarePixelBufferSharedPtr buf = texturePtr->getBuffer(); size_t bytes = buf->getSizeInBytes(); size_t h = buf->getHeight(); size_t w = buf->getWidth(); size_t d = buf->getDepth(); PixelFormat f = PF_BYTE_RGB;//buf->getFormat(); uint8* tmpData = (uint8*)OGRE_MALLOC(w * h * 3, MEMCATEGORY_GENERAL); memset(tmpData,0,w*h*3); PixelBox pBox(w, h, d, f, tmpData); buf->blitToMemory(pBox); OGRE_FREE(tmpData, MEMCATEGORY_GENERAL); } } return NULL; }
std::vector<bool> encryptionDevice::iterateBoxes(std::vector<bool> &matrix, std::vector<int> tm1, std::vector<int> tm2, std::vector<int> pos, int it, bool r) { for (int i = 0; i < it; i++) { matrix = sBox(matrix, tm1, tm2, r); matrix = pBox(matrix, pos, r); } return matrix; }