minor compiler warnings fixed

This commit is contained in:
Marco Antognini 2011-07-03 17:21:05 +02:00
parent 807ffcd7f2
commit 202e41c80c
4 changed files with 15 additions and 8 deletions

View File

@ -37,9 +37,9 @@ namespace priv
{
////////////////////////////////////////////////////////////
RenderImageImplDefault::RenderImageImplDefault() :
myContext(0),
myWidth (0),
myHeight (0),
myContext(0)
myHeight (0)
{
}

View File

@ -69,7 +69,7 @@ void Joystick::Initialize(unsigned int Index)
// Is there enough joystick ?
CFIndex joysticksCount = CFSetGetCount(devices);
if (joysticksCount <= Index) {
if (joysticksCount <= CFIndex(Index)) {
FreeUp();
return;
}
@ -303,6 +303,9 @@ bool Joystick::RetriveElements(IOHIDDeviceRef device)
// Too many buttons. We ignore this one.
}
break;
default: // Make compiler happy.
break;
}
}

View File

@ -61,7 +61,7 @@ namespace sf {
NSWindow* myWindow;
SFOpenGLView* myOGLView;
sf::priv::WindowImplCocoa* myRequester;
sf::VideoMode myFullscreenMode;
sf::VideoMode* myFullscreenMode; // Note : C++ ctor/dtor are not called for Obj-C fields.
}
////////////////////////////////////////////////////////////

View File

@ -69,6 +69,7 @@
{
if ((self = [super init])) {
myRequester = 0;
myFullscreenMode = new sf::VideoMode();
// Retain the window for our own use.
myWindow = [window retain];
@ -121,6 +122,7 @@
if ((self = [super init])) {
myRequester = 0;
myFullscreenMode = new sf::VideoMode();
// Create our window size.
NSRect rect = NSZeroRect;
@ -128,7 +130,7 @@
// We use desktop mode to size the window
// but we set the back buffer size to 'mode' in applyContext method.
myFullscreenMode = mode;
*myFullscreenMode = mode;
sf::VideoMode dm = sf::VideoMode::GetDesktopMode();
rect = NSMakeRect(0, 0, dm.Width, dm.Height);
@ -211,7 +213,7 @@
// If a fullscreen window was requested...
if (style & sf::Style::Fullscreen && mode != sf::VideoMode::GetDesktopMode()) {
/// ... we set the "read size" of the view (that is the back buffer size).
[myOGLView setRealSize:NSMakeSize(myFullscreenMode.Width, myFullscreenMode.Height)];
[myOGLView setRealSize:NSMakeSize(myFullscreenMode->Width, myFullscreenMode->Height)];
}
// Set the view to the window as its content view.
@ -238,6 +240,8 @@
[myWindow release];
[myOGLView release];
delete myFullscreenMode;
[super dealloc];
}
@ -431,10 +435,10 @@
// If fullscreen was requested and the mode used to create the window
// was not the desktop mode, we change the back buffer size of the
// context.
if (myFullscreenMode != sf::VideoMode()) {
if (*myFullscreenMode != sf::VideoMode()) {
CGLContextObj cgcontext = (CGLContextObj)[context CGLContextObj];
GLint dim[2] = {myFullscreenMode.Width, myFullscreenMode.Height};
GLint dim[2] = {myFullscreenMode->Width, myFullscreenMode->Height};
CGLSetParameter(cgcontext, kCGLCPSurfaceBackingSize, dim);
CGLEnable(cgcontext, kCGLCESurfaceBackingSize);