Commit 07670acf authored by hybrid's avatar hybrid

Merged 1134:1151 from branch 1.4

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@1152 dfc29bdd-3216-0410-991c-e03cc46cb475
parent 86eda333
...@@ -109,7 +109,7 @@ int main() ...@@ -109,7 +109,7 @@ int main()
*/ */
IrrlichtDevice *device = IrrlichtDevice *device =
#ifdef MACOSX #ifdef _IRR_OSX_PLATFORM_
createDevice( video::EDT_OPENGL, dimension2d<s32>(640, 480), 16, createDevice( video::EDT_OPENGL, dimension2d<s32>(640, 480), 16,
false, false, false, 0); false, false, false, 0);
#else #else
......
...@@ -33,8 +33,8 @@ namespace gui ...@@ -33,8 +33,8 @@ namespace gui
virtual u32 addItem(const wchar_t* text) = 0; virtual u32 addItem(const wchar_t* text) = 0;
//! Removes an item from the combo box. //! Removes an item from the combo box.
/** Warning. This will change the IDs of all following items */ /** Warning. This will change the index of all following items */
virtual void removeItem(u32 id) = 0; virtual void removeItem(u32 idx) = 0;
//! Deletes all items in the combo box //! Deletes all items in the combo box
virtual void clear() = 0; virtual void clear() = 0;
...@@ -43,7 +43,7 @@ namespace gui ...@@ -43,7 +43,7 @@ namespace gui
virtual s32 getSelected() const = 0; virtual s32 getSelected() const = 0;
//! Sets the selected item. Set this to -1 if no item should be selected //! Sets the selected item. Set this to -1 if no item should be selected
virtual void setSelected(s32 id) = 0; virtual void setSelected(s32 idx) = 0;
}; };
......
...@@ -14,17 +14,22 @@ ...@@ -14,17 +14,22 @@
//! _IRR_WINDOWS_API_ for Windows or XBox //! _IRR_WINDOWS_API_ for Windows or XBox
//! _IRR_LINUX_PLATFORM_ for Linux (it is defined here if no other os is defined) //! _IRR_LINUX_PLATFORM_ for Linux (it is defined here if no other os is defined)
//! _IRR_SOLARIS_PLATFORM_ for Solaris //! _IRR_SOLARIS_PLATFORM_ for Solaris
//! _IRR_OSX_PLATFORM_ for Apple systems running OSX
//! _IRR_POSIX_API_ for Posix compatible systems //! _IRR_POSIX_API_ for Posix compatible systems
//! _IRR_USE_SDL_DEVICE_ for platform independent SDL framework //! _IRR_USE_SDL_DEVICE_ for platform independent SDL framework
//! _IRR_USE_WINDOWS_DEVICE_ for Windows API based device //! _IRR_USE_WINDOWS_DEVICE_ for Windows API based device
//! _IRR_USE_WINDOWS_CE_DEVICE_ for Windows CE API based device //! _IRR_USE_WINDOWS_CE_DEVICE_ for Windows CE API based device
//! _IRR_USE_LINUX_DEVICE_ for X11 based device //! _IRR_USE_LINUX_DEVICE_ for X11 based device
//! MACOSX for Mac OS X //! _IRR_USE_OSX_DEVICE_ for Cocoa native windowing on OSX
//! Note: PLATFORM defines the OS specific layer, API can groups several platforms
//! DEVICE is the windowing system used, several PLATFORMs support more than one DEVICE
//! Moreover, the DEVICE defined here is not directly related to the Irrlicht devices created in the app (but may depend on each other).
//#define _IRR_USE_SDL_DEVICE_ 1 //#define _IRR_USE_SDL_DEVICE_ 1
//! WIN32 for Windows32 //! WIN32 for Windows32
//! WIN64 for Windows64 //! WIN64 for Windows64
// The windows platform and API support SDL and WINDOW device
#if defined(WIN32) || defined(WIN64) || defined(_WIN32_WCE) #if defined(WIN32) || defined(WIN64) || defined(_WIN32_WCE)
#define _IRR_WINDOWS_ #define _IRR_WINDOWS_
#define _IRR_WINDOWS_API_ #define _IRR_WINDOWS_API_
...@@ -33,12 +38,24 @@ ...@@ -33,12 +38,24 @@
#endif #endif
#endif #endif
// XBox only suppots the native Window stuff
#if defined(_XBOX) #if defined(_XBOX)
#define _IRR_XBOX_PLATFORM_ #define _IRR_XBOX_PLATFORM_
#define _IRR_WINDOWS_API_ #define _IRR_WINDOWS_API_
#define _IRR_USE_WINDOWS_DEVICE_
#endif
#if defined(__APPLE__) || defined(MACOSX)
#if !defined(MACOSX)
#define MACOSX // legacy support
#endif
#define _IRR_OSX_PLATFORM_
#if !defined(_IRR_USE_LINUX_DEVICE_) // for X11 windowing declare this
#define _IRR_USE_OSX_DEVICE_
#endif
#endif #endif
#if !defined(_IRR_WINDOWS_API_) && !defined(MACOSX) #if !defined(_IRR_WINDOWS_API_) && !defined(_IRR_OSX_PLATFORM_)
#if defined(__sparc__) || defined(__sun__) #if defined(__sparc__) || defined(__sun__)
#define __BIG_ENDIAN__ #define __BIG_ENDIAN__
#define _IRR_SOLARIS_PLATFORM_ #define _IRR_SOLARIS_PLATFORM_
...@@ -93,7 +110,7 @@ define out. */ ...@@ -93,7 +110,7 @@ define out. */
//! Define _IRR_OPENGL_USE_EXTPOINTER_ if the OpenGL renderer should use OpenGL extensions via function pointers. //! Define _IRR_OPENGL_USE_EXTPOINTER_ if the OpenGL renderer should use OpenGL extensions via function pointers.
/** On some systems there is no support for the dynamic extension of OpenGL /** On some systems there is no support for the dynamic extension of OpenGL
via function pointers such that this has to be undef'ed. */ via function pointers such that this has to be undef'ed. */
#if !defined(MACOSX) && !defined(_IRR_SOLARIS_PLATFORM_) #if !defined(_IRR_OSX_PLATFORM_) && !defined(_IRR_SOLARIS_PLATFORM_)
#define _IRR_OPENGL_USE_EXTPOINTER_ #define _IRR_OPENGL_USE_EXTPOINTER_
#endif #endif
...@@ -302,7 +319,7 @@ B3D, MS3D or X meshes */ ...@@ -302,7 +319,7 @@ B3D, MS3D or X meshes */
/** Irrlicht should use approximate float and integer fpu techniques /** Irrlicht should use approximate float and integer fpu techniques
precision will be lower but speed higher. currently X86 only precision will be lower but speed higher. currently X86 only
*/ */
#if !defined(MACOSX) && !defined(_IRR_SOLARIS_PLATFORM_) #if !defined(_IRR_OSX_PLATFORM_) && !defined(_IRR_SOLARIS_PLATFORM_)
//#define IRRLICHT_FAST_MATH //#define IRRLICHT_FAST_MATH
#endif #endif
......
...@@ -211,7 +211,9 @@ namespace core ...@@ -211,7 +211,9 @@ namespace core
// only same sign // only same sign
#define F32_A_GREATER_B(a,b) (F32_AS_S32((a)) > F32_AS_S32((b))) #define F32_A_GREATER_B(a,b) (F32_AS_S32((a)) > F32_AS_S32((b)))
#else #else
#define F32_LOWER_0(n) ((n) < 0.0f) #define F32_LOWER_0(n) ((n) < 0.0f)
#define F32_LOWER_EQUAL_0(n) ((n) <= 0.0f) #define F32_LOWER_EQUAL_0(n) ((n) <= 0.0f)
#define F32_GREATER_0(n) ((n) > 0.0f) #define F32_GREATER_0(n) ((n) > 0.0f)
...@@ -246,7 +248,7 @@ namespace core ...@@ -246,7 +248,7 @@ namespace core
/* /*
if (condition) state |= m; else state &= ~m; if (condition) state |= m; else state &= ~m;
*/ */
REALINLINE void setbit ( u32 &state, s32 condition, u32 mask ) REALINLINE void setbit_cond ( u32 &state, s32 condition, u32 mask )
{ {
// 0, or any postive to mask // 0, or any postive to mask
//s32 conmask = -condition >> 31; //s32 conmask = -condition >> 31;
......
...@@ -12,7 +12,7 @@ namespace irr ...@@ -12,7 +12,7 @@ namespace irr
namespace io namespace io
{ {
#if (defined(_IRR_POSIX_API_) || defined(MACOSX)) #if (defined(_IRR_POSIX_API_) || defined(_IRR_OSX_PLATFORM_))
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
...@@ -72,7 +72,7 @@ CFileList::CFileList() ...@@ -72,7 +72,7 @@ CFileList::CFileList()
// -------------------------------------------- // --------------------------------------------
// Linux version // Linux version
#if (defined(_IRR_POSIX_API_) || defined(MACOSX)) #if (defined(_IRR_POSIX_API_) || defined(_IRR_OSX_PLATFORM_))
FileEntry entry; FileEntry entry;
......
...@@ -191,7 +191,7 @@ const c8* CFileSystem::getWorkingDirectory() ...@@ -191,7 +191,7 @@ const c8* CFileSystem::getWorkingDirectory()
#endif #endif
#endif #endif
#if (defined(_IRR_POSIX_API_) || defined(MACOSX)) #if (defined(_IRR_POSIX_API_) || defined(_IRR_OSX_PLATFORM_))
getcwd(WorkingDirectory, (size_t)FILE_SYSTEM_MAX_PATH); getcwd(WorkingDirectory, (size_t)FILE_SYSTEM_MAX_PATH);
#endif #endif
return WorkingDirectory; return WorkingDirectory;
...@@ -227,7 +227,7 @@ core::stringc CFileSystem::getAbsolutePath(const core::stringc& filename) const ...@@ -227,7 +227,7 @@ core::stringc CFileSystem::getAbsolutePath(const core::stringc& filename) const
ret = p; ret = p;
#endif #endif
#elif (defined(_IRR_POSIX_API_) || defined(MACOSX)) #elif (defined(_IRR_POSIX_API_) || defined(_IRR_OSX_PLATFORM_))
c8 fpath[4096]; c8 fpath[4096];
p = realpath(filename.c_str(), fpath); p = realpath(filename.c_str(), fpath);
......
...@@ -127,12 +127,12 @@ s32 CGUIComboBox::getSelected() const ...@@ -127,12 +127,12 @@ s32 CGUIComboBox::getSelected() const
//! sets the selected item. Set this to -1 if no item should be selected //! sets the selected item. Set this to -1 if no item should be selected
void CGUIComboBox::setSelected(s32 id) void CGUIComboBox::setSelected(s32 idx)
{ {
if (id < -1 || id >= (s32)Items.size()) if (idx < -1 || idx >= (s32)Items.size())
return; return;
Selected = id; Selected = idx;
} }
void CGUIComboBox::updateAbsolutePosition() void CGUIComboBox::updateAbsolutePosition()
......
...@@ -50,7 +50,7 @@ namespace gui ...@@ -50,7 +50,7 @@ namespace gui
virtual s32 getSelected() const; virtual s32 getSelected() const;
//! sets the selected item. Set this to -1 if no item should be selected //! sets the selected item. Set this to -1 if no item should be selected
virtual void setSelected(s32 id); virtual void setSelected(s32 idx);
//! update the position //! update the position
virtual void updateAbsolutePosition(); virtual void updateAbsolutePosition();
......
This diff is collapsed.
...@@ -22,7 +22,7 @@ public: ...@@ -22,7 +22,7 @@ public:
//! Constructor //! Constructor
CMS3DMeshFileLoader(video::IVideoDriver* driver); CMS3DMeshFileLoader(video::IVideoDriver* driver);
//! returns true if the file maybe is able to be loaded by this class //! returns true if the file might be loadable by this class
//! based on the file extension (e.g. ".bsp") //! based on the file extension (e.g. ".bsp")
virtual bool isALoadableFileExtension(const c8* fileName) const; virtual bool isALoadableFileExtension(const c8* fileName) const;
...@@ -39,16 +39,6 @@ private: ...@@ -39,16 +39,6 @@ private:
bool load(io::IReadFile* file); bool load(io::IReadFile* file);
video::IVideoDriver* Driver; video::IVideoDriver* Driver;
CSkinnedMesh* AnimatedMesh; CSkinnedMesh* AnimatedMesh;
struct SGroup
{
core::stringc Name;
core::array<u16> VertexIds;
u16 MaterialIdx;
};
core::array<SGroup> Groups;
}; };
} // end namespace scene } // end namespace scene
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
#else #else
#include <string.h> #include <string.h>
#include <unistd.h> #include <unistd.h>
#ifdef MACOSX #ifdef _IRR_USE_OSX_DEVICE_
#include "OSXClipboard.h" #include "OSXClipboard.h"
#include <sys/types.h> #include <sys/types.h>
#include <sys/sysctl.h> #include <sys/sysctl.h>
...@@ -59,9 +59,10 @@ void COSOperator::copyToClipboard(const c8* text) const ...@@ -59,9 +59,10 @@ void COSOperator::copyToClipboard(const c8* text) const
CloseClipboard(); CloseClipboard();
// MacOSX version // MacOSX version
#elif defined(MACOSX) #elif defined(_IRR_USE_OSX_DEVICE_)
OSXCopyToClipboard(text); OSXCopyToClipboard(text);
#else
// todo: Linux version // todo: Linux version
#endif #endif
...@@ -84,7 +85,7 @@ c8* COSOperator::getTextFromClipboard() const ...@@ -84,7 +85,7 @@ c8* COSOperator::getTextFromClipboard() const
CloseClipboard(); CloseClipboard();
return buffer; return buffer;
#elif defined(MACOSX) #elif defined(_IRR_USE_OSX_DEVICE_)
return (OSXCopyFromClipboard()); return (OSXCopyFromClipboard());
#else #else
...@@ -121,7 +122,7 @@ bool COSOperator::getProcessorSpeedMHz(u32* MHz) const ...@@ -121,7 +122,7 @@ bool COSOperator::getProcessorSpeedMHz(u32* MHz) const
_IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX; _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX;
return true; return true;
#elif defined(MACOSX) #elif defined(_IRR_OSX_PLATFORM_)
struct clockinfo CpuClock; struct clockinfo CpuClock;
size_t Size = sizeof(clockinfo); size_t Size = sizeof(clockinfo);
......
...@@ -156,9 +156,9 @@ bool COpenGLDriver::initDriver(const core::dimension2d<s32>& screenSize, ...@@ -156,9 +156,9 @@ bool COpenGLDriver::initDriver(const core::dimension2d<s32>& screenSize,
#endif //IRR_USE_WINDOWS_DEVICE_ #endif //IRR_USE_WINDOWS_DEVICE_
// ----------------------------------------------------------------------- // -----------------------------------------------------------------------
// MACOSX CONSTRUCTOR // MacOSX CONSTRUCTOR
// ----------------------------------------------------------------------- // -----------------------------------------------------------------------
#ifdef MACOSX #ifdef _IRR_USE_OSX_DEVICE_
//! Windows constructor and init code //! Windows constructor and init code
COpenGLDriver::COpenGLDriver(const core::dimension2d<s32>& screenSize, bool fullscreen, bool stencilBuffer, CIrrDeviceMacOSX *device, io::IFileSystem* io, bool vsync, bool antiAlias) COpenGLDriver::COpenGLDriver(const core::dimension2d<s32>& screenSize, bool fullscreen, bool stencilBuffer, CIrrDeviceMacOSX *device, io::IFileSystem* io, bool vsync, bool antiAlias)
: CNullDriver(io, screenSize), COpenGLExtensionHandler(), : CNullDriver(io, screenSize), COpenGLExtensionHandler(),
...@@ -400,7 +400,7 @@ bool COpenGLDriver::endScene( s32 windowId, core::rect<s32>* sourceRect ) ...@@ -400,7 +400,7 @@ bool COpenGLDriver::endScene( s32 windowId, core::rect<s32>* sourceRect )
#elif defined(_IRR_USE_LINUX_DEVICE_) #elif defined(_IRR_USE_LINUX_DEVICE_)
glXSwapBuffers(XDisplay, XWindow); glXSwapBuffers(XDisplay, XWindow);
return true; return true;
#elif defined(MACOSX) #elif defined(_IRR_USE_OSX_DEVICE_)
_device->flush(); _device->flush();
return true; return true;
#elif defined(_IRR_USE_SDL_DEVICE_) #elif defined(_IRR_USE_SDL_DEVICE_)
...@@ -2661,7 +2661,7 @@ IVideoDriver* createOpenGLDriver(const core::dimension2d<s32>& screenSize, ...@@ -2661,7 +2661,7 @@ IVideoDriver* createOpenGLDriver(const core::dimension2d<s32>& screenSize,
// ----------------------------------- // -----------------------------------
// MACOSX VERSION // MACOSX VERSION
// ----------------------------------- // -----------------------------------
#ifdef MACOSX #if defined(_IRR_USE_OSX_DEVICE_)
IVideoDriver* createOpenGLDriver(const core::dimension2d<s32>& screenSize, IVideoDriver* createOpenGLDriver(const core::dimension2d<s32>& screenSize,
CIrrDeviceMacOSX *device, bool fullscreen, bool stencilBuffer, CIrrDeviceMacOSX *device, bool fullscreen, bool stencilBuffer,
io::IFileSystem* io, bool vsync, bool antiAlias) io::IFileSystem* io, bool vsync, bool antiAlias)
...@@ -2673,7 +2673,7 @@ IVideoDriver* createOpenGLDriver(const core::dimension2d<s32>& screenSize, ...@@ -2673,7 +2673,7 @@ IVideoDriver* createOpenGLDriver(const core::dimension2d<s32>& screenSize,
return 0; return 0;
#endif // _IRR_COMPILE_WITH_OPENGL_ #endif // _IRR_COMPILE_WITH_OPENGL_
} }
#endif // MACOSX #endif // _IRR_USE_OSX_DEVICE_
// ----------------------------------- // -----------------------------------
// LINUX VERSION // LINUX VERSION
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
#pragma comment(lib, "OpenGL32.lib") #pragma comment(lib, "OpenGL32.lib")
#pragma comment(lib, "GLu32.lib") #pragma comment(lib, "GLu32.lib")
#endif #endif
#elif defined(MACOSX) #elif defined(_IRR_USE_OSX_DEVICE_)
#include "CIrrDeviceMacOSX.h" #include "CIrrDeviceMacOSX.h"
#if defined(_IRR_OPENGL_USE_EXTPOINTER_) #if defined(_IRR_OPENGL_USE_EXTPOINTER_)
#define GL_GLEXT_LEGACY 1 #define GL_GLEXT_LEGACY 1
...@@ -84,7 +84,7 @@ namespace video ...@@ -84,7 +84,7 @@ namespace video
bool stencilBuffer, io::IFileSystem* io, bool vsync, bool antiAlias); bool stencilBuffer, io::IFileSystem* io, bool vsync, bool antiAlias);
#endif #endif
#ifdef MACOSX #ifdef _IRR_USE_OSX_DEVICE_
COpenGLDriver(const core::dimension2d<s32>& screenSize, bool fullscreen, COpenGLDriver(const core::dimension2d<s32>& screenSize, bool fullscreen,
bool stencilBuffer, CIrrDeviceMacOSX *device,io::IFileSystem* io, bool vsync, bool antiAlias); bool stencilBuffer, CIrrDeviceMacOSX *device,io::IFileSystem* io, bool vsync, bool antiAlias);
#endif #endif
...@@ -388,7 +388,7 @@ namespace video ...@@ -388,7 +388,7 @@ namespace video
#elif defined(_IRR_USE_LINUX_DEVICE_) #elif defined(_IRR_USE_LINUX_DEVICE_)
GLXDrawable XWindow; GLXDrawable XWindow;
Display* XDisplay; Display* XDisplay;
#elif defined(MACOSX) #elif defined(_IRR_USE_OSX_DEVICE_)
CIrrDeviceMacOSX *_device; CIrrDeviceMacOSX *_device;
#endif #endif
}; };
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
#ifdef _MSC_VER #ifdef _MSC_VER
#pragma comment(lib, "OpenGL32.lib") #pragma comment(lib, "OpenGL32.lib")
#endif #endif
#elif defined(MACOSX) #elif defined(_IRR_USE_OSX_DEVICE_)
#include "CIrrDeviceMacOSX.h" #include "CIrrDeviceMacOSX.h"
#if defined(_IRR_OPENGL_USE_EXTPOINTER_) #if defined(_IRR_OPENGL_USE_EXTPOINTER_)
#define GL_GLEXT_LEGACY 1 #define GL_GLEXT_LEGACY 1
......
This diff is collapsed.
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
#if defined(_IRR_OPENGL_USE_EXTPOINTER_) #if defined(_IRR_OPENGL_USE_EXTPOINTER_)
#define GL_GLEXT_LEGACY 1 #define GL_GLEXT_LEGACY 1
#endif #endif
#if defined(MACOSX) #if defined(_IRR_USE_OSX_DEVICE_)
#include <OpenGL/gl.h> #include <OpenGL/gl.h>
#else #else
#include <GL/gl.h> #include <GL/gl.h>
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
#if defined(_IRR_OPENGL_USE_EXTPOINTER_) #if defined(_IRR_OPENGL_USE_EXTPOINTER_)
#define GL_GLEXT_LEGACY 1 #define GL_GLEXT_LEGACY 1
#endif #endif
#if defined(MACOSX) #if defined(_IRR_USE_OSX_DEVICE_)
#include <OpenGL/gl.h> #include <OpenGL/gl.h>
#else #else
#include <GL/gl.h> #include <GL/gl.h>
......
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
#if defined(_IRR_OPENGL_USE_EXTPOINTER_) #if defined(_IRR_OPENGL_USE_EXTPOINTER_)
#define GL_GLEXT_LEGACY 1 #define GL_GLEXT_LEGACY 1
#endif #endif
#if defined(MACOSX) #if defined(_IRR_USE_OSX_DEVICE_)
#include <OpenGL/gl.h> #include <OpenGL/gl.h>
#else #else
#include <GL/gl.h> #include <GL/gl.h>
......
...@@ -174,13 +174,11 @@ void CPakReader::deletePathFromFilename(core::stringc& filename) ...@@ -174,13 +174,11 @@ void CPakReader::deletePathFromFilename(core::stringc& filename)
// delete path from filename // delete path from filename
const c8* p = filename.c_str() + filename.size(); const c8* p = filename.c_str() + filename.size();
// suche ein slash oder den anfang. // search for path separator or beginning
while (*p!='/' && *p!='\\' && p!=filename.c_str()) while (*p!='/' && *p!='\\' && p!=filename.c_str())
--p; --p;
core::stringc newName;
if (p != filename.c_str()) if (p != filename.c_str())
{ {
++p; ++p;
......
...@@ -515,16 +515,16 @@ const sVec4 CBurningVideoDriver::NDCPlane[6] = ...@@ -515,16 +515,16 @@ const sVec4 CBurningVideoDriver::NDCPlane[6] =
for ( u32 i = 0; i!= 6; ++i ) for ( u32 i = 0; i!= 6; ++i )
{ {
dotPlane = v->Pos.dotProduct ( NDCPlane[i] ); dotPlane = v->Pos.dotProduct ( NDCPlane[i] );
setbit ( flag, dotPlane <= 0.f, 1 << i ); core::setbit_cond( flag, dotPlane <= 0.f, 1 << i );
} }
// this is the base for ndc frustum <-w,w>,<-w,w>,<-w,w> // this is the base for ndc frustum <-w,w>,<-w,w>,<-w,w>
setbits ( flag, ( v->Pos.z - v->Pos.w ) <= 0.f, 1 ); core::setbit_cond( flag, ( v->Pos.z - v->Pos.w ) <= 0.f, 1 );
setbits ( flag, (-v->Pos.z - v->Pos.w ) <= 0.f, 2 ); core::setbit_cond( flag, (-v->Pos.z - v->Pos.w ) <= 0.f, 2 );
setbits ( flag, ( v->Pos.x - v->Pos.w ) <= 0.f, 4 ); core::setbit_cond( flag, ( v->Pos.x - v->Pos.w ) <= 0.f, 4 );
setbits ( flag, (-v->Pos.x - v->Pos.w ) <= 0.f, 8 ); core::setbit_cond( flag, (-v->Pos.x - v->Pos.w ) <= 0.f, 8 );
setbits ( flag, ( v->Pos.y - v->Pos.w ) <= 0.f, 16 ); core::setbit_cond( flag, ( v->Pos.y - v->Pos.w ) <= 0.f, 16 );
setbits ( flag, (-v->Pos.y - v->Pos.w ) <= 0.f, 32 ); core::setbit_cond( flag, (-v->Pos.y - v->Pos.w ) <= 0.f, 32 );
*/ */
#ifdef _MSC_VER #ifdef _MSC_VER
...@@ -572,7 +572,7 @@ REALINLINE u32 CBurningVideoDriver::clipToFrustumTest ( const s4DVertex * v ) c ...@@ -572,7 +572,7 @@ REALINLINE u32 CBurningVideoDriver::clipToFrustumTest ( const s4DVertex * v ) c
u32 flag = 0; u32 flag = 0;
for ( u32 i = 0; i!= 6; ++i ) for ( u32 i = 0; i!= 6; ++i )
{ {
core::setbit ( flag, v->Pos.dotProduct ( NDCPlane[i] ) <= 0.f, 1 << i ); core::setbit_cond( flag, v->Pos.dotProduct ( NDCPlane[i] ) <= 0.f, 1 << i );
} }
return flag; return flag;
} }
......
...@@ -233,7 +233,7 @@ void CXMLWriter::writeLineBreak() ...@@ -233,7 +233,7 @@ void CXMLWriter::writeLineBreak()
if (!File) if (!File)
return; return;
#if defined(MACOSX) #if defined(_IRR_OSX_PLATFORM_)
File->write(L"\r", sizeof(wchar_t)); File->write(L"\r", sizeof(wchar_t));
#elif defined(_IRR_WINDOWS_API_) #elif defined(_IRR_WINDOWS_API_)
File->write(L"\r\n", 2*sizeof(wchar_t)); File->write(L"\r\n", 2*sizeof(wchar_t));
......
...@@ -298,13 +298,11 @@ void CZipReader::deletePathFromFilename(core::stringc& filename) ...@@ -298,13 +298,11 @@ void CZipReader::deletePathFromFilename(core::stringc& filename)
// delete path from filename // delete path from filename
const c8* p = filename.c_str() + filename.size(); const c8* p = filename.c_str() + filename.size();
// suche ein slash oder den anfang. // search for path separator or beginning
while (*p!='/' && *p!='\\' && p!=filename.c_str()) while (*p!='/' && *p!='\\' && p!=filename.c_str())
--p; --p;
core::stringc newName;
if (p != filename.c_str()) if (p != filename.c_str())
{ {
++p; ++p;
......
This diff is collapsed.
This diff is collapsed.
...@@ -145,12 +145,6 @@ REALINLINE u32 if_mask_a_else_b ( const u32 mask, const u32 a, const u32 b ) ...@@ -145,12 +145,6 @@ REALINLINE u32 if_mask_a_else_b ( const u32 mask, const u32 a, const u32 b )
return ( mask & ( a ^ b ) ) ^ b; return ( mask & ( a ^ b ) ) ^ b;
} }
inline void setbits ( u32 &state, s32 condition, u32 mask )
{
state ^= ( ( -condition >> 31 ) ^ state ) & mask;
}
// ------------------ Video--------------------------------------- // ------------------ Video---------------------------------------
/*! /*!
Pixel = dest * ( 1 - alpha ) + source * alpha Pixel = dest * ( 1 - alpha ) + source * alpha
......
...@@ -21,7 +21,8 @@ ...@@ -21,7 +21,8 @@
#define bswap_32(X) ( (((X)&0x000000FF)<<24) | (((X)&0xFF000000) >> 24) | (((X)&0x0000FF00) << 8) | (((X) &0x00FF0000) >> 8)) #define bswap_32(X) ( (((X)&0x000000FF)<<24) | (((X)&0xFF000000) >> 24) | (((X)&0x0000FF00) << 8) | (((X) &0x00FF0000) >> 8))
#endif #endif
#else #else
#ifdef MACOSX #if defined(_IRR_OSX_PLATFORM_)
#include <libkern/OSByteOrder.h>
#define bswap_16(X) OSReadSwapInt16(&X,0) #define bswap_16(X) OSReadSwapInt16(&X,0)
#define bswap_32(X) OSReadSwapInt32(&X,0) #define bswap_32(X) OSReadSwapInt32(&X,0)
#elif defined(__FreeBSD__) #elif defined(__FreeBSD__)
......
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