Fixed additional comments and documention spelling mistakes.

This commit is contained in:
Lukas Dürrenberger 2014-11-18 01:02:07 +01:00
parent 610111c687
commit 45810a1345
73 changed files with 130 additions and 130 deletions

View file

@ -315,7 +315,7 @@ void SoundStream::streamData()
}
}
// Get the number of buffers that have been processed (ie. ready for reuse)
// Get the number of buffers that have been processed (i.e. ready for reuse)
ALint nbProcessed = 0;
alCheck(alGetSourcei(m_source, AL_BUFFERS_PROCESSED, &nbProcessed));
@ -381,7 +381,7 @@ void SoundStream::streamData()
// Stop the playback
alCheck(alSourceStop(m_source));
// Unqueue any buffer left in the queue
// Dequeue any buffer left in the queue
clearQueue();
// Delete the buffers
@ -460,7 +460,7 @@ void SoundStream::clearQueue()
ALint nbQueued;
alCheck(alGetSourcei(m_source, AL_BUFFERS_QUEUED, &nbQueued));
// Unqueue them all
// Dequeue them all
ALuint buffer;
for (ALint i = 0; i < nbQueued; ++i)
alCheck(alSourceUnqueueBuffers(m_source, 1, &buffer));

View file

@ -197,7 +197,7 @@ bool Font::loadFromMemory(const void* data, std::size_t sizeInBytes)
return false;
}
// Select the unicode character map
// Select the Unicode character map
if (FT_Select_Charmap(face, FT_ENCODING_UNICODE) != 0)
{
err() << "Failed to load font from memory (failed to set the Unicode character set)" << std::endl;
@ -261,7 +261,7 @@ bool Font::loadFromStream(InputStream& stream)
return false;
}
// Select the unicode character map
// Select the Unicode character map
if (FT_Select_Charmap(face, FT_ENCODING_UNICODE) != 0)
{
err() << "Failed to load font from stream (failed to set the Unicode character set)" << std::endl;
@ -520,7 +520,7 @@ Glyph Font::loadGlyph(Uint32 codePoint, unsigned int characterSize, bool bold) c
if ((width > 0) && (height > 0))
{
// Leave a small padding around characters, so that filtering doesn't
// pollute them with pixels from neighbours
// pollute them with pixels from neighbors
const unsigned int padding = 1;
// Get the glyphs page corresponding to the character size
@ -529,7 +529,7 @@ Glyph Font::loadGlyph(Uint32 codePoint, unsigned int characterSize, bool bold) c
// Find a good position for the new glyph into the texture
glyph.textureRect = findGlyphRect(page, width + 2 * padding, height + 2 * padding);
// Make sure the texture data is positioned in the centre
// Make sure the texture data is positioned in the center
// of the allocated texture rectangle
glyph.textureRect.left += padding;
glyph.textureRect.top += padding;

View file

@ -286,7 +286,7 @@ bool ImageLoader::writeJpg(const std::string& filename, const std::vector<Uint8>
jpeg_set_defaults(&compressInfos);
jpeg_set_quality(&compressInfos, 90, TRUE);
// Get rid of the aplha channel
// Get rid of the alpha channel
std::vector<Uint8> buffer(width * height * 3);
for (std::size_t i = 0; i < width * height; ++i)
{

View file

@ -632,7 +632,7 @@ int Shader::getParamLocation(const std::string& name)
#else // SFML_OPENGL_ES
// OpenGL ES 1 does't support GLSL shaders at all, we have to provide an empty implementation
// OpenGL ES 1 doesn't support GLSL shaders at all, we have to provide an empty implementation
namespace sf
{

View file

@ -64,7 +64,7 @@ ActivityStates* retrieveStates(ANativeActivity* activity)
////////////////////////////////////////////////////////////
static void initializeMain(ActivityStates* states)
{
// Protect from concurent access
// Protect from concurrent access
Lock lock(states->mutex);
// Prepare and share the looper to be read later
@ -80,7 +80,7 @@ static void initializeMain(ActivityStates* states)
////////////////////////////////////////////////////////////
static void terminateMain(ActivityStates* states)
{
// Protect from concurent access
// Protect from concurrent access
Lock lock(states->mutex);
// The main thread has finished, we must explicitly ask the activity to finish
@ -154,7 +154,7 @@ void goToFullscreenMode(ANativeActivity* activity)
void getScreenSizeInPixels(ANativeActivity* activity, int* width, int* height)
{
// Perform the following java code:
// Perform the following Java code:
//
// DisplayMetrics dm = new DisplayMetrics();
// getWindowManager().getDefaultDisplay().getMetrics(dm);

View file

@ -41,7 +41,7 @@ std::string getLibraryName(JNIEnv* lJNIEnv, jobject& objectActivityInfo)
{
// This function reads the value of meta-data "sfml.app.lib_name"
// found in the Android Manifest file and returns it. It performs the
// following java code using the JNI interface:
// following Java code using the JNI interface:
//
// ai.metaData.getString("sfml.app.lib_name");

View file

@ -37,7 +37,7 @@ namespace
{
if (address == "255.255.255.255")
{
// The broadcast address needs to be handled explicitely,
// The broadcast address needs to be handled explicitly,
// because it is also the value returned by inet_addr on error
return INADDR_BROADCAST;
}
@ -84,7 +84,7 @@ m_address(0)
{
// We're using 0 (INADDR_ANY) instead of INADDR_NONE to represent the invalid address,
// because the latter is also the broadcast address (255.255.255.255); it's ok because
// SFML doesn't publicly use INADDR_ANY (it is always used implicitely)
// SFML doesn't publicly use INADDR_ANY (it is always used implicitly)
}

View file

@ -101,7 +101,7 @@ void Socket::create(SocketHandle handle)
if (m_type == Tcp)
{
// Disable the Nagle algorithm (ie. removes buffering of TCP packets)
// Disable the Nagle algorithm (i.e. removes buffering of TCP packets)
int yes = 1;
if (setsockopt(m_socket, IPPROTO_TCP, TCP_NODELAY, reinterpret_cast<char*>(&yes), sizeof(yes)) == -1)
{

View file

@ -157,7 +157,7 @@ Socket::Status TcpSocket::connect(const IpAddress& remoteAddress, unsigned short
// Get the error status
Status status = priv::SocketImpl::getErrorStatus();
// If we were in non-blocking mode, return immediatly
// If we were in non-blocking mode, return immediately
if (!blocking)
return status;

View file

@ -33,7 +33,7 @@
namespace
{
// This class will be used as the default streambuf of sf::Err,
// it outputs to stderr by default (to keep the default behaviour)
// it outputs to stderr by default (to keep the default behavior)
class DefaultErrStreamBuf : public std::streambuf
{
public:

View file

@ -295,7 +295,7 @@ void String::replace(const String& searchFor, const String& replaceWith)
std::size_t len = searchFor.getSize();
std::size_t pos = find(searchFor);
// Replace each occurence of search
// Replace each occurrence of search
while (pos != InvalidPos)
{
replace(pos, len, replaceWith);

View file

@ -37,7 +37,7 @@ namespace sf
namespace priv
{
////////////////////////////////////////////////////////////
/// \brief Unix implementaton of sf::Clock
/// \brief Unix implementation of sf::Clock
///
////////////////////////////////////////////////////////////
class ClockImpl

View file

@ -35,7 +35,7 @@ namespace priv
////////////////////////////////////////////////////////////
MutexImpl::MutexImpl()
{
// Make it recursive to follow the expected behaviour
// Make it recursive to follow the expected behavior
pthread_mutexattr_t attributes;
pthread_mutexattr_init(&attributes);
pthread_mutexattr_settype(&attributes, PTHREAD_MUTEX_RECURSIVE);

View file

@ -79,7 +79,7 @@ void* ThreadImpl::entryPoint(void* userData)
Thread* owner = static_cast<Thread*>(userData);
#ifndef SFML_SYSTEM_ANDROID
// Tell the thread to handle cancel requests immediatly
// Tell the thread to handle cancel requests immediately
pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, NULL);
#endif

View file

@ -37,7 +37,7 @@ namespace sf
namespace priv
{
////////////////////////////////////////////////////////////
/// \brief Windows implementaton of sf::Clock
/// \brief Windows implementation of sf::Clock
///
////////////////////////////////////////////////////////////
class ClockImpl

View file

@ -139,7 +139,7 @@ ASensor const* SensorImpl::getDefaultSensor(Sensor::Type sensor)
int type = types[sensor];
// Retrive the default sensor matching this type
// Retrieve the default sensor matching this type
return ASensorManager_getDefaultSensor(sensorManager, type);
}

View file

@ -300,7 +300,7 @@ int WindowImplAndroid::processEvent(int fd, int events, void* data)
////////////////////////////////////////////////////////////
void WindowImplAndroid::processScrollEvent(AInputEvent* _event, ActivityStates* states)
{
// Prepare the java virtual machine
// Prepare the Java virtual machine
jint lResult;
jint lFlags = 0;
@ -315,9 +315,9 @@ void WindowImplAndroid::processScrollEvent(AInputEvent* _event, ActivityStates*
lResult=lJavaVM->AttachCurrentThread(&lJNIEnv, &lJavaVMAttachArgs);
if (lResult == JNI_ERR)
err() << "Failed to initialize JNI, couldn't get the unicode value" << std::endl;
err() << "Failed to initialize JNI, couldn't get the Unicode value" << std::endl;
// Retrieve everything we need to create this MotionEvent in java
// Retrieve everything we need to create this MotionEvent in Java
jlong downTime = AMotionEvent_getDownTime(_event);
jlong eventTime = AMotionEvent_getEventTime(_event);
jint action = AMotionEvent_getAction(_event);
@ -331,7 +331,7 @@ void WindowImplAndroid::processScrollEvent(AInputEvent* _event, ActivityStates*
jint deviceId = AInputEvent_getDeviceId(_event);
jint edgeFlags = AMotionEvent_getEdgeFlags(_event);
// Create the MotionEvent object in java trough its static constructor obtain()
// Create the MotionEvent object in Java trough its static constructor obtain()
jclass ClassMotionEvent = lJNIEnv->FindClass("android/view/MotionEvent");
jmethodID StaticMethodObtain = lJNIEnv->GetStaticMethodID(ClassMotionEvent, "obtain", "(JJIFFFFIFFII)Landroid/view/MotionEvent;");
jobject ObjectMotionEvent = lJNIEnv->CallStaticObjectMethod(ClassMotionEvent, StaticMethodObtain, downTime, eventTime, action, x, y, pressure, size, metaState, xPrecision, yPrecision, deviceId, edgeFlags);
@ -349,7 +349,7 @@ void WindowImplAndroid::processScrollEvent(AInputEvent* _event, ActivityStates*
forwardEvent(event);
// Dettach this thread from the JVM
// Detach this thread from the JVM
lJavaVM->DetachCurrentThread();
}
@ -670,7 +670,7 @@ int WindowImplAndroid::getUnicode(AInputEvent* event)
lResult=lJavaVM->AttachCurrentThread(&lJNIEnv, &lJavaVMAttachArgs);
if (lResult == JNI_ERR)
err() << "Failed to initialize JNI, couldn't get the unicode value" << std::endl;
err() << "Failed to initialize JNI, couldn't get the Unicode value" << std::endl;
// Retrieve key data from the input event
jlong downTime = AKeyEvent_getDownTime(event);
@ -689,11 +689,11 @@ int WindowImplAndroid::getUnicode(AInputEvent* event)
jmethodID KeyEventConstructor = lJNIEnv->GetMethodID(ClassKeyEvent, "<init>", "(JJIIIIIIII)V");
jobject ObjectKeyEvent = lJNIEnv->NewObject(ClassKeyEvent, KeyEventConstructor, downTime, eventTime, action, code, repeat, metaState, deviceId, scancode, flags, source);
// Call its getUnicodeChar() method to get the unicode value
// Call its getUnicodeChar() method to get the Unicode value
jmethodID MethodGetUnicode = lJNIEnv->GetMethodID(ClassKeyEvent, "getUnicodeChar", "(I)I");
int unicode = lJNIEnv->CallIntMethod(ObjectKeyEvent, MethodGetUnicode, metaState);
// Dettach this thread from the JVM
// Detach this thread from the JVM
lJavaVM->DetachCurrentThread();
return unicode;

View file

@ -204,17 +204,17 @@ private:
///
/// \param symbol Android key to convert
///
/// \return Corrsponding SFML key code
/// \return Corresponding SFML key code
///
////////////////////////////////////////////////////////////
static Keyboard::Key androidKeyToSF(int32_t key);
////////////////////////////////////////////////////////////
/// \brief Get unicode decoded from the input event
/// \brief Get Unicode decoded from the input event
///
/// \param Event Input event
///
/// \return The unicode value
/// \return The Unicode value
///
////////////////////////////////////////////////////////////
static int getUnicode(AInputEvent* event);

View file

@ -144,7 +144,7 @@ void eglCheckError(const char* file, unsigned int line)
case EGL_CONTEXT_LOST:
{
error = "EGL_CONTEXT_LOST";
description = "a power management event has occured. The application must destroy all contexts and reinitialise client API state and objects to continue rendering";
description = "a power management event has occurred. The application must destroy all contexts and reinitialize client API state and objects to continue rendering";
break;
}
}

View file

@ -80,7 +80,7 @@ m_context (EGL_NO_CONTEXT),
m_surface (EGL_NO_SURFACE),
m_config (NULL)
{
// Get the intialized EGL display
// Get the initialized EGL display
m_display = getInitializedDisplay();
// Get the best EGL config matching the default video settings
@ -118,7 +118,7 @@ m_config (NULL)
#endif
// Get the intialized EGL display
// Get the initialized EGL display
m_display = getInitializedDisplay();
// Get the best EGL config matching the requested video settings
@ -148,7 +148,7 @@ m_config (NULL)
////////////////////////////////////////////////////////////
EglContext::~EglContext()
{
// Desactive the current context
// Deactivate the current context
EGLContext currentContext = eglCheck(eglGetCurrentContext());
if (currentContext == m_context)
@ -258,7 +258,7 @@ EGLConfig EglContext::getBestConfig(EGLDisplay display, unsigned int bitsPerPixe
////////////////////////////////////////////////////////////
XVisualInfo EglContext::selectBestVisual(::Display* XDisplay, unsigned int bitsPerPixel, const ContextSettings& settings)
{
// Get the intialized EGL display
// Get the initialized EGL display
EGLDisplay display = getInitializedDisplay();
// Get the best EGL config matching the default video settings

View file

@ -219,7 +219,7 @@ bool JoystickImpl::open(unsigned int index)
// And the id
m_id = hid_get_report_id(m_file);
// Then allocate a buffer for data retrievement
// Then allocate a buffer for data retrieval
m_length = hid_report_size(m_desc, hid_input, m_id);
m_buffer.resize(m_length);

View file

@ -201,7 +201,7 @@ protected:
/// lower the score is, the better the configuration is.
///
/// \param bitsPerPixel Requested pixel depth (bits per pixel)
/// \param settings Requested additionnal settings
/// \param settings Requested additional settings
/// \param colorBits Color bits of the configuration to evaluate
/// \param depthBits Depth bits of the configuration to evaluate
/// \param stencilBits Stencil bits of the configuration to evaluate

View file

@ -54,7 +54,7 @@ long HIDInputManager::getLocationID(IOHIDDeviceRef device)
{
long loc = 0;
// Get a unique ID: its usb location ID
// Get a unique ID: its USB location ID
CFTypeRef typeRef = IOHIDDeviceGetProperty(device,
CFSTR(kIOHIDLocationIDKey));
if (!typeRef || (CFGetTypeID(typeRef) != CFNumberGetTypeID()))
@ -225,7 +225,7 @@ void HIDInputManager::loadKey(IOHIDElementRef key)
if (virtualCode == 0xff)
return; // no corresponding virtual code -> skip
// Now translate the virtual code to unicode according to
// Now translate the virtual code to Unicode according to
// the current keyboard layout
UInt32 deadKeyState = 0;
@ -286,7 +286,7 @@ void HIDInputManager::loadKey(IOHIDElementRef key)
// 0x4c | 0x77 | Select
//if (code == Keyboard::Unknown) { // The key is unknown.
// sf::err() << "This is an unknow key. Virtual key code is 0x"
// sf::err() << "This is an unknown key. Virtual key code is 0x"
// << std::hex
// << (UInt32)virtualCode
// << " and HID usage code is 0x"

View file

@ -126,7 +126,7 @@ private:
Joystick::Identification m_identification; ///< Joystick identification
static Location m_locationIDs[sf::Joystick::Count]; ///< Global Joystick register
/// For a corresponding SFML index, m_locationIDs is either some usb
/// For a corresponding SFML index, m_locationIDs is either some USB
/// location or 0 if there isn't currently a connected joystick device
};

View file

@ -30,7 +30,7 @@
#import <Foundation/Foundation.h>
////////////////////////////////////////////////////////////
/// \brief Event processing & Menu bar initialisation
/// \brief Event processing & Menu bar initialization
///
////////////////////////////////////////////////////////////
@interface SFApplication : NSApplication

View file

@ -665,7 +665,7 @@ BOOL isValidTextUnicode(NSEvent* event);
}
// Handle text entred event:
// Handle text entered event:
// Ignore event if we don't want repeated keystrokes
if (m_useKeyRepeat || ![theEvent isARepeat])
{
@ -687,7 +687,7 @@ BOOL isValidTextUnicode(NSEvent* event);
// Backspace
if (keycode == 0x33)
{
// Send the correct unicode value (i.e. 8) instead of 127 (which is 'delete')
// Send the correct Unicode value (i.e. 8) instead of 127 (which is 'delete')
m_requester->textEntered(8);
}
@ -770,7 +770,7 @@ BOOL isValidTextUnicode(NSEvent* event);
//#ifdef SFML_DEBUG // Don't bother the final customers with annoying messages.
// if (key.code == sf::Keyboard::Unknown) { // The key is unknown.
// sf::err() << "This is an unknow key. Virtual key code is 0x"
// sf::err() << "This is an unknown key. Virtual key code is 0x"
// << std::hex
// << [event keyCode]
// << "."

View file

@ -386,7 +386,7 @@
////////////////////////////////////////////////////////
-(void)resizeTo:(unsigned int)width by:(unsigned int)height
{
// Before resizing, remove resizeable mask to be able to resize
// Before resizing, remove resizable mask to be able to resize
// beyond the desktop boundaries.
NSUInteger styleMask = [m_window styleMask];

View file

@ -383,7 +383,7 @@ void WindowImplX11::setSize(const Vector2u& size)
void WindowImplX11::setTitle(const String& title)
{
// Bare X11 has no Unicode window title support.
// There is however an option to tell the window manager your unicode title via hints.
// There is however an option to tell the window manager your Unicode title via hints.
// Convert to UTF-8 encoding.
std::basic_string<Uint8> utf8Title;

View file

@ -220,7 +220,7 @@ private:
///
/// \param symbol Key symbol to convert
///
/// \return Corrsponding SFML key code
/// \return Corresponding SFML key code
///
////////////////////////////////////////////////////////////
static Keyboard::Key keysymToSF(KeySym symbol);
@ -232,11 +232,11 @@ private:
::Display* m_display; ///< Pointer to the display
int m_screen; ///< Screen identifier
XIM m_inputMethod; ///< Input method linked to the X display
XIC m_inputContext; ///< Input context used to get unicode input in our window
XIC m_inputContext; ///< Input context used to get Unicode input in our window
bool m_isExternal; ///< Tell whether the window has been created externally or by SFML
Atom m_atomClose; ///< Atom used to identify the close event
int m_oldVideoMode; ///< Video mode in use before we switch to fullscreen
Cursor m_hiddenCursor; ///< As X11 doesn't provide cursor hidding, we must create a transparent one
Cursor m_hiddenCursor; ///< As X11 doesn't provide cursor hiding, we must create a transparent one
bool m_keyRepeat; ///< Is the KeyRepeat feature enabled?
Vector2i m_previousSize; ///< Previous size of the window, to find if a ConfigureNotify event is a resize event (could be a move event only)
bool m_useSizeHints; ///< Is the size of the window fixed with size hints?

View file

@ -177,7 +177,7 @@ void JoystickImpl::cleanup()
bool JoystickImpl::isConnected(unsigned int index)
{
// We check the connection state of joysticks only every N milliseconds,
// because of a strange (buggy?) behaviour of joyGetPosEx when joysticks
// because of a strange (buggy?) behavior of joyGetPosEx when joysticks
// are just plugged/unplugged -- it takes really long and kills the app performances
ConnectionCache& cache = connectionCache[index];
if (cache.timer.getElapsedTime() > connectionRefreshDelay)

View file

@ -410,7 +410,7 @@ bool Window::filterEvent(const Event& event)
////////////////////////////////////////////////////////////
void Window::initialize()
{
// Setup default behaviours (to get a consistent behaviour across different implementations)
// Setup default behaviors (to get a consistent behavior across different implementations)
setVisible(true);
setMouseCursorVisible(true);
setVerticalSyncEnabled(false);

View file

@ -88,7 +88,7 @@ public:
virtual ~WindowImpl();
////////////////////////////////////////////////////////////
/// \brief Change the joystick threshold, ie. the value below which
/// \brief Change the joystick threshold, i.e. the value below which
/// no move event will be generated
///
/// \param threshold New threshold, in range [0, 100]
@ -101,7 +101,7 @@ public:
///
/// If there's no event available, this function calls the
/// window's internal event processing function.
/// The \a block parameter controls the behaviour of the function
/// The \a block parameter controls the behavior of the function
/// if no event is available: if it is true then the function
/// doesn't return until a new event is triggered; otherwise it
/// returns false to indicate that no event is available.

View file

@ -73,7 +73,7 @@ namespace
// Save the delegate instance
delegateInstance = self;
// Instanciate the motion manager
// Instantiate the motion manager
self.motionManager = [[CMMotionManager alloc] init];
// Register orientation changes notifications