Changed: #878 Fix typos in comments/code

This commit is contained in:
kervala 2010-11-02 22:59:50 +01:00
parent fcf462067b
commit 04d1340ef7
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 EXTVertexShader is used, bind the standard GL arrays, and allocate constant
if (!_Extensions.NVVertexProgram && !_Extensions.ARBVertexProgram && _Extensions.EXTVertexShader) if (!_Extensions.NVVertexProgram && !_Extensions.ARBVertexProgram && _Extensions.EXTVertexShader)
{ {
_EVSPositionHandle = nglBindParameterEXT(GL_CURRENT_VERTEX_EXT); _EVSPositionHandle = nglBindParameterEXT(GL_CURRENT_VERTEX_EXT);
_EVSNormalHandle = nglBindParameterEXT(GL_CURRENT_NORMAL); _EVSNormalHandle = nglBindParameterEXT(GL_CURRENT_NORMAL);
_EVSColorHandle = nglBindParameterEXT(GL_CURRENT_COLOR); _EVSColorHandle = nglBindParameterEXT(GL_CURRENT_COLOR);
if (!_EVSPositionHandle || !_EVSNormalHandle || !_EVSColorHandle) if (!_EVSPositionHandle || !_EVSNormalHandle || !_EVSColorHandle)
{ {
@ -885,7 +885,7 @@ bool CDriverGL::swapBuffers()
#elif defined(NL_OS_MAC) #elif defined(NL_OS_MAC)
// TODO: maybe do this somewhere else? // TODO: maybe do this somewhere else?
if(_DestroyWindow) if(_DestroyWindow)
{ {
[_autoreleasePool release]; [_autoreleasePool release];
_autoreleasePool = [[NSAutoreleasePool alloc] init]; _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) H_AUTO_OGL(CDriverGL_enableNVTextureShader)

View file

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

View file

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

View file

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