diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2011-06-28 19:00:42 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2011-06-28 19:00:42 +0400 |
commit | d18d37d25f320f4dbe2ac1ef664c14ecd173719e (patch) | |
tree | 6460f76579536eb5096ab19c2b8f541bfa29591c /intern | |
parent | 6b2e35c8b7474eeae92551060b05036658cc1837 (diff) | |
parent | a05b66defb14de86fa9845e16c0a8557a7a28723 (diff) |
Cycles: svn merge -r37694:37904 https://svn.blender.org/svnroot/bf-blender/trunk/blender
Diffstat (limited to 'intern')
-rw-r--r-- | intern/CMakeLists.txt | 5 | ||||
-rw-r--r-- | intern/ffmpeg/ffmpeg_compat.h | 2 | ||||
-rw-r--r-- | intern/ghost/intern/GHOST_DisplayManagerCocoa.mm | 2 | ||||
-rw-r--r-- | intern/ghost/intern/GHOST_SystemCocoa.h | 8 | ||||
-rw-r--r-- | intern/ghost/intern/GHOST_SystemCocoa.mm | 77 | ||||
-rw-r--r-- | intern/ghost/intern/GHOST_Window.cpp | 3 | ||||
-rw-r--r-- | intern/ghost/intern/GHOST_Window.h | 6 | ||||
-rw-r--r-- | intern/ghost/intern/GHOST_WindowCarbon.cpp | 2 | ||||
-rw-r--r-- | intern/ghost/intern/GHOST_WindowCocoa.h | 25 | ||||
-rw-r--r-- | intern/ghost/intern/GHOST_WindowCocoa.mm | 51 | ||||
-rw-r--r-- | intern/ghost/intern/GHOST_WindowWin32.cpp | 2 | ||||
-rw-r--r-- | intern/ghost/intern/GHOST_WindowX11.cpp | 2 | ||||
-rw-r--r-- | intern/iksolver/intern/IK_QSegment.cpp | 3 | ||||
-rw-r--r-- | intern/itasc/ConstraintSet.cpp | 1 |
14 files changed, 109 insertions, 80 deletions
diff --git a/intern/CMakeLists.txt b/intern/CMakeLists.txt index f731b7be46c..fca5e7fdf7d 100644 --- a/intern/CMakeLists.txt +++ b/intern/CMakeLists.txt @@ -24,7 +24,6 @@ # # ***** END GPL LICENSE BLOCK ***** -add_subdirectory(audaspace) add_subdirectory(string) add_subdirectory(ghost) add_subdirectory(guardedalloc) @@ -35,6 +34,10 @@ add_subdirectory(opennl) add_subdirectory(smoke) add_subdirectory(mikktspace) +if(WITH_AUDASPACE) + add_subdirectory(audaspace) +endif() + if(WITH_MOD_FLUID) add_subdirectory(elbeem) endif() diff --git a/intern/ffmpeg/ffmpeg_compat.h b/intern/ffmpeg/ffmpeg_compat.h index ab819f41ac3..d8edffbfe0b 100644 --- a/intern/ffmpeg/ffmpeg_compat.h +++ b/intern/ffmpeg/ffmpeg_compat.h @@ -40,7 +40,7 @@ #define FFMPEG_HAVE_AVIO 1 #endif -#if (LIBAVCODEC_VERSION_MAJOR > 53) || ((LIBAVCODEC_VERSION_MAJOR == 53) && (LIBAVCODEC_VERSION_MINOR > 1)) || ((LIBAVCODEC_VERSION_MAJOR == 53) && (LIBAVCODEC_VERSION_MINOR == 1) && (LIBAVCODEC_VERSION_MICRO >= 1)) +#if (LIBAVCODEC_VERSION_MAJOR > 53) || ((LIBAVCODEC_VERSION_MAJOR == 53) && (LIBAVCODEC_VERSION_MINOR > 1)) || ((LIBAVCODEC_VERSION_MAJOR == 53) && (LIBAVCODEC_VERSION_MINOR == 1) && (LIBAVCODEC_VERSION_MICRO >= 1)) || ((LIBAVCODEC_VERSION_MAJOR == 52) && (LIBAVCODEC_VERSION_MINOR >= 122)) #define FFMPEG_HAVE_DEFAULT_VAL_UNION 1 #endif diff --git a/intern/ghost/intern/GHOST_DisplayManagerCocoa.mm b/intern/ghost/intern/GHOST_DisplayManagerCocoa.mm index ab3abdd659f..86f5f4cdddb 100644 --- a/intern/ghost/intern/GHOST_DisplayManagerCocoa.mm +++ b/intern/ghost/intern/GHOST_DisplayManagerCocoa.mm @@ -164,5 +164,5 @@ GHOST_TSuccess GHOST_DisplayManagerCocoa::setCurrentDisplaySetting(GHOST_TUns8 d //CGDisplayErr err = ::CGDisplaySwitchToMode(m_displayIDs[display], displayModeValues); - return /*err == CGDisplayNoErr ? GHOST_kSuccess :*/ GHOST_kFailure; + return /*err == CGDisplayNoErr ?*/ GHOST_kSuccess /*: GHOST_kFailure*/; } diff --git a/intern/ghost/intern/GHOST_SystemCocoa.h b/intern/ghost/intern/GHOST_SystemCocoa.h index e7a8178a382..ce777358389 100644 --- a/intern/ghost/intern/GHOST_SystemCocoa.h +++ b/intern/ghost/intern/GHOST_SystemCocoa.h @@ -119,14 +119,6 @@ public: const GHOST_TEmbedderWindowID parentWindow = 0 ); - virtual GHOST_TSuccess beginFullScreen( - const GHOST_DisplaySetting& setting, - GHOST_IWindow** window, - const bool stereoVisual - ); - - virtual GHOST_TSuccess endFullScreen( void ); - /*************************************************************************************** ** Event management functionality ***************************************************************************************/ diff --git a/intern/ghost/intern/GHOST_SystemCocoa.mm b/intern/ghost/intern/GHOST_SystemCocoa.mm index bf401138cf1..69423f2dfbf 100644 --- a/intern/ghost/intern/GHOST_SystemCocoa.mm +++ b/intern/ghost/intern/GHOST_SystemCocoa.mm @@ -741,11 +741,13 @@ GHOST_IWindow* GHOST_SystemCocoa::createWindow( NSRect contentRect = [NSWindow contentRectForFrameRect:frame styleMask:(NSTitledWindowMask | NSClosableWindowMask | NSMiniaturizableWindowMask)]; + GHOST_TInt32 bottom = (contentRect.size.height - 1) - height - top; + //Ensures window top left is inside this available rect left = left > contentRect.origin.x ? left : contentRect.origin.x; - top = top > contentRect.origin.y ? top : contentRect.origin.y; - - window = new GHOST_WindowCocoa (this, title, left, top, width, height, state, type, stereoVisual, numOfAASamples); + bottom = bottom > contentRect.origin.y ? bottom : contentRect.origin.y; + + window = new GHOST_WindowCocoa (this, title, left, bottom, width, height, state, type, stereoVisual, numOfAASamples); if (window) { if (window->getValid()) { @@ -771,26 +773,6 @@ GHOST_IWindow* GHOST_SystemCocoa::createWindow( return window; } -GHOST_TSuccess GHOST_SystemCocoa::beginFullScreen(const GHOST_DisplaySetting& setting, GHOST_IWindow** window, const bool stereoVisual) -{ - GHOST_IWindow* currentWindow = m_windowManager->getActiveWindow(); - *window = currentWindow; - - if(!currentWindow) return GHOST_kFailure; - - return currentWindow->setState(GHOST_kWindowStateFullScreen); -} - -GHOST_TSuccess GHOST_SystemCocoa::endFullScreen(void) -{ - GHOST_IWindow* currentWindow = m_windowManager->getActiveWindow(); - if(!currentWindow) return GHOST_kFailure; - - return currentWindow->setState(GHOST_kWindowStateNormal); -} - - - /** * @note : returns coordinates in Cocoa screen coordinates */ @@ -809,7 +791,6 @@ GHOST_TSuccess GHOST_SystemCocoa::getCursorPosition(GHOST_TInt32& x, GHOST_TInt3 */ GHOST_TSuccess GHOST_SystemCocoa::setCursorPosition(GHOST_TInt32 x, GHOST_TInt32 y) { - GHOST_TInt32 wx,wy; GHOST_WindowCocoa* window = (GHOST_WindowCocoa*)m_windowManager->getActiveWindow(); if (!window) return GHOST_kFailure; @@ -820,8 +801,7 @@ GHOST_TSuccess GHOST_SystemCocoa::setCursorPosition(GHOST_TInt32 x, GHOST_TInt32 CGAssociateMouseAndMouseCursorPosition(true); //Force mouse move event (not pushed by Cocoa) - window->screenToClient(x, y, wx, wy); - pushEvent(new GHOST_EventCursor(getMilliSeconds(), GHOST_kEventCursorMove, window, wx,wy)); + pushEvent(new GHOST_EventCursor(getMilliSeconds(), GHOST_kEventCursorMove, window, x, y)); m_outsideLoopEventProcessed = true; return GHOST_kSuccess; @@ -1433,9 +1413,9 @@ GHOST_TSuccess GHOST_SystemCocoa::handleTabletEvent(void *eventPtr, short eventT GHOST_TSuccess GHOST_SystemCocoa::handleMouseEvent(void *eventPtr) { NSEvent *event = (NSEvent *)eventPtr; - GHOST_Window* window; + GHOST_WindowCocoa* window; - window = (GHOST_Window*)m_windowManager->getWindowAssociatedWithOSWindow((void*)[event window]); + window = (GHOST_WindowCocoa*)m_windowManager->getWindowAssociatedWithOSWindow((void*)[event window]); if (!window) { //printf("\nW failure for event 0x%x",[event type]); return GHOST_kFailure; @@ -1499,7 +1479,7 @@ GHOST_TSuccess GHOST_SystemCocoa::handleMouseEvent(void *eventPtr) switch (window->getCursorGrabMode()) { case GHOST_kGrabHide: //Cursor hidden grab operation : no cursor move { - GHOST_TInt32 x_warp, y_warp, x_accum, y_accum; + GHOST_TInt32 x_warp, y_warp, x_accum, y_accum, x, y; window->getCursorGrabInitPos(x_warp, y_warp); @@ -1508,7 +1488,8 @@ GHOST_TSuccess GHOST_SystemCocoa::handleMouseEvent(void *eventPtr) y_accum += -[event deltaY]; //Strange Apple implementation (inverted coordinates for the deltaY) ... window->setCursorGrabAccum(x_accum, y_accum); - pushEvent(new GHOST_EventCursor([event timestamp]*1000, GHOST_kEventCursorMove, window, x_warp+x_accum, y_warp+y_accum)); + window->clientToScreenIntern(x_warp+x_accum, y_warp+y_accum, x, y); + pushEvent(new GHOST_EventCursor([event timestamp]*1000, GHOST_kEventCursorMove, window, x, y)); } break; case GHOST_kGrabWrap: //Wrap cursor at area/window boundaries @@ -1516,19 +1497,16 @@ GHOST_TSuccess GHOST_SystemCocoa::handleMouseEvent(void *eventPtr) NSPoint mousePos = [event locationInWindow]; GHOST_TInt32 x_mouse= mousePos.x; GHOST_TInt32 y_mouse= mousePos.y; - GHOST_TInt32 x_accum, y_accum, x_cur, y_cur; - GHOST_Rect bounds, windowBounds, correctedBounds; + GHOST_TInt32 x_accum, y_accum, x_cur, y_cur, x, y; + GHOST_Rect bounds, correctedBounds; /* fallback to window bounds */ if(window->getCursorGrabBounds(bounds)==GHOST_kFailure) window->getClientBounds(bounds); //Switch back to Cocoa coordinates orientation (y=0 at botton,the same as blender internal btw!), and to client coordinates - window->getClientBounds(windowBounds); - window->screenToClient(bounds.m_l,bounds.m_b, correctedBounds.m_l, correctedBounds.m_t); - window->screenToClient(bounds.m_r, bounds.m_t, correctedBounds.m_r, correctedBounds.m_b); - correctedBounds.m_b = (windowBounds.m_b - windowBounds.m_t) - correctedBounds.m_b; - correctedBounds.m_t = (windowBounds.m_b - windowBounds.m_t) - correctedBounds.m_t; + window->screenToClient(bounds.m_l, bounds.m_b, correctedBounds.m_l, correctedBounds.m_b); + window->screenToClient(bounds.m_r, bounds.m_t, correctedBounds.m_r, correctedBounds.m_t); //Update accumulation counts window->getCursorGrabAccum(x_accum, y_accum); @@ -1547,19 +1525,24 @@ GHOST_TSuccess GHOST_SystemCocoa::handleMouseEvent(void *eventPtr) m_cursorDelta_y = y_mouse-mousePos.y; //Set new cursor position - window->clientToScreen(x_mouse, y_mouse, x_cur, y_cur); + window->clientToScreenIntern(x_mouse, y_mouse, x_cur, y_cur); setMouseCursorPosition(x_cur, y_cur); /* wrap */ //Post event window->getCursorGrabInitPos(x_cur, y_cur); - pushEvent(new GHOST_EventCursor([event timestamp]*1000, GHOST_kEventCursorMove, window, x_cur + x_accum, y_cur + y_accum)); + window->clientToScreenIntern(x_cur + x_accum, y_cur + y_accum, x, y); + pushEvent(new GHOST_EventCursor([event timestamp]*1000, GHOST_kEventCursorMove, window, x, y)); } break; default: { //Normal cursor operation: send mouse position in window NSPoint mousePos = [event locationInWindow]; - pushEvent(new GHOST_EventCursor([event timestamp]*1000, GHOST_kEventCursorMove, window, mousePos.x, mousePos.y)); + GHOST_TInt32 x, y; + + window->clientToScreenIntern(mousePos.x, mousePos.y, x, y); + pushEvent(new GHOST_EventCursor([event timestamp]*1000, GHOST_kEventCursorMove, window, x, y)); + m_cursorDelta_x=0; m_cursorDelta_y=0; //Mouse motion occurred between two cursor warps, so we can reset the delta counter } @@ -1581,6 +1564,7 @@ GHOST_TSuccess GHOST_SystemCocoa::handleMouseEvent(void *eventPtr) } else { NSPoint mousePos = [event locationInWindow]; + GHOST_TInt32 x, y; double dx = [event deltaX]; double dy = -[event deltaY]; @@ -1597,7 +1581,10 @@ GHOST_TSuccess GHOST_SystemCocoa::handleMouseEvent(void *eventPtr) if (dy<0.0) dy-=0.5; else dy+=0.5; if (dy< -deltaMax) dy= -deltaMax; else if (dy>deltaMax) dy=deltaMax; - pushEvent(new GHOST_EventTrackpad([event timestamp]*1000, window, GHOST_kTrackpadEventScroll, mousePos.x, mousePos.y, dx, dy)); + window->clientToScreenIntern(mousePos.x, mousePos.y, x, y); + dy = -dy; + + pushEvent(new GHOST_EventTrackpad([event timestamp]*1000, window, GHOST_kTrackpadEventScroll, x, y, dx, dy)); } } break; @@ -1605,7 +1592,9 @@ GHOST_TSuccess GHOST_SystemCocoa::handleMouseEvent(void *eventPtr) case NSEventTypeMagnify: { NSPoint mousePos = [event locationInWindow]; - pushEvent(new GHOST_EventTrackpad([event timestamp]*1000, window, GHOST_kTrackpadEventMagnify, mousePos.x, mousePos.y, + GHOST_TInt32 x, y; + window->clientToScreenIntern(mousePos.x, mousePos.y, x, y); + pushEvent(new GHOST_EventTrackpad([event timestamp]*1000, window, GHOST_kTrackpadEventMagnify, x, y, [event magnification]*250.0 + 0.1, 0)); } break; @@ -1613,7 +1602,9 @@ GHOST_TSuccess GHOST_SystemCocoa::handleMouseEvent(void *eventPtr) case NSEventTypeRotate: { NSPoint mousePos = [event locationInWindow]; - pushEvent(new GHOST_EventTrackpad([event timestamp]*1000, window, GHOST_kTrackpadEventRotate, mousePos.x, mousePos.y, + GHOST_TInt32 x, y; + window->clientToScreenIntern(mousePos.x, mousePos.y, x, y); + pushEvent(new GHOST_EventTrackpad([event timestamp]*1000, window, GHOST_kTrackpadEventRotate, x, y, -[event rotation] * 5.0, 0)); } case NSEventTypeBeginGesture: diff --git a/intern/ghost/intern/GHOST_Window.cpp b/intern/ghost/intern/GHOST_Window.cpp index c518272d614..e34bfe7ff26 100644 --- a/intern/ghost/intern/GHOST_Window.cpp +++ b/intern/ghost/intern/GHOST_Window.cpp @@ -41,8 +41,7 @@ GHOST_Window::GHOST_Window( - const STR_String& /*title*/, - GHOST_TInt32 /*left*/, GHOST_TInt32 /*top*/, GHOST_TUns32 width, GHOST_TUns32 height, + GHOST_TUns32 width, GHOST_TUns32 height, GHOST_TWindowState state, GHOST_TDrawingContextType type, const bool stereoVisual, diff --git a/intern/ghost/intern/GHOST_Window.h b/intern/ghost/intern/GHOST_Window.h index e0c676f53a5..66990abb555 100644 --- a/intern/ghost/intern/GHOST_Window.h +++ b/intern/ghost/intern/GHOST_Window.h @@ -76,9 +76,6 @@ public: * Constructor. * Creates a new window and opens it. * To check if the window was created properly, use the getValid() method. - * @param title The text shown in the title bar of the window. - * @param left The coordinate of the left edge of the window. - * @param top The coordinate of the top edge of the window. * @param width The width the window. * @param heigh The height the window. * @param state The state the window is initially opened with. @@ -87,9 +84,6 @@ public: * @param numOfAASamples Number of samples used for AA (zero if no AA) */ GHOST_Window( - const STR_String& title, - GHOST_TInt32 left, - GHOST_TInt32 top, GHOST_TUns32 width, GHOST_TUns32 height, GHOST_TWindowState state, diff --git a/intern/ghost/intern/GHOST_WindowCarbon.cpp b/intern/ghost/intern/GHOST_WindowCarbon.cpp index 1ffd117d658..c8bd67f9a5c 100644 --- a/intern/ghost/intern/GHOST_WindowCarbon.cpp +++ b/intern/ghost/intern/GHOST_WindowCarbon.cpp @@ -102,7 +102,7 @@ GHOST_WindowCarbon::GHOST_WindowCarbon( const bool stereoVisual, const GHOST_TUns16 numOfAASamples ) : - GHOST_Window(title, left, top, width, height, state, GHOST_kDrawingContextTypeNone), + GHOST_Window(width, height, state, GHOST_kDrawingContextTypeNone), m_windowRef(0), m_grafPtr(0), m_aglCtx(0), diff --git a/intern/ghost/intern/GHOST_WindowCocoa.h b/intern/ghost/intern/GHOST_WindowCocoa.h index 98e0f9cedd1..ce28f8c4538 100644 --- a/intern/ghost/intern/GHOST_WindowCocoa.h +++ b/intern/ghost/intern/GHOST_WindowCocoa.h @@ -42,6 +42,7 @@ #include "STR_String.h" @class CocoaWindow; +@class CocoaOpenGLView; class GHOST_SystemCocoa; @@ -77,7 +78,7 @@ public: GHOST_SystemCocoa *systemCocoa, const STR_String& title, GHOST_TInt32 left, - GHOST_TInt32 top, + GHOST_TInt32 bottom, GHOST_TUns32 width, GHOST_TUns32 height, GHOST_TWindowState state, @@ -181,6 +182,26 @@ public: virtual void clientToScreen(GHOST_TInt32 inX, GHOST_TInt32 inY, GHOST_TInt32& outX, GHOST_TInt32& outY) const; /** + * Converts a point in screen coordinates to client rectangle coordinates + * but without the y coordinate conversion needed for ghost compatibility. + * @param inX The x-coordinate in the client rectangle. + * @param inY The y-coordinate in the client rectangle. + * @param outX The x-coordinate on the screen. + * @param outY The y-coordinate on the screen. + */ + void clientToScreenIntern(GHOST_TInt32 inX, GHOST_TInt32 inY, GHOST_TInt32& outX, GHOST_TInt32& outY) const; + + /** + * Converts a point in screen coordinates to client rectangle coordinates, + * but without the y coordinate conversion needed for ghost compatibility. + * @param inX The x-coordinate in the client rectangle. + * @param inY The y-coordinate in the client rectangle. + * @param outX The x-coordinate on the screen. + * @param outY The y-coordinate on the screen. + */ + void screenToClientIntern(GHOST_TInt32 inX, GHOST_TInt32 inY, GHOST_TInt32& outX, GHOST_TInt32& outY) const; + + /** * Gets the screen the window is displayed in * @return The NSScreen object */ @@ -289,7 +310,7 @@ protected: CocoaWindow *m_window; /** The openGL view */ - NSOpenGLView *m_openGLView; + CocoaOpenGLView *m_openGLView; /** The opgnGL drawing context */ NSOpenGLContext *m_openGLContext; diff --git a/intern/ghost/intern/GHOST_WindowCocoa.mm b/intern/ghost/intern/GHOST_WindowCocoa.mm index fb7d4a459c7..937dffe9fba 100644 --- a/intern/ghost/intern/GHOST_WindowCocoa.mm +++ b/intern/ghost/intern/GHOST_WindowCocoa.mm @@ -241,10 +241,19 @@ extern "C" { //We need to subclass it in order to give Cocoa the feeling key events are trapped @interface CocoaOpenGLView : NSOpenGLView { + GHOST_SystemCocoa *systemCocoa; + GHOST_WindowCocoa *associatedWindow; } +- (void)setSystemAndWindowCocoa:(GHOST_SystemCocoa *)sysCocoa windowCocoa:(GHOST_WindowCocoa *)winCocoa; @end @implementation CocoaOpenGLView +- (void)setSystemAndWindowCocoa:(GHOST_SystemCocoa *)sysCocoa windowCocoa:(GHOST_WindowCocoa *)winCocoa +{ + systemCocoa = sysCocoa; + associatedWindow = winCocoa; +} + - (BOOL)acceptsFirstResponder { return YES; @@ -294,6 +303,7 @@ extern "C" { else { [super drawRect:rect]; + systemCocoa->handleWindowEvent(GHOST_kEventWindowUpdate, associatedWindow); } } @@ -308,14 +318,14 @@ GHOST_WindowCocoa::GHOST_WindowCocoa( GHOST_SystemCocoa *systemCocoa, const STR_String& title, GHOST_TInt32 left, - GHOST_TInt32 top, + GHOST_TInt32 bottom, GHOST_TUns32 width, GHOST_TUns32 height, GHOST_TWindowState state, GHOST_TDrawingContextType type, const bool stereoVisual, const GHOST_TUns16 numOfAASamples ) : - GHOST_Window(title, left, top, width, height, state, GHOST_kDrawingContextTypeNone, stereoVisual, numOfAASamples), + GHOST_Window(width, height, state, GHOST_kDrawingContextTypeNone, stereoVisual, numOfAASamples), m_customCursor(0) { NSOpenGLPixelFormatAttribute pixelFormatAttrsWindow[40]; @@ -327,13 +337,12 @@ GHOST_WindowCocoa::GHOST_WindowCocoa( NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - //Creates the window NSRect rect; NSSize minSize; rect.origin.x = left; - rect.origin.y = top; + rect.origin.y = bottom; rect.size.width = width; rect.size.height = height; @@ -425,6 +434,8 @@ GHOST_WindowCocoa::GHOST_WindowCocoa( //Creates the OpenGL View inside the window m_openGLView = [[CocoaOpenGLView alloc] initWithFrame:rect pixelFormat:pixelFormat]; + + [m_openGLView setSystemAndWindowCocoa:systemCocoa windowCocoa:this]; [pixelFormat release]; @@ -692,7 +703,30 @@ GHOST_TWindowState GHOST_WindowCocoa::getState() const void GHOST_WindowCocoa::screenToClient(GHOST_TInt32 inX, GHOST_TInt32 inY, GHOST_TInt32& outX, GHOST_TInt32& outY) const { GHOST_ASSERT(getValid(), "GHOST_WindowCocoa::screenToClient(): window invalid") - + + screenToClientIntern(inX, inY, outX, outY); + + /* switch y to match ghost convention */ + GHOST_Rect cBnds; + getClientBounds(cBnds); + outY = (cBnds.getHeight() - 1) - outY; +} + + +void GHOST_WindowCocoa::clientToScreen(GHOST_TInt32 inX, GHOST_TInt32 inY, GHOST_TInt32& outX, GHOST_TInt32& outY) const +{ + GHOST_ASSERT(getValid(), "GHOST_WindowCocoa::clientToScreen(): window invalid") + + /* switch y to match ghost convention */ + GHOST_Rect cBnds; + getClientBounds(cBnds); + inY = (cBnds.getHeight() - 1) - inY; + + clientToScreenIntern(inX, inY, outX, outY); +} + +void GHOST_WindowCocoa::screenToClientIntern(GHOST_TInt32 inX, GHOST_TInt32 inY, GHOST_TInt32& outX, GHOST_TInt32& outY) const +{ NSPoint screenCoord; NSPoint baseCoord; @@ -705,11 +739,8 @@ void GHOST_WindowCocoa::screenToClient(GHOST_TInt32 inX, GHOST_TInt32 inY, GHOST outY = baseCoord.y; } - -void GHOST_WindowCocoa::clientToScreen(GHOST_TInt32 inX, GHOST_TInt32 inY, GHOST_TInt32& outX, GHOST_TInt32& outY) const +void GHOST_WindowCocoa::clientToScreenIntern(GHOST_TInt32 inX, GHOST_TInt32 inY, GHOST_TInt32& outX, GHOST_TInt32& outY) const { - GHOST_ASSERT(getValid(), "GHOST_WindowCocoa::clientToScreen(): window invalid") - NSPoint screenCoord; NSPoint baseCoord; @@ -1211,7 +1242,7 @@ GHOST_TSuccess GHOST_WindowCocoa::setWindowCursorGrab(GHOST_TGrabCursorMode mode NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; m_systemCocoa->getCursorPosition(x_old,y_old); - screenToClient(x_old, y_old, m_cursorGrabInitPos[0], m_cursorGrabInitPos[1]); + screenToClientIntern(x_old, y_old, m_cursorGrabInitPos[0], m_cursorGrabInitPos[1]); //Warp position is stored in client (window base) coordinates setCursorGrabAccum(0, 0); diff --git a/intern/ghost/intern/GHOST_WindowWin32.cpp b/intern/ghost/intern/GHOST_WindowWin32.cpp index aae1509fda1..1ba51376ff9 100644 --- a/intern/ghost/intern/GHOST_WindowWin32.cpp +++ b/intern/ghost/intern/GHOST_WindowWin32.cpp @@ -136,7 +136,7 @@ GHOST_WindowWin32::GHOST_WindowWin32( GHOST_TSuccess msEnabled, int msPixelFormat) : - GHOST_Window(title, left, top, width, height, state, GHOST_kDrawingContextTypeNone, + GHOST_Window(width, height, state, GHOST_kDrawingContextTypeNone, stereoVisual,numOfAASamples), m_system(system), m_hDC(0), diff --git a/intern/ghost/intern/GHOST_WindowX11.cpp b/intern/ghost/intern/GHOST_WindowX11.cpp index fc72ea09f40..de725151607 100644 --- a/intern/ghost/intern/GHOST_WindowX11.cpp +++ b/intern/ghost/intern/GHOST_WindowX11.cpp @@ -164,7 +164,7 @@ GHOST_WindowX11( const bool stereoVisual, const GHOST_TUns16 numOfAASamples ) : - GHOST_Window(title,left,top,width,height,state,type,stereoVisual,numOfAASamples), + GHOST_Window(width,height,state,type,stereoVisual,numOfAASamples), m_context(NULL), m_display(display), m_normal_state(GHOST_kWindowStateNormal), diff --git a/intern/iksolver/intern/IK_QSegment.cpp b/intern/iksolver/intern/IK_QSegment.cpp index 237edfd4594..df4fbc8fadd 100644 --- a/intern/iksolver/intern/IK_QSegment.cpp +++ b/intern/iksolver/intern/IK_QSegment.cpp @@ -905,9 +905,6 @@ void IK_QElbowSegment::SetLimit(int axis, MT_Scalar lmin, MT_Scalar lmax) lmin = MT_clamp(lmin, -MT_PI, MT_PI); lmax = MT_clamp(lmax, -MT_PI, MT_PI); - lmin = lmin; - lmax = lmax; - if (axis == 1) { m_min_twist = lmin; m_max_twist = lmax; diff --git a/intern/itasc/ConstraintSet.cpp b/intern/itasc/ConstraintSet.cpp index 3b50e353758..b07dc5bb983 100644 --- a/intern/itasc/ConstraintSet.cpp +++ b/intern/itasc/ConstraintSet.cpp @@ -134,6 +134,7 @@ bool ConstraintSet::setControlParameter(int id, ConstraintAction action, double break; default: assert(action==ACT_NONE); + break; } return setControlParameters(&values, 1, timestep); } |