Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion include/graphics/GraphicsDrawer.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ namespace hpl {
class cGfxBufferCompare
{
public:
bool operator()(const cGfxBufferObject& aObjectA,const cGfxBufferObject& aObjectB);
bool operator()(const cGfxBufferObject& aObjectA,const cGfxBufferObject& aObjectB) const;
};

typedef std::multiset<cGfxBufferObject,cGfxBufferCompare> tGfxBufferSet;
Expand Down
4 changes: 2 additions & 2 deletions include/graphics/Renderer2D.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,14 @@ namespace hpl {
class cRenderObject2DCompare
{
public:
bool operator()(const cRenderObject2D &aObjectA,const cRenderObject2D &aObjectB);
bool operator()(const cRenderObject2D &aObjectA,const cRenderObject2D &aObjectB) const;
};

//For transparent objects
class cRenderTransObjectCompare
{
public:
bool operator()(const cRenderObject2D &aObjectA,const cRenderObject2D &aObjectB);
bool operator()(const cRenderObject2D &aObjectA,const cRenderObject2D &aObjectB) const;
};

typedef std::multiset<cRenderObject2D,cRenderObject2DCompare> tRenderObjectSet;
Expand Down
2 changes: 1 addition & 1 deletion include/gui/GuiSet.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ namespace hpl {
class cGuiRenderObjectCompare
{
public:
bool operator()(const cGuiRenderObject& aObjectA, const cGuiRenderObject& aObjectB);
bool operator()(const cGuiRenderObject& aObjectA, const cGuiRenderObject& aObjectB) const;
};

typedef std::multiset<cGuiRenderObject,cGuiRenderObjectCompare> tGuiRenderObjectSet;
Expand Down
2 changes: 1 addition & 1 deletion sources/graphics/GraphicsDrawer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ namespace hpl {

//-----------------------------------------------------------------------

bool cGfxBufferCompare::operator()(const cGfxBufferObject& aObjectA,const cGfxBufferObject& aObjectB)
bool cGfxBufferCompare::operator()(const cGfxBufferObject& aObjectA,const cGfxBufferObject& aObjectB) const
{
if(aObjectA.GetZ() != aObjectB.GetZ())
{
Expand Down
19 changes: 12 additions & 7 deletions sources/graphics/Renderer2D.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ namespace hpl {

//-----------------------------------------------------------------------
////////////////////// RENDER OBJECT COMPARE ////////////////////////////
bool cRenderObject2DCompare::operator()(const cRenderObject2D &aObjectA,const cRenderObject2D &aObjectB)
bool cRenderObject2DCompare::operator()(const cRenderObject2D &aObjectA,const cRenderObject2D &aObjectB) const
{
if(aObjectA.GetMaterial()->GetTexture(eMaterialTexture_Diffuse) !=
aObjectB.GetMaterial()->GetTexture(eMaterialTexture_Diffuse))
Expand Down Expand Up @@ -115,7 +115,7 @@ namespace hpl {

////////////////////// TRANS RENDER OBJECT COMPARE ////////////////////////////

bool cRenderTransObjectCompare::operator()(const cRenderObject2D &aObjectA,const cRenderObject2D &aObjectB)
bool cRenderTransObjectCompare::operator()(const cRenderObject2D &aObjectA,const cRenderObject2D &aObjectB) const
{
if(aObjectA.GetZ() != aObjectB.GetZ())
{
Expand Down Expand Up @@ -895,13 +895,17 @@ namespace hpl {
//MAYBE TODO: Fix so that the shadows from different edges share vertices

// Add vertexes and indexes to the vertex batcher
mpLowLevelGraphics->AddVertexToBatch(&cVertex(vPointPos[0],ShadowColor));
mpLowLevelGraphics->AddVertexToBatch(&cVertex(vPointPos[1],ShadowColor));
cVertex v1 = cVertex(vPointPos[0],ShadowColor);
mpLowLevelGraphics->AddVertexToBatch(&v1);
cVertex v2 = cVertex(vPointPos[1],ShadowColor);
mpLowLevelGraphics->AddVertexToBatch(&v2);
mpLowLevelGraphics->AddIndexToBatch(lFirstIndex);
mpLowLevelGraphics->AddIndexToBatch(lFirstIndex+1);

mpLowLevelGraphics->AddVertexToBatch(&cVertex(vEndPos[0],ShadowColor));
mpLowLevelGraphics->AddVertexToBatch(&cVertex(vEndPos[1],ShadowColor));
cVertex v3 = cVertex(vEndPos[0],ShadowColor);
mpLowLevelGraphics->AddVertexToBatch(&v3);
cVertex v4 = cVertex(vEndPos[1],ShadowColor);
mpLowLevelGraphics->AddVertexToBatch(&v4);
mpLowLevelGraphics->AddIndexToBatch(lFirstIndex+2);

mpLowLevelGraphics->AddIndexToBatch(lFirstIndex+1);
Expand All @@ -920,7 +924,8 @@ namespace hpl {

//If we had an extra point one for triangle is needed.
if(bExtraPos){
mpLowLevelGraphics->AddVertexToBatch(&cVertex(vExtraPos,ShadowColor));
cVertex v5 = cVertex(vExtraPos,ShadowColor);
mpLowLevelGraphics->AddVertexToBatch(&v5);

mpLowLevelGraphics->AddIndexToBatch(lFirstIndex+3);
mpLowLevelGraphics->AddIndexToBatch(lFirstIndex+2);
Expand Down
2 changes: 1 addition & 1 deletion sources/gui/GuiSet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ namespace hpl {
//-----------------------------------------------------------------------

bool cGuiRenderObjectCompare::operator()( const cGuiRenderObject& aObjectA,
const cGuiRenderObject& aObjectB)
const cGuiRenderObject& aObjectB) const
{
//Z
float fZA = aObjectA.mvPos.z;
Expand Down
1 change: 1 addition & 0 deletions sources/impl/LowLevelSystemSDL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#endif

#ifndef WIN32
#include <unistd.h>
// Include FLTK
#include "FL/fl_ask.H"
#endif
Expand Down
3 changes: 2 additions & 1 deletion sources/impl/PhysicsBodyNewton.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,8 @@ namespace hpl {
if(cPhysicsBodyNewton::mbUseCallback==false) return;

cPhysicsBodyNewton *pRigidBody = static_cast<cPhysicsBodyNewton*>(apEntity);
NewtonBodySetMatrix(pRigidBody->mpNewtonBody, &apEntity->GetLocalMatrix().GetTranspose().m[0][0]);
hpl::cMatrix<float> transpose = apEntity->GetLocalMatrix().GetTranspose();
NewtonBodySetMatrix(pRigidBody->mpNewtonBody, &transpose.m[0][0]);

if(pRigidBody->mpNode) pRigidBody->mpNode->SetMatrix(apEntity->GetLocalMatrix());
}
Expand Down