Commit 61a5af82 authored by hybrid's avatar hybrid

Some fixes for method signature unification and some other C++ fixes.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@977 dfc29bdd-3216-0410-991c-e03cc46cb475
parent 8ac09214
......@@ -115,8 +115,8 @@ namespace scene
Vertices.reallocate(vertexCount+numVertices);
for (i=0; i<numVertices; ++i)
{
Vertices.push_back(reinterpret_cast<const T* const>(vertices)[i]);
BoundingBox.addInternalPoint(reinterpret_cast<const T* const>(vertices)[i].Pos);
Vertices.push_back(reinterpret_cast<const T*>(vertices)[i]);
BoundingBox.addInternalPoint(reinterpret_cast<const T*>(vertices)[i].Pos);
}
Indices.reallocate(getIndexCount()+numIndices);
......
......@@ -26,7 +26,7 @@ namespace scene
EMWT_COLLADA = MAKE_IRR_ID('c','o','l','l'),
//! STL mesh writer for .stl files
EMWT_STL = MAKE_IRR_ID('s','t','l',0),
EMWT_STL = MAKE_IRR_ID('s','t','l',0)
};
......
......@@ -32,7 +32,7 @@ public:
virtual void setEveryMeshVertex( bool everyMeshVertex = true ) = 0;
//! Get Mesh we're emitting particles from
virtual const IAnimatedMeshSceneNode* const getAnimatedMeshSceneNode() const = 0;
virtual const IAnimatedMeshSceneNode* getAnimatedMeshSceneNode() const = 0;
//! Get whether to use vertex normal for direction, or direction specified
virtual bool isUsingNormalDirection() const = 0;
......
......@@ -32,7 +32,7 @@ public:
virtual void setEveryMeshVertex( bool everyMeshVertex = true ) = 0;
//! Get Mesh we're emitting particles from
virtual const IMesh* const getMesh() const = 0;
virtual const IMesh* getMesh() const = 0;
//! Get whether to use vertex normal for direction, or direction specified
virtual bool isUsingNormalDirection() const = 0;
......
......@@ -88,7 +88,7 @@ struct S3DVertex
/** Usually used for geometry with lightmaps
or other special materials.
*/
struct S3DVertex2TCoords : S3DVertex
struct S3DVertex2TCoords : public S3DVertex
{
//! default constructor
S3DVertex2TCoords() : S3DVertex() {}
......@@ -150,7 +150,7 @@ struct S3DVertex2TCoords : S3DVertex
//! Vertex with a tangent and binormal vector.
/** Usually used for tangent space normal mapping.
*/
struct S3DVertexTangents : S3DVertex
struct S3DVertexTangents : public S3DVertex
{
//! default constructor
S3DVertexTangents() : S3DVertex() { }
......
......@@ -63,7 +63,7 @@ namespace scene
//! This constructor creates a view frustum based on a projection
//! and/or view matrix.
void setFrom(const core::matrix4& mat);
inline void setFrom(const core::matrix4& mat);
//! transforms the frustum by the matrix
//! \param mat: Matrix by which the view frustum is transformed.
......
......@@ -407,7 +407,7 @@ void CAnimatedMeshSceneNode::render()
material.Lighting = false;
driver->setMaterial(material);
core::matrix4 m;
core::matrix4 matr;
SMD3QuaterionTagList *taglist = ((IAnimatedMeshMD3*)Mesh)->getTagList ( (s32)getFrameNr(),
255,
......@@ -416,11 +416,11 @@ void CAnimatedMeshSceneNode::render()
);
if ( taglist )
{
for ( u32 g = 0; g != taglist->size();++g )
for ( u32 ts = 0; ts != taglist->size(); ++ts )
{
(*taglist)[g].setto ( m );
(*taglist)[ts].setto ( matr );
driver->setTransform(video::ETS_WORLD, m );
driver->setTransform(video::ETS_WORLD, matr );
for ( u32 a = 0; a != arrowMesh->getMeshBufferCount(); ++a )
driver->drawMeshBuffer ( arrowMesh->getMeshBuffer ( a ) );
......
......@@ -358,7 +358,7 @@ bool CGUIColorSelectDialog::OnEvent(const SEvent& event)
}
}
return true;
} break;
}
case EGET_ELEMENT_FOCUS_LOST:
Dragging = false;
......
......@@ -274,6 +274,7 @@ bool CGUIComboBox::OnEvent(const SEvent& event)
return true;
}
// TODO: This is dead code
if (!AbsoluteClippingRect.isPointInside(p))
{
Environment->removeFocus(this);
......
......@@ -54,7 +54,6 @@ bool CGUIModalScreen::OnEvent(const SEvent& event)
{
return IGUIElement::OnEvent(event);
}
break;
case EGET_ELEMENT_CLOSED:
// do not interfere with children being removed
return IGUIElement::OnEvent(event);
......
......@@ -158,7 +158,6 @@ bool CGUIScrollBar::OnEvent(const SEvent& event)
Dragging = false;
return true;
break;
case EMIE_MOUSE_MOVED:
if (Dragging)
{
......
......@@ -211,7 +211,7 @@ IMesh* CGeometryCreator::createTerrainMesh(video::IImage* texture,
core::position2d<s32>(core::floor32(processed.X*thRel.X), core::floor32(processed.Y*thRel.Y)),
core::dimension2d<s32>(core::floor32(blockSize.Width*thRel.X), core::floor32(blockSize.Height*thRel.Y)));
sprintf(textureName, "terrain%u_%d", tm, mesh->getMeshBufferCount());
sprintf(textureName, "terrain%u_%u", tm, mesh->getMeshBufferCount());
material.Textures[0] = driver->addTexture(textureName, img);
......
......@@ -1097,15 +1097,15 @@ void CImage::setBitMasks()
break;
case ECF_R8G8B8:
AlphaMask = 0x0;
RedMask = 0xFF<<16;
GreenMask = 0xFF<<8;
BlueMask = 0xFF;
RedMask = 0x00FF0000;
GreenMask = 0x0000FF00;
BlueMask = 0x000000FF;
break;
case ECF_A8R8G8B8:
AlphaMask = 0xFF<<24;
RedMask = 0xFF<<16;
GreenMask = 0xFF<<8;
BlueMask = 0xFF;
AlphaMask = 0xFF000000;
RedMask = 0x00FF0000;
GreenMask = 0x0000FF00;
BlueMask = 0x000000FF;
break;
}
}
......
......@@ -55,7 +55,7 @@ bool CImageWriterPPM::writeImage(io::IWriteFile *file, IImage *image,u32 param)
for (c = 0; c < imageSize.Width; ++c, ++n)
{
const video::SColor& pixel = image->getPixel(c, r);
size = snprintf(cache, 70, "%.3d %.3d %.3d%s", pixel.getRed(), pixel.getGreen(), pixel.getBlue(), n % 5 == 4 ? "\n" : " ");
size = snprintf(cache, 70, "%.3u %.3u %.3u%s", pixel.getRed(), pixel.getGreen(), pixel.getBlue(), n % 5 == 4 ? "\n" : " ");
if (file->write(cache, size) != size)
return false;
}
......
......@@ -839,7 +839,7 @@ void CNullDriver::makeColorKeyTexture(video::ITexture* texture, video::SColor co
s32 pitch = texture->getPitch() / 4;
// color with alpha enabled (color opaque)
s32 ref = (0xff<<24) | (0x00ffffff & color.color);
s32 ref = 0xff000000 | (0x00ffffff & color.color);
for (s32 y=0; y<dim.Height; ++y)
{
......
......@@ -714,7 +714,8 @@ bool COBJMeshFileLoader::retrieveVertexIndices(c8* pVertexData, s32* pIdx, const
// if no number was found index will become 0 and later on -1 by decrement
if (word[0]=='-')
{
pIdx[idxType] = -1*core::strtol10(word+1,0);
pIdx[idxType] = core::strtol10(word+1,0);
pIdx[idxType] *= -1;
switch (idxType)
{
case 0:
......
......@@ -154,7 +154,7 @@ bool COSOperator::getSystemMemory(irr::u32* Total, irr::u32* Avail) const
_IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX;
return true;
#elif defined(_IRR_POSIX_API_) // || defined(MACOSX)
#elif defined(_IRR_POSIX_API_)
long ps = sysconf(_SC_PAGESIZE);
long pp = sysconf(_SC_PHYS_PAGES);
long ap = sysconf(_SC_AVPHYS_PAGES);
......@@ -167,9 +167,10 @@ bool COSOperator::getSystemMemory(irr::u32* Total, irr::u32* Avail) const
if (Avail)
*Avail = ((ps*(long long)ap)>>10);
return true;
#endif
#else
// TODO: implement for OSX
return false;
#endif
}
......
......@@ -321,7 +321,7 @@ bool COctTreeSceneNode::createTree(IMesh* mesh)
u32 endTime = os::Timer::getRealTime();
c8 tmp[255];
sprintf(tmp, "Needed %ums to create OctTree SceneNode.(%d nodes, %d polys)",
sprintf(tmp, "Needed %ums to create OctTree SceneNode.(%u nodes, %u polys)",
endTime - beginTime, nodeCount, polyCount/3);
os::Printer::log(tmp, ELL_INFORMATION);
......
......@@ -116,7 +116,7 @@ void COctTreeTriangleSelector::constructOctTree(SOctTreeNode* node)
void COctTreeTriangleSelector::getTriangles(core::triangle3df* triangles,
s32 arraySize, s32& outTriangleCount,
const core::aabbox3d<f32>& box,
const core::matrix4* transform)
const core::matrix4* transform) const
{
core::matrix4 mat;
core::aabbox3d<f32> invbox = box;
......@@ -149,7 +149,7 @@ void COctTreeTriangleSelector::getTriangles(core::triangle3df* triangles,
void COctTreeTriangleSelector::getTrianglesFromOctTree(
SOctTreeNode* node, s32& trianglesWritten,
s32 maximumSize, const core::aabbox3d<f32>& box,
const core::matrix4* mat, core::triangle3df* triangles)
const core::matrix4* mat, core::triangle3df* triangles) const
{
if (!box.intersectsWithBox(node->Box))
return;
......@@ -179,7 +179,7 @@ void COctTreeTriangleSelector::getTrianglesFromOctTree(
//! Gets all triangles which have or may have contact with a 3d line.
void COctTreeTriangleSelector::getTriangles(core::triangle3df* triangles, s32 arraySize,
s32& outTriangleCount, const core::line3d<f32>& line,
const core::matrix4* transform)
const core::matrix4* transform) const
{
core::aabbox3d<f32> box(line.start);
box.addInternalPoint(line.end);
......
......@@ -26,12 +26,12 @@ public:
//! Gets all triangles which lie within a specific bounding box.
void getTriangles(core::triangle3df* triangles, s32 arraySize, s32& outTriangleCount,
const core::aabbox3d<f32>& box, const core::matrix4* transform=0);
const core::aabbox3d<f32>& box, const core::matrix4* transform=0) const;
//! Gets all triangles which have or may have contact with a 3d line.
virtual void getTriangles(core::triangle3df* triangles, s32 arraySize,
s32& outTriangleCount, const core::line3d<f32>& line,
const core::matrix4* transform=0);
const core::matrix4* transform=0) const;
private:
......@@ -59,7 +59,7 @@ private:
void deleteEmptyNodes(SOctTreeNode* node);
void getTrianglesFromOctTree(SOctTreeNode* node, s32& trianglesWritten, s32 maximumSize,
const core::aabbox3d<f32>& box, const core::matrix4* transform,
core::triangle3df* triangles);
core::triangle3df* triangles) const;
SOctTreeNode* Root;
s32 NodeCount;
......
......@@ -1177,8 +1177,9 @@ bool COpenGLDriver::testGLError()
os::Printer::log("GL_TABLE_TOO_LARGE", ELL_ERROR); break;
};
return true;
#endif
#else
return false;
#endif
}
......@@ -2256,7 +2257,7 @@ bool COpenGLDriver::setRenderTarget(video::ITexture* texture, bool clearBackBuff
// returns the current size of the screen or rendertarget
core::dimension2d<s32> COpenGLDriver::getCurrentRenderTargetSize()
const core::dimension2d<s32>& COpenGLDriver::getCurrentRenderTargetSize() const
{
if ( CurrentRendertargetSize.Width == 0 )
return ScreenSize;
......
......@@ -307,8 +307,8 @@ namespace video
virtual video::ITexture* createDeviceDependentTexture(IImage* surface, const char* name);
//! creates a transposed matrix in supplied GLfloat array to pass to OpenGL
void createGLMatrix(GLfloat gl_matrix[16], const core::matrix4& m);
void createGLTextureMatrix(GLfloat gl_matrix[16], const core::matrix4& m);
inline void createGLMatrix(GLfloat gl_matrix[16], const core::matrix4& m);
inline void createGLTextureMatrix(GLfloat gl_matrix[16], const core::matrix4& m);
//! sets the needed renderstates
void setRenderStates3DMode();
......@@ -317,7 +317,7 @@ namespace video
void setRenderStates2DMode(bool alpha, bool texture, bool alphaChannel);
// returns the current size of the screen or rendertarget
virtual core::dimension2d<s32> getCurrentRenderTargetSize();
virtual const core::dimension2d<s32>& getCurrentRenderTargetSize() const;
void createMaterialRenderers();
......
......@@ -60,8 +60,8 @@ void COpenGLExtensionHandler::dump() const
void COpenGLExtensionHandler::initExtensions(bool stencilBuffer)
{
const f32 ver = core::fast_atof(reinterpret_cast<const c8*>(glGetString(GL_VERSION)));
Version = core::floor32(ver)*100+core::ceil32(core::fract(ver)*10.0f);
const f32 ogl_ver = core::fast_atof(reinterpret_cast<const c8*>(glGetString(GL_VERSION)));
Version = core::floor32(ogl_ver)*100+core::ceil32(core::fract(ogl_ver)*10.0f);
if ( Version >= 102)
os::Printer::log("OpenGL driver version is 1.2 or better.", ELL_INFORMATION);
else
......@@ -80,11 +80,11 @@ void COpenGLExtensionHandler::initExtensions(bool stencilBuffer)
if (str[i] == ' ')
{
str[i] = 0;
for (u32 i=0; i<IRR_OpenGL_Feature_Count; ++i)
for (u32 j=0; i<IRR_OpenGL_Feature_Count; ++j)
{
if (!strcmp(OpenGLFeatureStrings[i], p))
if (!strcmp(OpenGLFeatureStrings[j], p))
{
FeatureAvailable[i] = true;
FeatureAvailable[j] = true;
break;
}
}
......@@ -374,8 +374,8 @@ void COpenGLExtensionHandler::initExtensions(bool stencilBuffer)
ShaderLanguageVersion = 100;
else
{
const f32 ver = core::fast_atof(reinterpret_cast<const c8*>(shaderVersion));
ShaderLanguageVersion = core::floor32(ver)*100+core::ceil32(core::fract(ver)*10.0f);
const f32 sl_ver = core::fast_atof(reinterpret_cast<const c8*>(shaderVersion));
ShaderLanguageVersion = core::floor32(sl_ver)*100+core::ceil32(core::fract(sl_ver)*10.0f);
}
}
#endif
......
......@@ -25,9 +25,9 @@ const char OPENGL_NORMAL_MAP_VSH[] =
"#input\n"\
"# 0-3: transposed world matrix;\n"\
"#;12: Light01 position \n"\
"#;13: x,y,z: Light01 color; .w: 1/LightRadius \n"\
"#;13: x,y,z: Light01 color; .w: 1/LightRadius^2 \n"\
"#;14: Light02 position \n"\
"#;15: x,y,z: Light02 color; .w: 1/LightRadius \n"\
"#;15: x,y,z: Light02 color; .w: 1/LightRadius^2 \n"\
"\n"\
"ATTRIB InPos = vertex.position;\n"\
"ATTRIB InColor = vertex.color;\n"\
......
......@@ -25,9 +25,9 @@ const char OPENGL_PARALLAX_MAP_VSH[] =
"#input\n"\
"# 0-3: transposed world matrix;\n"\
"#;12: Light01 position \n"\
"#;13: x,y,z: Light01 color; .w: 1/LightRadius \n"\
"#;13: x,y,z: Light01 color; .w: 1/LightRadius^2 \n"\
"#;14: Light02 position \n"\
"#;15: x,y,z: Light02 color; .w: 1/LightRadius \n"\
"#;15: x,y,z: Light02 color; .w: 1/LightRadius^2 \n"\
"#;16: Eye position \n"\
"\n"\
"ATTRIB InPos = vertex.position;\n"\
......
......@@ -175,7 +175,7 @@ bool COpenGLShaderMaterialRenderer::createPixelShader(const c8* pxsh)
GLint errPos;
glGetIntegerv( GL_PROGRAM_ERROR_POSITION_ARB, &errPos );
const GLubyte* errString = glGetString(GL_PROGRAM_ERROR_STRING_ARB);
const char* errString = reinterpret_cast<const char*>(glGetString(GL_PROGRAM_ERROR_STRING_ARB));
char tmp[2048];
sprintf(tmp, "Pixel shader compilation failed at position %d:\n%s", errPos, errString);
......@@ -213,7 +213,7 @@ bool COpenGLShaderMaterialRenderer::createVertexShader(const char* vtxsh)
GLint errPos;
glGetIntegerv( GL_PROGRAM_ERROR_POSITION_ARB, &errPos );
const GLubyte* errString = glGetString(GL_PROGRAM_ERROR_STRING_ARB);
const char* errString = reinterpret_cast<const char*>(glGetString(GL_PROGRAM_ERROR_STRING_ARB));
char tmp[2048];
sprintf(tmp, "Vertex shader compilation failed at position %d:\n%s", errPos, errString);
......
......@@ -21,7 +21,7 @@ namespace video
{
// helper function for render to texture
bool checkFBOStatus(COpenGLDriver* Driver);
static bool checkFBOStatus(COpenGLDriver* Driver);
//! constructor for usual textures
COpenGLTexture::COpenGLTexture(IImage* image, const char* name, COpenGLDriver* driver)
......@@ -133,7 +133,7 @@ COpenGLTexture::COpenGLTexture(const core::dimension2d<s32>& size,
// check the status
if (!checkFBOStatus(Driver))
{
printf("FBO=%d, Color=%d, Depth=%d, Stencil=%d\n",
printf("FBO=%u, Color=%u, Depth=%u, Stencil=%u\n",
ColorFrameBuffer, TextureName, DepthRenderBuffer, StencilRenderBuffer);
if (ColorFrameBuffer)
Driver->extGlDeleteFramebuffers(1, &ColorFrameBuffer);
......
......@@ -68,7 +68,7 @@ public:
virtual void setMaxStartColor( const video::SColor& color ) { MaxStartColor = color; }
//! Get Mesh we're emitting particles from
virtual const IAnimatedMeshSceneNode* const getAnimatedMeshSceneNode() const { return Node; }
virtual const IAnimatedMeshSceneNode* getAnimatedMeshSceneNode() const { return Node; }
//! Get whether to use vertex normal for direciton, or direction specified
virtual bool isUsingNormalDirection() const { return UseNormalDirection; }
......
......@@ -69,7 +69,7 @@ public:
virtual void setMaxStartColor( const video::SColor& color ) { MaxStartColor = color; }
//! Get Mesh we're emitting particles from
virtual const IMesh* const getMesh() const { return Mesh; }
virtual const IMesh* getMesh() const { return Mesh; }
//! Get whether to use vertex normal for direciton, or direction specified
virtual bool isUsingNormalDirection() const { return UseNormalDirection; }
......
......@@ -357,9 +357,9 @@ void CParticleSystemSceneNode::render()
if ( DebugDataVisible & scene::EDS_BBOX )
{
driver->setTransform(video::ETS_WORLD, AbsoluteTransformation);
video::SMaterial m;
m.Lighting = false;
driver->setMaterial(m);
video::SMaterial deb_m;
deb_m.Lighting = false;
driver->setMaterial(deb_m);
driver->draw3DBox(Buffer.BoundingBox, video::SColor(0,255,255,255));
}
}
......
......@@ -845,8 +845,8 @@ void CQ3LevelMesh::constructMesh2()
}
// there are lightmapsids and textureid with -1
s32 index = ((Faces[i].lightmapID+1) * (NumTextures+1)) + (Faces[i].textureID+1);
buffer = (SMeshBufferLightMap*) Mesh[quake3::E_Q3_MESH_GEOMETRY]->getMeshBuffer(index);
const s32 tmp_index = ((Faces[i].lightmapID+1) * (NumTextures+1)) + (Faces[i].textureID+1);
buffer = (SMeshBufferLightMap*) Mesh[quake3::E_Q3_MESH_GEOMETRY]->getMeshBuffer(tmp_index);
buffer->getMaterial() = material;
}
else
......
......@@ -321,7 +321,7 @@ namespace scene
}
};
void copy ( video::S3DVertex2TCoords * dest, const tBSPVertex * source, s32 vertexcolor ) const;
inline void copy ( video::S3DVertex2TCoords * dest, const tBSPVertex * source, s32 vertexcolor ) const;
void copy ( S3DVertex2TCoords_64 * dest, const tBSPVertex * source, s32 vertexcolor ) const;
......
......@@ -30,7 +30,7 @@ CQuake3ShaderSceneNode::CQuake3ShaderSceneNode(
this->Name = Shader->name;
// clone meshbuffer to modifiable buffer
clone ( static_cast< scene::SMeshBufferLightMap *> ( buffer ) );
cloneBuffer ( static_cast< scene::SMeshBufferLightMap *> ( buffer ) );
// load all Textures in all stages
loadTextures ( fileSystem );
......@@ -45,7 +45,7 @@ CQuake3ShaderSceneNode::~CQuake3ShaderSceneNode ()
/*
create single copies
*/
void CQuake3ShaderSceneNode::clone ( scene::SMeshBufferLightMap * buffer )
void CQuake3ShaderSceneNode::cloneBuffer ( scene::SMeshBufferLightMap * buffer )
{
Original.Material = buffer->Material;
MeshBuffer.Material = buffer->Material;
......
......@@ -58,7 +58,7 @@ private:
core::array< SQ3Texture > Q3Texture;
void loadTextures ( io::IFileSystem * fileSystem );
void clone ( scene::SMeshBufferLightMap * buffer );
void cloneBuffer ( scene::SMeshBufferLightMap * buffer );
void vertextransform_wave ( f32 dt, quake3::SModifierFunction &function );
void vertextransform_bulge( f32 dt, quake3::SModifierFunction &function );
......
......@@ -958,13 +958,12 @@ bool CSceneManager::isCulled(const ISceneNode* node)
core::aabbox3d<f32> tbox = node->getBoundingBox();
node->getAbsoluteTransformation().transformBox(tbox);
return !(tbox.intersectsWithBox(cam->getViewFrustum()->getBoundingBox() ));
};
break;
}
// can be seen by a bounding sphere
case scene::EAC_FRUSTUM_SPHERE:
{ // requires bbox diameter
};
}
break;
// can be seen by cam pyramid planes ?
......@@ -998,7 +997,7 @@ bool CSceneManager::isCulled(const ISceneNode* node)
return false;
}
break;
case scene::EAC_OFF:
break;
}
......@@ -1007,8 +1006,6 @@ bool CSceneManager::isCulled(const ISceneNode* node)
}
//! registers a node for rendering it at a specific time.
u32 CSceneManager::registerNodeForRendering(ISceneNode* node, E_SCENE_NODE_RENDER_PASS time)
{
......@@ -2036,10 +2033,10 @@ void CSceneManager::writeSceneNode(io::IXMLWriter* writer, ISceneNode* node, ISc
for (u32 i=0; i < node->getMaterialCount(); ++i)
{
io::IAttributes* attr =
io::IAttributes* tmp_attr =
getVideoDriver()->createAttributesFromMaterial(node->getMaterial(i));
attr->write(writer);
attr->drop();
tmp_attr->write(writer);
tmp_attr->drop();
}
writer->writeClosingTag(materialElement);
......
......@@ -762,7 +762,7 @@ void CSoftwareDriver::OnResize(const core::dimension2d<s32>& size)
}
//! returns the current render target size
core::dimension2d<s32> CSoftwareDriver::getCurrentRenderTargetSize()
const core::dimension2d<s32>& CSoftwareDriver::getCurrentRenderTargetSize() const
{
return RenderTargetSize;
}
......@@ -854,7 +854,7 @@ E_DRIVER_TYPE CSoftwareDriver::getDriverType() const
//! Returns the transformation set by setTransform
const core::matrix4& CSoftwareDriver::getTransform(E_TRANSFORMATION_STATE state)
const core::matrix4& CSoftwareDriver::getTransform(E_TRANSFORMATION_STATE state) const
{
return TransformationMatrix[state];
}
......
......@@ -50,7 +50,7 @@ namespace video
virtual void OnResize(const core::dimension2d<s32>& size);
//! returns size of the current render target
virtual core::dimension2d<s32> getCurrentRenderTargetSize();
virtual const core::dimension2d<s32>& getCurrentRenderTargetSize() const;
//! draws a vertex primitive list
void drawVertexPrimitiveList(const void* vertices, u32 vertexCount, const u16* indexList, u32 primitiveCount, E_VERTEX_TYPE vType, scene::E_PRIMITIVE_TYPE pType);
......@@ -86,7 +86,7 @@ namespace video
virtual E_DRIVER_TYPE getDriverType() const;
//! Returns the transformation set by setTransform
virtual const core::matrix4& getTransform(E_TRANSFORMATION_STATE state);
virtual const core::matrix4& getTransform(E_TRANSFORMATION_STATE state) const;
//! Creates a render target texture.
virtual ITexture* createRenderTargetTexture(const core::dimension2d<s32>& size, const c8* name);
......
......@@ -1656,7 +1656,7 @@ void CSoftwareDriver2::OnResize(const core::dimension2d<s32>& size)
}
//! returns the current render target size
core::dimension2d<s32> CSoftwareDriver2::getCurrentRenderTargetSize()
const core::dimension2d<s32>& CSoftwareDriver2::getCurrentRenderTargetSize() const
{
return RenderTargetSize;
}
......
......@@ -52,7 +52,7 @@ namespace video
virtual void OnResize(const core::dimension2d<s32>& size);
//! returns size of the current render target
virtual core::dimension2d<s32> getCurrentRenderTargetSize();
virtual const core::dimension2d<s32>& getCurrentRenderTargetSize() const;
//! deletes all dynamic lights there are
virtual void deleteAllDynamicLights();
......
......@@ -316,7 +316,7 @@ void CTRTextureGouraud::drawIndexedTriangleList(S2DVertex* vertices, s32 vertexC
// draw the span
if (rightx + tDiffRight - leftx - tDiffLeft)
{
f32 tmpDiv = 1.0f / (f32)(rightx - leftx);
tmpDiv = 1.0f / (f32)(rightx - leftx);
spanZStep = (s32)((rightZValue - leftZValue) * tmpDiv);
spanZValue = leftZValue+tDiffLeft*spanZStep;
......
......@@ -261,7 +261,7 @@ void CTRTextureGouraudAdd::drawIndexedTriangleList(S2DVertex* vertices, s32 vert
// draw the span
if (rightx + tDiffRight - leftx - tDiffLeft)
{
f32 tmpDiv = 1.0f / (f32)(rightx - leftx);
tmpDiv = 1.0f / (f32)(rightx - leftx);
spanZStep = (s32)((rightZValue - leftZValue) * tmpDiv);
spanZValue = leftZValue+tDiffLeft*spanZStep;
......
......@@ -232,7 +232,7 @@ public:
// draw the span
if (rightx + tDiffRight - leftx - tDiffLeft)
{
f32 tmpDiv = 1.0f / (f32)(rightx - leftx);
tmpDiv = 1.0f / (f32)(rightx - leftx);
spanStepR = (s32)((rightR - leftR) * tmpDiv);
spanR = leftR+tDiffLeft*spanStepR;
......
......@@ -25,8 +25,8 @@ CTriangleBBSelector::CTriangleBBSelector(ISceneNode* node)
//! Gets all triangles.
void CTriangleBBSelector::getTriangles(core::triangle3df* triangles,
s32 arraySize, s32& outTriangleCount,
const core::matrix4* transform)
s32 arraySize, s32& outTriangleCount,
const core::matrix4* transform) const
{
if (!SceneNode)
return;
......
......@@ -20,11 +20,9 @@ public:
//! Constructs a selector based on a mesh
CTriangleBBSelector(ISceneNode* node);
virtual ~CTriangleBBSelector() {};
//! Gets all triangles.
virtual void getTriangles(core::triangle3df* triangles, s32 arraySize, s32& outTriangleCount,
const core::matrix4* transform=0);
const core::matrix4* transform=0) const;
};
} // end namespace scene
......
......@@ -49,7 +49,7 @@ public:
protected:
ISceneNode* SceneNode;
core::array<core::triangle3df> Triangles;
mutable core::array<core::triangle3df> Triangles;
};
} // end namespace scene
......
......@@ -357,7 +357,7 @@ class CUnzipReadFile : public CReadFile
}
virtual ~CUnzipReadFile () {}
virtual const c8* getFileName()
virtual const c8* getFileName() const
{
return CallFileName.c_str ();
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment