OSX, fixed mouse pos in event.

git-svn-id: https://sfml.svn.sourceforge.net/svnroot/sfml/branches/sfml2@1771 4e206d99-4929-0410-ac5d-dfc041789085
This commit is contained in:
mantognini 2011-01-20 13:04:25 +00:00
parent bef6b3bbf6
commit f9c4740894
4 changed files with 24 additions and 20 deletions

View File

@ -79,7 +79,11 @@ SFContext::SFContext(SFContext* shared, const WindowImpl* owner,
SFContext::~SFContext() SFContext::~SFContext()
{ {
[myContext release]; [myContext release];
[myPool release]; [myPool drain]; // [1]
/*
[1] : Produce sometimes "*** attempt to pop an unknown autorelease pool"
*/
} }

View File

@ -160,7 +160,7 @@
NSPoint loc = [self convertPoint:[theEvent locationInWindow] fromView:nil]; NSPoint loc = [self convertPoint:[theEvent locationInWindow] fromView:nil];
// Don't forget to change to SFML coord system. // Don't forget to change to SFML coord system.
float h = [[theEvent window] frame].size.height; float h = [self frame].size.height;
myRequester->MouseDownAt(sf::Mouse::Left, loc.x, h - loc.y); myRequester->MouseDownAt(sf::Mouse::Left, loc.x, h - loc.y);
} }
@ -172,7 +172,7 @@
NSPoint loc = [self convertPoint:[theEvent locationInWindow] fromView:nil]; NSPoint loc = [self convertPoint:[theEvent locationInWindow] fromView:nil];
// Don't forget to change to SFML coord system. // Don't forget to change to SFML coord system.
float h = [[theEvent window] frame].size.height; float h = [self frame].size.height;
myRequester->MouseUpAt(sf::Mouse::Left, loc.x, h - loc.y); myRequester->MouseUpAt(sf::Mouse::Left, loc.x, h - loc.y);
} }
@ -199,7 +199,7 @@
NSPoint loc = [self convertPoint:[theEvent locationInWindow] fromView:nil]; NSPoint loc = [self convertPoint:[theEvent locationInWindow] fromView:nil];
// Don't forget to change to SFML coord system. // Don't forget to change to SFML coord system.
float h = [[theEvent window] frame].size.height; float h = [self frame].size.height;
myRequester->MouseWheelScrolledAt([theEvent deltaY], loc.x, h - loc.y); myRequester->MouseWheelScrolledAt([theEvent deltaY], loc.x, h - loc.y);
} }
@ -233,7 +233,7 @@
NSPoint loc = [self convertPoint:[theEvent locationInWindow] fromView:nil]; NSPoint loc = [self convertPoint:[theEvent locationInWindow] fromView:nil];
// Don't forget to change to SFML coord system. // Don't forget to change to SFML coord system.
float h = [[theEvent window] frame].size.height; float h = [self frame].size.height;
myRequester->MouseDownAt(sf::Mouse::Right, loc.x, h - loc.y); myRequester->MouseDownAt(sf::Mouse::Right, loc.x, h - loc.y);
} }
@ -245,7 +245,7 @@
NSPoint loc = [self convertPoint:[theEvent locationInWindow] fromView:nil]; NSPoint loc = [self convertPoint:[theEvent locationInWindow] fromView:nil];
// Don't forget to change to SFML coord system. // Don't forget to change to SFML coord system.
float h = [[theEvent window] frame].size.height; float h = [self frame].size.height;
myRequester->MouseUpAt(sf::Mouse::Right, loc.x, h - loc.y); myRequester->MouseUpAt(sf::Mouse::Right, loc.x, h - loc.y);
} }
@ -271,7 +271,7 @@
break; break;
} }
// Don't forget to change to SFML coord system. // Don't forget to change to SFML coord system.
float h = [[theEvent window] frame].size.height; float h = [self frame].size.height;
myRequester->MouseDownAt(button, loc.x, h - loc.y); myRequester->MouseDownAt(button, loc.x, h - loc.y);
} }
@ -297,7 +297,7 @@
break; break;
} }
// Don't forget to change to SFML coord system. // Don't forget to change to SFML coord system.
float h = [[theEvent window] frame].size.height; float h = [self frame].size.height;
myRequester->MouseUpAt(button, loc.x, h - loc.y); myRequester->MouseUpAt(button, loc.x, h - loc.y);
} }
@ -312,7 +312,7 @@
NSPoint loc = [self convertPoint:[theEvent locationInWindow] fromView:nil]; NSPoint loc = [self convertPoint:[theEvent locationInWindow] fromView:nil];
// Don't forget to change to SFML coord system. // Don't forget to change to SFML coord system.
float h = [[theEvent window] frame].size.height; float h = [self frame].size.height;
myRequester->MouseMovedAt(loc.x, h - loc.y); myRequester->MouseMovedAt(loc.x, h - loc.y);
} }
@ -327,7 +327,7 @@
NSPoint loc = [self convertPoint:[theEvent locationInWindow] fromView:nil]; NSPoint loc = [self convertPoint:[theEvent locationInWindow] fromView:nil];
// Don't forget to change to SFML coord system. // Don't forget to change to SFML coord system.
float h = [[theEvent window] frame].size.height; float h = [self frame].size.height;
myRequester->MouseMovedAt(loc.x, h - loc.y); myRequester->MouseMovedAt(loc.x, h - loc.y);
} }
@ -342,7 +342,7 @@
NSPoint loc = [self convertPoint:[theEvent locationInWindow] fromView:nil]; NSPoint loc = [self convertPoint:[theEvent locationInWindow] fromView:nil];
// Don't forget to change to SFML coord system. // Don't forget to change to SFML coord system.
float h = [[theEvent window] frame].size.height; float h = [self frame].size.height;
myRequester->MouseMovedAt(loc.x, h - loc.y); myRequester->MouseMovedAt(loc.x, h - loc.y);
} }

View File

@ -104,7 +104,7 @@ WindowImplCocoa::~WindowImplCocoa()
[myDelegate closeWindow]; [myDelegate closeWindow];
[myDelegate release]; [myDelegate release];
[myPool release]; [myPool drain];
} }