Commit d428937f authored by bitplane's avatar bitplane

Fixes to compile with Borland C++

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@2289 dfc29bdd-3216-0410-991c-e03cc46cb475
parent f34c718a
......@@ -390,7 +390,7 @@ namespace quake3
TEXTURE = FUNCTION2 + 9,
LIGHTMAP = FUNCTION2 + 10,
ENVIRONMENT = FUNCTION2 + 11,
$LIGHTMAP = FUNCTION2 + 12,
DOLLAR_LIGHTMAP = FUNCTION2 + 12,
BULGE = FUNCTION2 + 13,
AUTOSPRITE = FUNCTION2 + 14,
AUTOSPRITE2 = FUNCTION2 + 15,
......
......@@ -318,6 +318,22 @@ namespace core
#endif
#endif
#if defined(__BORLANDC__) || defined (__BCPLUSPLUS__)
// 8-bit bools in borland builder
//! conditional set based on mask and arithmetic shift
REALINLINE u32 if_c_a_else_b ( const c8 condition, const u32 a, const u32 b )
{
return ( ( -condition >> 7 ) & ( a ^ b ) ) ^ b;
}
//! conditional set based on mask and arithmetic shift
REALINLINE u32 if_c_a_else_0 ( const c8 condition, const u32 a )
{
return ( -condition >> 31 ) & a;
}
#else
//! conditional set based on mask and arithmetic shift
REALINLINE u32 if_c_a_else_b ( const s32 condition, const u32 a, const u32 b )
......@@ -336,6 +352,7 @@ namespace core
{
return ( -condition >> 31 ) & a;
}
#endif
/*
if (condition) state |= m; else state &= ~m;
......
......@@ -382,7 +382,7 @@ bool CGUITreeViewNode::getSelected() const
{
if( Owner )
{
return Owner->Selected == this;
return Owner->Selected == (IGUITreeViewNode*)this;
}
else
{
......
......@@ -18,7 +18,7 @@ namespace irr
namespace video
{
#ifdef _MSC_VER
#if defined(_MSC_VER) || defined(__BORLANDC__) || defined (__BCPLUSPLUS__)
# pragma pack( push, packing )
# pragma pack( 1 )
# define PACK_STRUCT
......@@ -43,7 +43,7 @@ namespace video
u32 Value; // light
} PACK_STRUCT;
#ifdef _MSC_VER
#if defined(_MSC_VER) || defined(__BORLANDC__) || defined (__BCPLUSPLUS__)
# pragma pack( pop, packing )
#endif
#undef PACK_STRUCT
......
......@@ -153,10 +153,10 @@ IAnimatedMesh* CLWOMeshFileLoader::createMesh(io::IReadFile* file)
Mesh = new SMesh();
if (!readFileHeader())
return false;
return 0;
if (!readChunks())
return false;
return 0;
#ifdef LWO_READER_DEBUG
os::Printer::log("LWO loader: Creating geometry.");
......
......@@ -494,7 +494,7 @@ void CPLYMeshFileLoader::moveForward(u32 bytes)
StartPointer = EndPointer;
}
CPLYMeshFileLoader::E_PLY_PROPERTY_TYPE CPLYMeshFileLoader::getPropertyType(const c8* typeString) const
E_PLY_PROPERTY_TYPE CPLYMeshFileLoader::getPropertyType(const c8* typeString) const
{
if (strcmp(typeString, "char") == 0 ||
strcmp(typeString, "uchar") == 0 ||
......@@ -628,7 +628,7 @@ c8* CPLYMeshFileLoader::getNextWord()
return StartPointer;
}
// read the next float from the file and move the start pointer along
f32 CPLYMeshFileLoader::getFloat(CPLYMeshFileLoader::E_PLY_PROPERTY_TYPE t)
f32 CPLYMeshFileLoader::getFloat(E_PLY_PROPERTY_TYPE t)
{
f32 retVal = 0.0f;
......@@ -704,7 +704,7 @@ f32 CPLYMeshFileLoader::getFloat(CPLYMeshFileLoader::E_PLY_PROPERTY_TYPE t)
return retVal;
}
// read the next int from the file and move the start pointer along
u32 CPLYMeshFileLoader::getInt(CPLYMeshFileLoader::E_PLY_PROPERTY_TYPE t)
u32 CPLYMeshFileLoader::getInt(E_PLY_PROPERTY_TYPE t)
{
u32 retVal = 0;
......
......@@ -13,6 +13,17 @@ namespace irr
namespace scene
{
enum E_PLY_PROPERTY_TYPE
{
EPLYPT_INT8 = 0,
EPLYPT_INT16,
EPLYPT_INT32,
EPLYPT_FLOAT32,
EPLYPT_FLOAT64,
EPLYPT_LIST,
EPLYPT_UNKNOWN
};
//! Meshloader capable of loading obj meshes.
class CPLYMeshFileLoader : public IMeshLoader
{
......@@ -33,17 +44,6 @@ public:
private:
enum E_PLY_PROPERTY_TYPE
{
EPLYPT_INT8 = 0,
EPLYPT_INT16,
EPLYPT_INT32,
EPLYPT_FLOAT32,
EPLYPT_FLOAT64,
EPLYPT_LIST,
EPLYPT_UNKNOWN
};
struct SPLYProperty
{
core::stringc Name;
......
......@@ -1252,7 +1252,7 @@ void CQuake3ShaderSceneNode::animate( u32 stage,core::matrix4 &texture )
// "texture","lightmap","environment"
function.tcgen = function.masterfunc1;
break;
case $LIGHTMAP:
case DOLLAR_LIGHTMAP:
// map == lightmap, tcgen == lightmap
function.tcgen = LIGHTMAP;
break;
......
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