Commit ba385262 authored by bitplane's avatar bitplane

Had to rename some reserved words in (maybe objc++ but possibly macros to do...

Had to rename some reserved words in (maybe objc++ but possibly macros to do with xcode?) IQ3Shader::id to ID, string::verify to validate.
Put casts back into OSX driver

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@2215 dfc29bdd-3216-0410-991c-e03cc46cb475
parent 510bb72e
...@@ -637,12 +637,12 @@ namespace quake3 ...@@ -637,12 +637,12 @@ namespace quake3
struct IShader struct IShader
{ {
IShader () IShader ()
: id ( 0 ), VarGroup ( 0 ) {} : ID ( 0 ), VarGroup ( 0 ) {}
virtual ~IShader () {} virtual ~IShader () {}
void operator = (const IShader &other ) void operator = (const IShader &other )
{ {
id = other.id; ID = other.ID;
VarGroup = other.VarGroup; VarGroup = other.VarGroup;
name = other.name; name = other.name;
} }
...@@ -675,7 +675,7 @@ namespace quake3 ...@@ -675,7 +675,7 @@ namespace quake3
} }
// id // id
s32 id; s32 ID;
SVarGroupList *VarGroup; // reference SVarGroupList *VarGroup; // reference
// Shader: shader name ( also first variable in first Vargroup ) // Shader: shader name ( also first variable in first Vargroup )
......
...@@ -131,7 +131,7 @@ inline core::string<c16>& deletePathFromPath(core::string<c16>& filename, s32 pa ...@@ -131,7 +131,7 @@ inline core::string<c16>& deletePathFromPath(core::string<c16>& filename, s32 pa
if ( i ) if ( i )
{ {
filename [ i + 1 ] = 0; filename [ i + 1 ] = 0;
filename.verify(); filename.validate();
} }
return filename; return filename;
} }
......
...@@ -917,7 +917,7 @@ public: ...@@ -917,7 +917,7 @@ public:
} }
//! verify the existing string. //! verify the existing string.
void verify() void validate()
{ {
// terminate on existing null // terminate on existing null
for (u32 i=0; i<allocated; ++i) for (u32 i=0; i<allocated; ++i)
......
...@@ -268,7 +268,7 @@ const core::string<c16>& CFileSystem::getWorkingDirectory() ...@@ -268,7 +268,7 @@ const core::string<c16>& CFileSystem::getWorkingDirectory()
#endif #endif
#endif #endif
WorkingDirectory [ type ].verify(); WorkingDirectory [ type ].validate();
} }
return WorkingDirectory [ type ]; return WorkingDirectory [ type ];
......
...@@ -369,7 +369,7 @@ void CQ3LevelMesh::loadFogs(tBSPLump* l, io::IReadFile* file) ...@@ -369,7 +369,7 @@ void CQ3LevelMesh::loadFogs(tBSPLump* l, io::IReadFile* file)
shader = getShader( fog.shader ); shader = getShader( fog.shader );
t.Texture = 0; t.Texture = 0;
t.ShaderID = shader ? shader->id : -1; t.ShaderID = shader ? shader->ID : -1;
FogMap.push_back ( t ); FogMap.push_back ( t );
} }
...@@ -1536,7 +1536,7 @@ void CQ3LevelMesh::InitShader() ...@@ -1536,7 +1536,7 @@ void CQ3LevelMesh::InitShader()
element.VarGroup->VariableGroup.push_back( group ); element.VarGroup->VariableGroup.push_back( group );
element.VarGroup->VariableGroup.push_back( SVarGroup() ); element.VarGroup->VariableGroup.push_back( SVarGroup() );
element.name = element.VarGroup->VariableGroup[0].Variable[0].name; element.name = element.VarGroup->VariableGroup[0].Variable[0].name;
element.id = Shader.size(); element.ID = Shader.size();
Shader.push_back( element ); Shader.push_back( element );
if ( LoadParam.loadAllShaders ) if ( LoadParam.loadAllShaders )
...@@ -1621,7 +1621,7 @@ void CQ3LevelMesh::scriptcallback_config( SVarGroupList *& grouplist, eToken tok ...@@ -1621,7 +1621,7 @@ void CQ3LevelMesh::scriptcallback_config( SVarGroupList *& grouplist, eToken tok
grouplist->grab(); grouplist->grab();
element.VarGroup = grouplist; element.VarGroup = grouplist;
element.id = Entity.size(); element.ID = Entity.size();
Entity.push_back( element ); Entity.push_back( element );
} }
...@@ -1636,7 +1636,7 @@ void CQ3LevelMesh::scriptcallback_entity( SVarGroupList *& grouplist, eToken tok ...@@ -1636,7 +1636,7 @@ void CQ3LevelMesh::scriptcallback_entity( SVarGroupList *& grouplist, eToken tok
IEntity element; IEntity element;
element.VarGroup = grouplist; element.VarGroup = grouplist;
element.id = Entity.size(); element.ID = Entity.size();
element.name = grouplist->VariableGroup[1].get( "classname" ); element.name = grouplist->VariableGroup[1].get( "classname" );
...@@ -1656,7 +1656,7 @@ void CQ3LevelMesh::scriptcallback_shader( SVarGroupList *& grouplist,eToken toke ...@@ -1656,7 +1656,7 @@ void CQ3LevelMesh::scriptcallback_shader( SVarGroupList *& grouplist,eToken toke
grouplist->grab(); grouplist->grab();
element.VarGroup = grouplist; element.VarGroup = grouplist;
element.name = element.VarGroup->VariableGroup[0].Variable[0].name; element.name = element.VarGroup->VariableGroup[0].Variable[0].name;
element.id = Shader.size(); element.ID = Shader.size();
/* /*
core::stringc s; core::stringc s;
dumpShader ( s, &element ); dumpShader ( s, &element );
...@@ -1892,7 +1892,7 @@ void CQ3LevelMesh::loadTextures() ...@@ -1892,7 +1892,7 @@ void CQ3LevelMesh::loadTextures()
shader = getShader( Textures[t].strName, false); shader = getShader( Textures[t].strName, false);
if ( shader ) if ( shader )
{ {
Tex[t].ShaderID = shader->id; Tex[t].ShaderID = shader->ID;
// if texture name == stage1 Texture map // if texture name == stage1 Texture map
const SVarGroup * group; const SVarGroup * group;
......
...@@ -83,7 +83,7 @@ namespace irr ...@@ -83,7 +83,7 @@ namespace irr
{ {
public: public:
CCursorControl(const core::dimension2d<s32>& wsize, CIrrDeviceMacOSX *device) : WindowSize(wsize), IsVisible(true), InvWindowSize(0.0f, 0.0f), _device(device), UseReferenceRect(false) CCursorControl(const core::dimension2d<u32>& wsize, CIrrDeviceMacOSX *device) : WindowSize(wsize), IsVisible(true), InvWindowSize(0.0f, 0.0f), _device(device), UseReferenceRect(false)
{ {
CursorPos.X = CursorPos.Y = 0; CursorPos.X = CursorPos.Y = 0;
if (WindowSize.Width!=0) InvWindowSize.Width = 1.0f / WindowSize.Width; if (WindowSize.Width!=0) InvWindowSize.Width = 1.0f / WindowSize.Width;
......
...@@ -432,30 +432,31 @@ bool CIrrDeviceMacOSX::createWindow() ...@@ -432,30 +432,31 @@ bool CIrrDeviceMacOSX::createWindow()
_screenWidth = (int) CGDisplayPixelsWide(display); _screenWidth = (int) CGDisplayPixelsWide(display);
_screenHeight = (int) CGDisplayPixelsHigh(display); _screenHeight = (int) CGDisplayPixelsHigh(display);
VideoModeList.setDesktop(CreationParams.Bits,core::dimension2d<s32>(_screenWidth, _screenHeight)); VideoModeList.setDesktop(CreationParams.Bits, core::dimension2d<u32>(_screenWidth, _screenHeight));
if (!CreationParams.Fullscreen) if (!CreationParams.Fullscreen)
{ {
_window = [[NSWindow alloc] initWithContentRect:NSMakeRect(0,0,CreationParams.WindowSize.Width,CreationParams.WindowSize.Height) styleMask:NSTitledWindowMask+NSClosableWindowMask+NSResizableWindowMask backing:NSBackingStoreBuffered defer:FALSE]; _window = [[NSWindow alloc] initWithContentRect:NSMakeRect(0,0,CreationParams.WindowSize.Width,CreationParams.WindowSize.Height) styleMask:NSTitledWindowMask+NSClosableWindowMask+NSResizableWindowMask backing:NSBackingStoreBuffered defer:FALSE];
if (_window != NULL) if (_window != NULL)
{ {
NSOpenGLPixelFormatAttribute windowattribs[] = { NSOpenGLPixelFormatAttribute windowattribs[] =
{
NSOpenGLPFANoRecovery, NSOpenGLPFANoRecovery,
NSOpenGLPFAAccelerated, NSOpenGLPFAAccelerated,
NSOpenGLPFADepthSize, depthSize, NSOpenGLPFADepthSize, (NSOpenGLPixelFormatAttribute)depthSize,
NSOpenGLPFAColorSize, CreationParams.Bits, NSOpenGLPFAColorSize, (NSOpenGLPixelFormatAttribute)CreationParams.Bits,
NSOpenGLPFAAlphaSize, alphaSize, NSOpenGLPFAAlphaSize, (NSOpenGLPixelFormatAttribute)alphaSize,
NSOpenGLPFASampleBuffers, 1, NSOpenGLPFASampleBuffers, (NSOpenGLPixelFormatAttribute)1,
NSOpenGLPFASamples, CreationParams.AntiAlias, NSOpenGLPFASamples, (NSOpenGLPixelFormatAttribute)CreationParams.AntiAlias,
NSOpenGLPFAStencilSize, CreationParams.Stencilbuffer?1:0, NSOpenGLPFAStencilSize, (NSOpenGLPixelFormatAttribute)(CreationParams.Stencilbuffer?1:0),
NSOpenGLPFADoubleBuffer, NSOpenGLPFADoubleBuffer,
(NSOpenGLPixelFormatAttribute)nil (NSOpenGLPixelFormatAttribute)nil
}; };
if (CreationParams.AntiAlias<2) if (CreationParams.AntiAlias<2)
{ {
windowattribs[9] = 0; windowattribs[9] = (NSOpenGLPixelFormatAttribute)0;
windowattribs[11] = 0; windowattribs[11] = (NSOpenGLPixelFormatAttribute)0;
} }
NSOpenGLPixelFormat *format; NSOpenGLPixelFormat *format;
...@@ -466,7 +467,7 @@ bool CIrrDeviceMacOSX::createWindow() ...@@ -466,7 +467,7 @@ bool CIrrDeviceMacOSX::createWindow()
// Second try without stencilbuffer // Second try without stencilbuffer
if (CreationParams.Stencilbuffer) if (CreationParams.Stencilbuffer)
{ {
windowattribs[13]=0; windowattribs[13]=(NSOpenGLPixelFormatAttribute)0;
} }
else else
continue; continue;
...@@ -485,19 +486,19 @@ bool CIrrDeviceMacOSX::createWindow() ...@@ -485,19 +486,19 @@ bool CIrrDeviceMacOSX::createWindow()
{ {
while (!format && windowattribs[12]>1) while (!format && windowattribs[12]>1)
{ {
windowattribs -= 1; windowattribs[12] = (NSOpenGLPixelFormatAttribute)((int)windowattribs[12]-1);
format = [[NSOpenGLPixelFormat alloc] initWithAttributes:windowattribs]; format = [[NSOpenGLPixelFormat alloc] initWithAttributes:windowattribs];
} }
if (!format) if (!format)
{ {
windowattribs[9] = 0; windowattribs[9] = (NSOpenGLPixelFormatAttribute)0;
windowattribs[11] = 0; windowattribs[11] = (NSOpenGLPixelFormatAttribute)0;
format = [[NSOpenGLPixelFormat alloc] initWithAttributes:windowattribs]; format = [[NSOpenGLPixelFormat alloc] initWithAttributes:windowattribs];
if (!format) if (!format)
{ {
// reset values for next try // reset values for next try
windowattribs[9] = 1; windowattribs[9] = (NSOpenGLPixelFormatAttribute)1;
windowattribs[11] = CreationParams.AntiAlias; windowattribs[11] = (NSOpenGLPixelFormatAttribute)CreationParams.AntiAlias;
} }
else else
{ {
...@@ -626,7 +627,7 @@ void CIrrDeviceMacOSX::setResize(int width, int height) ...@@ -626,7 +627,7 @@ void CIrrDeviceMacOSX::setResize(int width, int height)
// resize the driver to the inner pane size // resize the driver to the inner pane size
NSRect driverFrame = [(NSWindow*)_window contentRectForFrameRect:[(NSWindow*)_window frame]]; NSRect driverFrame = [(NSWindow*)_window contentRectForFrameRect:[(NSWindow*)_window frame]];
getVideoDriver()->OnResize(core::dimension2d<s32>( (s32)driverFrame.size.width, (s32)driverFrame.size.height)); getVideoDriver()->OnResize(core::dimension2d<u32>( (s32)driverFrame.size.width, (s32)driverFrame.size.height));
} }
void CIrrDeviceMacOSX::createDriver() void CIrrDeviceMacOSX::createDriver()
...@@ -1308,7 +1309,7 @@ video::IVideoModeList* CIrrDeviceMacOSX::getVideoModeList() ...@@ -1308,7 +1309,7 @@ video::IVideoModeList* CIrrDeviceMacOSX::getVideoModeList()
long width = GetDictionaryLong(mode, kCGDisplayWidth); long width = GetDictionaryLong(mode, kCGDisplayWidth);
long height = GetDictionaryLong(mode, kCGDisplayHeight); long height = GetDictionaryLong(mode, kCGDisplayHeight);
// long refresh = GetDictionaryLong((mode), kCGDisplayRefreshRate); // long refresh = GetDictionaryLong((mode), kCGDisplayRefreshRate);
VideoModeList.addMode(core::dimension2d<s32>(width, height), VideoModeList.addMode(core::dimension2d<u32>(width, height),
bitsPerPixel); bitsPerPixel);
} }
} }
......
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