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() : RenderImageImplDefault::RenderImageImplDefault() :
myContext(0),
myWidth (0), myWidth (0),
myHeight (0), myHeight (0)
myContext(0)
{ {
} }

View File

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

View File

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