Commit a1ced50b authored by teella's avatar teella

Remove warnings on OSX compile submitted by Jay Riley


git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@1182 dfc29bdd-3216-0410-991c-e03cc46cb475
parent d64b5fa2
...@@ -86,17 +86,17 @@ void CIrrDeviceMacOSX::closeDevice() ...@@ -86,17 +86,17 @@ void CIrrDeviceMacOSX::closeDevice()
{ {
if (_window != NULL) if (_window != NULL)
{ {
[_window setIsVisible:FALSE]; [(NSWindow *)_window setIsVisible:FALSE];
if (_oglcontext != NULL) if (_oglcontext != NULL)
{ {
[_oglcontext clearDrawable]; [(NSOpenGLContext *)_oglcontext clearDrawable];
[_oglcontext release]; [(NSOpenGLContext *)_oglcontext release];
_oglcontext = NULL; _oglcontext = NULL;
} }
[_window setReleasedWhenClosed:TRUE]; [(NSWindow *)_window setReleasedWhenClosed:TRUE];
[_window release]; [(NSWindow *)_window release];
_window = NULL; _window = NULL;
} }
else else
...@@ -163,14 +163,14 @@ bool CIrrDeviceMacOSX::createWindow(const irr::core::dimension2d<irr::s32>& wind ...@@ -163,14 +163,14 @@ bool CIrrDeviceMacOSX::createWindow(const irr::core::dimension2d<irr::s32>& wind
if (_oglcontext != NULL) if (_oglcontext != NULL)
{ {
[_window center]; [(NSWindow *)_window center];
[_window setDelegate:[NSApp delegate]]; [(NSWindow *)_window setDelegate:[NSApp delegate]];
[_oglcontext setView:[_window contentView]]; [(NSOpenGLContext *)_oglcontext setView:[(NSWindow *)_window contentView]];
[_window setAcceptsMouseMovedEvents:TRUE]; [(NSWindow *)_window setAcceptsMouseMovedEvents:TRUE];
[_window setIsVisible:TRUE]; [(NSWindow *)_window setIsVisible:TRUE];
[_window makeKeyAndOrderFront:nil]; [(NSWindow *)_window makeKeyAndOrderFront:nil];
_cglcontext = (CGLContextObj) [_oglcontext CGLContextObj]; _cglcontext = (CGLContextObj) [(NSOpenGLContext *)_oglcontext CGLContextObj];
_width = windowSize.Width; _width = windowSize.Width;
_height = windowSize.Height; _height = windowSize.Height;
result = true; result = true;
...@@ -250,7 +250,7 @@ void CIrrDeviceMacOSX::setResize(int width,int height) ...@@ -250,7 +250,7 @@ void CIrrDeviceMacOSX::setResize(int width,int height)
{ {
_width = width; _width = width;
_height = height; _height = height;
[_oglcontext update]; [(NSOpenGLContext *)_oglcontext update];
getVideoDriver()->OnResize(core::dimension2d<s32>(width, height)); getVideoDriver()->OnResize(core::dimension2d<s32>(width, height));
} }
...@@ -319,7 +319,7 @@ bool CIrrDeviceMacOSX::run() ...@@ -319,7 +319,7 @@ bool CIrrDeviceMacOSX::run()
{ {
bzero(&ievent,sizeof(ievent)); bzero(&ievent,sizeof(ievent));
switch([event type]) switch([(NSEvent *)event type])
{ {
case NSKeyDown: case NSKeyDown:
postKeyEvent(event,ievent,true); postKeyEvent(event,ievent,true);
...@@ -364,7 +364,7 @@ bool CIrrDeviceMacOSX::run() ...@@ -364,7 +364,7 @@ bool CIrrDeviceMacOSX::run()
case NSScrollWheel: case NSScrollWheel:
ievent.EventType = irr::EET_MOUSE_INPUT_EVENT; ievent.EventType = irr::EET_MOUSE_INPUT_EVENT;
ievent.MouseInput.Event = irr::EMIE_MOUSE_WHEEL; ievent.MouseInput.Event = irr::EMIE_MOUSE_WHEEL;
ievent.MouseInput.Wheel = [event deltaY]; ievent.MouseInput.Wheel = [(NSEvent *)event deltaY];
if (ievent.MouseInput.Wheel < 1.0f) ievent.MouseInput.Wheel *= 10.0f; if (ievent.MouseInput.Wheel < 1.0f) ievent.MouseInput.Wheel *= 10.0f;
else ievent.MouseInput.Wheel *= 5.0f; else ievent.MouseInput.Wheel *= 5.0f;
postMouseEvent(event,ievent); postMouseEvent(event,ievent);
...@@ -420,7 +420,7 @@ void CIrrDeviceMacOSX::setWindowCaption(const wchar_t* text) ...@@ -420,7 +420,7 @@ void CIrrDeviceMacOSX::setWindowCaption(const wchar_t* text)
{ {
size = wcstombs(title,text,1024); size = wcstombs(title,text,1024);
if (size == 1024) title[1023] = 0; if (size == 1024) title[1023] = 0;
[_window setTitle:[NSString stringWithCString:title length:size]]; [(NSWindow *)_window setTitle:[NSString stringWithCString:title length:size]];
} }
} }
...@@ -437,7 +437,7 @@ void CIrrDeviceMacOSX::postKeyEvent(void *event,irr::SEvent &ievent,bool pressed ...@@ -437,7 +437,7 @@ void CIrrDeviceMacOSX::postKeyEvent(void *event,irr::SEvent &ievent,bool pressed
const unsigned char *cStr; const unsigned char *cStr;
BOOL skipCommand; BOOL skipCommand;
str = [event characters]; str = [(NSEvent *)event characters];
if (str != nil && [str length] > 0) if (str != nil && [str length] > 0)
{ {
mkey = mchar = 0; mkey = mchar = 0;
...@@ -453,7 +453,7 @@ void CIrrDeviceMacOSX::postKeyEvent(void *event,irr::SEvent &ievent,bool pressed ...@@ -453,7 +453,7 @@ void CIrrDeviceMacOSX::postKeyEvent(void *event,irr::SEvent &ievent,bool pressed
{ {
mchar = cStr[0]; mchar = cStr[0];
mkey = toupper(mchar); mkey = toupper(mchar);
if ([event modifierFlags] & NSCommandKeyMask) if ([(NSEvent *)event modifierFlags] & NSCommandKeyMask)
{ {
if (mkey == 'C' || mkey == 'V' || mkey == 'X') if (mkey == 'C' || mkey == 'V' || mkey == 'X')
{ {
...@@ -467,13 +467,13 @@ void CIrrDeviceMacOSX::postKeyEvent(void *event,irr::SEvent &ievent,bool pressed ...@@ -467,13 +467,13 @@ void CIrrDeviceMacOSX::postKeyEvent(void *event,irr::SEvent &ievent,bool pressed
ievent.EventType = irr::EET_KEY_INPUT_EVENT; ievent.EventType = irr::EET_KEY_INPUT_EVENT;
ievent.KeyInput.Key = (irr::EKEY_CODE)mkey; ievent.KeyInput.Key = (irr::EKEY_CODE)mkey;
ievent.KeyInput.PressedDown = pressed; ievent.KeyInput.PressedDown = pressed;
ievent.KeyInput.Shift = ([event modifierFlags] & NSShiftKeyMask) != 0; ievent.KeyInput.Shift = ([(NSEvent *)event modifierFlags] & NSShiftKeyMask) != 0;
ievent.KeyInput.Control = ([event modifierFlags] & NSControlKeyMask) != 0; ievent.KeyInput.Control = ([(NSEvent *)event modifierFlags] & NSControlKeyMask) != 0;
ievent.KeyInput.Char = (irr::EKEY_CODE)mchar; ievent.KeyInput.Char = (irr::EKEY_CODE)mchar;
if (skipCommand) if (skipCommand)
ievent.KeyInput.Control = true; ievent.KeyInput.Control = true;
else if ([event modifierFlags] & NSCommandKeyMask) else if ([(NSEvent *)event modifierFlags] & NSCommandKeyMask)
[NSApp sendEvent:(NSEvent *)event]; [NSApp sendEvent:(NSEvent *)event];
postEventFromUser(ievent); postEventFromUser(ievent);
...@@ -486,8 +486,8 @@ void CIrrDeviceMacOSX::postMouseEvent(void *event,irr::SEvent &ievent) ...@@ -486,8 +486,8 @@ void CIrrDeviceMacOSX::postMouseEvent(void *event,irr::SEvent &ievent)
if (_window != NULL) if (_window != NULL)
{ {
ievent.MouseInput.X = (int)[event locationInWindow].x; ievent.MouseInput.X = (int)[(NSEvent *)event locationInWindow].x;
ievent.MouseInput.Y = _height - (int)[event locationInWindow].y; ievent.MouseInput.Y = _height - (int)[(NSEvent *)event locationInWindow].y;
if (ievent.MouseInput.Y < 0) post = false; if (ievent.MouseInput.Y < 0) post = false;
} }
else else
...@@ -509,7 +509,7 @@ void CIrrDeviceMacOSX::storeMouseLocation() ...@@ -509,7 +509,7 @@ void CIrrDeviceMacOSX::storeMouseLocation()
if (_window != NULL) if (_window != NULL)
{ {
p = [_window convertScreenToBase:p]; p = [(NSWindow *)_window convertScreenToBase:p];
x = (int)p.x; x = (int)p.x;
y = _height - (int)p.y; y = _height - (int)p.y;
} }
...@@ -531,7 +531,7 @@ void CIrrDeviceMacOSX::setMouseLocation(int x,int y) ...@@ -531,7 +531,7 @@ void CIrrDeviceMacOSX::setMouseLocation(int x,int y)
{ {
p.x = (float) x; p.x = (float) x;
p.y = (float) (_height - y); p.y = (float) (_height - y);
p = [_window convertBaseToScreen:p]; p = [(NSWindow *)_window convertBaseToScreen:p];
p.y = _screenHeight - p.y; p.y = _screenHeight - p.y;
} }
else else
......
...@@ -1159,7 +1159,7 @@ ...@@ -1159,7 +1159,7 @@
4C53E18D0A484C2C0014E966 /* uncompr.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = uncompr.c; sourceTree = "<group>"; }; 4C53E18D0A484C2C0014E966 /* uncompr.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = uncompr.c; sourceTree = "<group>"; };
4C53E1920A484C2C0014E966 /* zutil.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = zutil.c; sourceTree = "<group>"; }; 4C53E1920A484C2C0014E966 /* zutil.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = zutil.c; sourceTree = "<group>"; };
4C53E24D0A4850120014E966 /* libIrrlicht.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libIrrlicht.a; sourceTree = BUILT_PRODUCTS_DIR; }; 4C53E24D0A4850120014E966 /* libIrrlicht.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libIrrlicht.a; sourceTree = BUILT_PRODUCTS_DIR; };
4C53E2520A4850550014E966 /* Quake3Map.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Quake3Map.app; sourceTree = BUILT_PRODUCTS_DIR; }; 4C53E2520A4850550014E966 /* Quake3Map.app */ = {isa = PBXFileReference; includeInIndex = 0; lastKnownFileType = wrapper.application; path = Quake3Map.app; sourceTree = BUILT_PRODUCTS_DIR; };
4C53E26D0A4850D60014E966 /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = "<absolute>"; }; 4C53E26D0A4850D60014E966 /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = "<absolute>"; };
4C53E26E0A4850D60014E966 /* OpenGL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGL.framework; path = /System/Library/Frameworks/OpenGL.framework; sourceTree = "<absolute>"; }; 4C53E26E0A4850D60014E966 /* OpenGL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGL.framework; path = /System/Library/Frameworks/OpenGL.framework; sourceTree = "<absolute>"; };
4C53E38E0A4855BA0014E966 /* DemoApp-Info.plist */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.xml; path = "DemoApp-Info.plist"; sourceTree = "<group>"; }; 4C53E38E0A4855BA0014E966 /* DemoApp-Info.plist */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.xml; path = "DemoApp-Info.plist"; sourceTree = "<group>"; };
......
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