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