Changed: #878 Fix typos in comments/code

This commit is contained in:
kervala 2010-11-02 22:59:50 +01:00
parent 4816fbb02a
commit 5b9fed1674
4 changed files with 77 additions and 77 deletions

View file

@ -597,9 +597,9 @@ bool CDriverGL::setupDisplay()
// if EXTVertexShader is used, bind the standard GL arrays, and allocate constant
if (!_Extensions.NVVertexProgram && !_Extensions.ARBVertexProgram && _Extensions.EXTVertexShader)
{
_EVSPositionHandle = nglBindParameterEXT(GL_CURRENT_VERTEX_EXT);
_EVSNormalHandle = nglBindParameterEXT(GL_CURRENT_NORMAL);
_EVSColorHandle = nglBindParameterEXT(GL_CURRENT_COLOR);
_EVSPositionHandle = nglBindParameterEXT(GL_CURRENT_VERTEX_EXT);
_EVSNormalHandle = nglBindParameterEXT(GL_CURRENT_NORMAL);
_EVSColorHandle = nglBindParameterEXT(GL_CURRENT_COLOR);
if (!_EVSPositionHandle || !_EVSNormalHandle || !_EVSColorHandle)
{
@ -885,7 +885,7 @@ bool CDriverGL::swapBuffers()
#elif defined(NL_OS_MAC)
// TODO: maybe do this somewhere else?
if(_DestroyWindow)
if(_DestroyWindow)
{
[_autoreleasePool release];
_autoreleasePool = [[NSAutoreleasePool alloc] init];
@ -1478,7 +1478,7 @@ void CDriverGL::setMatrix2DForTextureOffsetAddrMode(const uint stage, const floa
// ***************************************************************************
void CDriverGL::enableNVTextureShader(bool enabled)
void CDriverGL::enableNVTextureShader(bool enabled)
{
H_AUTO_OGL(CDriverGL_enableNVTextureShader)

View file

@ -2562,60 +2562,60 @@ bool CDriverGL::setMonitorColorProperties (const CMonitorColorProperties &proper
#ifdef NL_OS_MAC
void CDriverGL::setupApplicationMenu()
{
NSMenu* menu;
NSMenuItem* menuItem;
NSString* title;
NSString* appName;
NSMenu* menu;
NSMenuItem* menuItem;
NSString* title;
NSString* appName;
// get the applications name from it's process info
appName = [[NSProcessInfo processInfo] processName];
// get the applications name from it's process info
appName = [[NSProcessInfo processInfo] processName];
// create an empty menu object
menu = [[NSMenu alloc] initWithTitle:@""];
// create an empty menu object
menu = [[NSMenu alloc] initWithTitle:@""];
// add the about menu item
title = [@"About " stringByAppendingString:appName];
[menu addItemWithTitle:title
action:@selector(orderFrontStandardAboutPanel:) keyEquivalent:@""];
// add the about menu item
title = [@"About " stringByAppendingString:appName];
[menu addItemWithTitle:title
action:@selector(orderFrontStandardAboutPanel:) keyEquivalent:@""];
// separator
[menu addItem:[NSMenuItem separatorItem]];
// separator
[menu addItem:[NSMenuItem separatorItem]];
// add the hide application menu item
title = [@"Hide " stringByAppendingString:appName];
[menu addItemWithTitle:title
action:@selector(hide:) keyEquivalent:@"h"];
// add the hide application menu item
title = [@"Hide " stringByAppendingString:appName];
[menu addItemWithTitle:title
action:@selector(hide:) keyEquivalent:@"h"];
// add the hide others menu item
menuItem = [menu addItemWithTitle:@"Hide Others"
action:@selector(hideOtherApplications:) keyEquivalent:@"h"];
[menuItem setKeyEquivalentModifierMask:(NSAlternateKeyMask|NSCommandKeyMask)];
// add the hide others menu item
menuItem = [menu addItemWithTitle:@"Hide Others"
action:@selector(hideOtherApplications:) keyEquivalent:@"h"];
[menuItem setKeyEquivalentModifierMask:(NSAlternateKeyMask|NSCommandKeyMask)];
// add the show all menu item
[menu addItemWithTitle:@"Show All"
action:@selector(unhideAllApplications:) keyEquivalent:@""];
// add the show all menu item
[menu addItemWithTitle:@"Show All"
action:@selector(unhideAllApplications:) keyEquivalent:@""];
// separator
[menu addItem:[NSMenuItem separatorItem]];
// separator
[menu addItem:[NSMenuItem separatorItem]];
/*
TODO on quit send EventDestroyWindowId
*/
// add the quit menu item
title = [@"Quit " stringByAppendingString:appName];
[menu addItemWithTitle:title
action:@selector(terminate:) keyEquivalent:@"q"];
/*
TODO on quit send EventDestroyWindowId
*/
// add the quit menu item
title = [@"Quit " stringByAppendingString:appName];
[menu addItemWithTitle:title
action:@selector(terminate:) keyEquivalent:@"q"];
// create an empty menu item and put the new menu into it as a subitem
menuItem = [[NSMenuItem alloc] initWithTitle:@""
action:nil keyEquivalent:@""];
[menuItem setSubmenu:menu];
// create an empty menu item and put the new menu into it as a subitem
menuItem = [[NSMenuItem alloc] initWithTitle:@""
action:nil keyEquivalent:@""];
[menuItem setSubmenu:menu];
// create a menu for the application
[NSApp setMainMenu:[[NSMenu alloc] initWithTitle:@""]];
// create a menu for the application
[NSApp setMainMenu:[[NSMenu alloc] initWithTitle:@""]];
// attach the new menu to the applications menu
[[NSApp mainMenu] addItem:menuItem];
// attach the new menu to the applications menu
[[NSApp mainMenu] addItem:menuItem];
}
#endif
@ -2834,12 +2834,12 @@ bool CDriverGL::convertBitmapToCursor(const NLMISC::CBitmap &bitmap, Cursor &cur
*/
XRenderPictFormat *format = XRenderFindStandardFormat (_dpy, PictStandardARGB32);
Picture picture = XRenderCreatePicture (_dpy, iconPixmap, format, 0, 0);
Picture picture = XRenderCreatePicture (_dpy, iconPixmap, format, 0, 0);
cursor = XRenderCreateCursor(_dpy, picture, (uint)hotSpotX, (uint)hotSpotY);
cursor = XRenderCreateCursor(_dpy, picture, (uint)hotSpotX, (uint)hotSpotY);
XRenderFreePicture(_dpy, picture);
XFreePixmap(_dpy, iconPixmap);
XRenderFreePicture(_dpy, picture);
XFreePixmap(_dpy, iconPixmap);
return true;

View file

@ -243,15 +243,15 @@ bool CCocoaEventEmitter::processMessage(NSEvent* event, CEventServer* server)
mousePos.y /= (float)viewRect.size.height;
// if the mouse event was placed outside the view, don't tell NeL :)
if((mousePos.x < 0.0 || mousePos.x > 1.0 ||
mousePos.y < 0.0 || mousePos.y > 1.0) &&
if((mousePos.x < 0.0 || mousePos.x > 1.0 ||
mousePos.y < 0.0 || mousePos.y > 1.0) &&
event.type != NSKeyDown && event.type != NSKeyUp)
{
return false;
}
// convert the modifiers for nel to pass them with the events
NLMISC::TKeyButton modifiers =
NLMISC::TKeyButton modifiers =
modifierFlagsToNelKeyButton([event modifierFlags]);
switch(event.type)
@ -259,28 +259,28 @@ bool CCocoaEventEmitter::processMessage(NSEvent* event, CEventServer* server)
case NSLeftMouseDown:
{
server->postEvent(new NLMISC::CEventMouseDown(
mousePos.x, mousePos.y,
mousePos.x, mousePos.y,
(NLMISC::TMouseButton)(NLMISC::leftButton | modifiers), this));
}
break;
case NSLeftMouseUp:
{
server->postEvent(new NLMISC::CEventMouseUp(
mousePos.x, mousePos.y,
mousePos.x, mousePos.y,
(NLMISC::TMouseButton)(NLMISC::leftButton | modifiers), this));
break;
}
case NSRightMouseDown:
{
server->postEvent(new NLMISC::CEventMouseDown(
mousePos.x, mousePos.y,
mousePos.x, mousePos.y,
(NLMISC::TMouseButton)(NLMISC::rightButton | modifiers), this));
break;
}
case NSRightMouseUp:
{
server->postEvent(new NLMISC::CEventMouseUp(
mousePos.x, mousePos.y,
mousePos.x, mousePos.y,
(NLMISC::TMouseButton)(NLMISC::rightButton | modifiers), this));
break;
}
@ -375,7 +375,7 @@ bool CCocoaEventEmitter::processMessage(NSEvent* event, CEventServer* server)
case NSCursorUpdate:break;
case NSScrollWheel:
{
if(fabs(event.deltaY) > 0.1)
if(fabs(event.deltaY) > 0.1)
server->postEvent(new NLMISC::CEventMouseWheel(
mousePos.x, mousePos.y, (NLMISC::TMouseButton)modifiers,
(event.deltaY > 0), this));
@ -439,7 +439,7 @@ void CCocoaEventEmitter::submitEvents(CEventServer& server, bool /* allWins */)
// forward the event to the cocoa application
[NSApp sendEvent:event];
}
_server = &server;
}

View file

@ -23,7 +23,7 @@
#include <stdio.h>
namespace NL3D {
void viewDidResize(NSView* view, CDriverGL* driver)
void viewDidResize(NSView* view, CDriverGL* driver)
{
NSRect rect = [[view superview] frame];
driver->_WindowWidth = rect.size.width;
@ -34,9 +34,9 @@ namespace NL3D {
@implementation CocoaOpenGLView
-(id)initWithFrame:(NSRect)frame
-(id)initWithFrame:(NSRect)frame
{
if((self = [super initWithFrame:frame]))
if((self = [super initWithFrame:frame]))
{
_characterStorage = [[NSMutableAttributedString alloc] initWithString:@""];
_driver = nil;
@ -63,7 +63,7 @@ namespace NL3D {
_driver = driver;
}
-(void)resizeWithOldSuperviewSize:(NSSize)oldBoundsSize
-(void)resizeWithOldSuperviewSize:(NSSize)oldBoundsSize
{
[super resizeWithOldSuperviewSize:oldBoundsSize];
@ -76,37 +76,37 @@ namespace NL3D {
/******************************************************************************/
/* NSTextInputClient Protocol */
-(BOOL)hasMarkedText
-(BOOL)hasMarkedText
{
return (_markedRange.location == NSNotFound ? NO : YES);
}
-(NSRange)markedRange
-(NSRange)markedRange
{
return _markedRange;
}
-(NSRange)selectedRange
-(NSRange)selectedRange
{
return NSMakeRange(NSNotFound, 0);
}
-(void)setMarkedText:(id)aString
selectedRange:(NSRange)newSelection
-(void)setMarkedText:(id)aString
selectedRange:(NSRange)newSelection
replacementRange:(NSRange)replacementRange
{
if(replacementRange.location == NSNotFound)
replacementRange = _markedRange;
if([aString length] == 0)
if([aString length] == 0)
{
[_characterStorage deleteCharactersInRange:replacementRange];
[self unmarkText];
}
else
}
else
{
_markedRange = NSMakeRange(replacementRange.location, [aString length]);
[_characterStorage replaceCharactersInRange:replacementRange
[_characterStorage replaceCharactersInRange:replacementRange
withString:aString];
}
}
@ -123,19 +123,19 @@ namespace NL3D {
NSMarkedClauseSegmentAttributeName, NSGlyphInfoAttributeName, nil];
}
-(NSAttributedString*)attributedSubstringForProposedRange:(NSRange)aRange
-(NSAttributedString*)attributedSubstringForProposedRange:(NSRange)aRange
actualRange:(NSRangePointer)actualRange
{
return [_characterStorage attributedSubstringFromRange:aRange];
}
-(void)insertText:(id)aString
-(void)insertText:(id)aString
replacementRange:(NSRange)replacementRange
{
if(replacementRange.location == NSNotFound)
replacementRange = _markedRange;
[_characterStorage replaceCharactersInRange:replacementRange
[_characterStorage replaceCharactersInRange:replacementRange
withString:aString];
}
@ -144,7 +144,7 @@ namespace NL3D {
return 0;
}
-(NSRect)firstRectForCharacterRange:(NSRange)aRange
-(NSRect)firstRectForCharacterRange:(NSRange)aRange
actualRange:(NSRangePointer)actualRange
{
return NSMakeRect(0, 0, 0, 0);