Remove trailing spaces

This commit is contained in:
Marco Antognini 2013-09-20 15:00:11 +02:00
parent c0f3587a7c
commit 2b8f20c89f
36 changed files with 771 additions and 771 deletions

View file

@ -42,15 +42,15 @@ struct SFMLmainWindow
if (!logo.loadFromFile(resPath + "/logo.png")) {
NSLog(@"Couldn't load the logo image");
}
logo.setSmooth(true);
sprite.setTexture(logo, true);
sf::FloatRect rect = sprite.getLocalBounds();
sf::Vector2f size(rect.width, rect.height);
sprite.setOrigin(size / 2.f);
sprite.scale(0.3, 0.3);
unsigned int ww = renderWindow.getSize().x;
unsigned int wh = renderWindow.getSize().y;
sprite.setPosition(sf::Vector2f(ww, wh) / 2.f);
@ -58,11 +58,11 @@ struct SFMLmainWindow
if (!font.loadFromFile(resPath + "/sansation.ttf")) {
NSLog(@"Couldn't load the font");
}
text.setColor(sf::Color::White);
text.setFont(font);
}
sf::RenderWindow renderWindow;
sf::Font font;
sf::Text text;
@ -114,12 +114,12 @@ struct SFMLmainWindow
self.mainWindow = new SFMLmainWindow(self.sfmlView);
self.mainWindow->text.setString([self.textField.stringValue tostdwstring]);
self.visible = YES;
// Launch the timer to periodically display our stuff into the Cocoa view.
self.renderTimer = [NSTimer timerWithTimeInterval:1.f/60.f
target:self
selector:@selector(renderMainWindow:)
userInfo:nil
userInfo:nil
repeats:YES];
[[NSRunLoop mainRunLoop] addTimer:self.renderTimer
forMode:NSDefaultRunLoopMode];
@ -133,7 +133,7 @@ struct SFMLmainWindow
* while the second mode allows timer firing while he is using a slider
* or a menu.
*/
self.initialized = YES;
}
}
@ -142,15 +142,15 @@ struct SFMLmainWindow
{
[self.renderTimer invalidate];
self.mainWindow->renderWindow.close();
self.window = nil;
self.sfmlView = nil;
self.textField = nil;
delete (SFMLmainWindow *) self.mainWindow;
self.mainWindow = 0;
self.renderTimer = nil;
[super dealloc];
}
@ -166,18 +166,18 @@ struct SFMLmainWindow
{
self.mainWindow->sprite.scale(0.99f, 0.99f);
}
// Clear the window, display some stuff and display it into our view.
self.mainWindow->renderWindow.clear(self.mainWindow->background);
if (self.visible)
{
self.mainWindow->renderWindow.draw(self.mainWindow->sprite);
}
self.mainWindow->renderWindow.draw(self.mainWindow->text);
self.mainWindow->renderWindow.display();
}
@ -190,11 +190,11 @@ struct SFMLmainWindow
if ([color isEqualToString:BLUE])
{
self.mainWindow->background = sf::Color::Blue;
}
}
else if ([color isEqualToString:GREEN])
{
self.mainWindow->background = sf::Color::Green;
}
}
else
{
self.mainWindow->background = sf::Color::Red;

View file

@ -32,10 +32,10 @@
{
std::string utf8;
utf8.reserve(string.size() + 1);
sf::Utf8::fromAnsi(string.begin(), string.end(), std::back_inserter(utf8));
NSString *str = [NSString stringWithCString:utf8.c_str()
NSString *str = [NSString stringWithCString:utf8.c_str()
encoding:NSUTF8StringEncoding];
return str;
}
@ -45,7 +45,7 @@
// Not sure about the encoding to use. Using [self UTF8String] doesn't
// work for characters like é or à.
const char *cstr = [self cStringUsingEncoding:NSISOLatin1StringEncoding];
if (cstr != NULL)
{
std::string str(cstr);
@ -61,7 +61,7 @@
{
char* data = (char *)string.data();
unsigned size = string.size() * sizeof(wchar_t);
NSString *str = [[[NSString alloc] initWithBytes:data length:size
encoding:NSUTF32LittleEndianStringEncoding] autorelease];
return str;
@ -75,4 +75,4 @@
return std::wstring((wchar_t *)[asData bytes], [asData length] / sizeof(wchar_t));
}
@end
@end