Source cleaning: -1/wxID_ANY/wxDefaultCoord, ::, !!, TRUE/true, FALSE/false, whitespaces, tabs.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@28966 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Włodzimierz Skiba
2004-08-30 10:18:55 +00:00
parent 95a8b77a94
commit 598ddd96f4
21 changed files with 288 additions and 288 deletions

View File

@@ -50,34 +50,34 @@ IMPLEMENT_DYNAMIC_CLASS(wxJoystick, wxObject)
////////////////////////////////////////////////////////////////////////////
/**
johan@linkdata.se 2002-08-20:
Now returns only valid, functioning
joysticks, counting from the first
available and upwards.
johan@linkdata.se 2002-08-20:
Now returns only valid, functioning
joysticks, counting from the first
available and upwards.
*/
wxJoystick::wxJoystick(int joystick)
{
JOYINFO joyInfo;
int i, maxsticks;
int i, maxsticks;
maxsticks = joyGetNumDevs();
for( i=0; i<maxsticks; i++ )
{
if( joyGetPos(i, & joyInfo) == JOYERR_NOERROR )
{
if( !joystick )
{
/* Found the one we want, store actual OS id and return */
m_joystick = i;
return;
}
joystick --;
}
}
maxsticks = joyGetNumDevs();
for( i=0; i<maxsticks; i++ )
{
if( joyGetPos(i, & joyInfo) == JOYERR_NOERROR )
{
if( !joystick )
{
/* Found the one we want, store actual OS id and return */
m_joystick = i;
return;
}
joystick --;
}
}
/* No such joystick, return ID 0 */
m_joystick = 0;
return;
/* No such joystick, return ID 0 */
m_joystick = 0;
return;
};
wxPoint wxJoystick::GetPosition() const
@@ -101,9 +101,9 @@ int wxJoystick::GetZPosition() const
}
/**
johan@linkdata.se 2002-08-20:
Return a bitmap with all button states in it,
like the GTK version does and Win32 does.
johan@linkdata.se 2002-08-20:
Return a bitmap with all button states in it,
like the GTK version does and Win32 does.
*/
int wxJoystick::GetButtonState() const
{
@@ -111,7 +111,7 @@ int wxJoystick::GetButtonState() const
MMRESULT res = joyGetPos(m_joystick, & joyInfo);
if (res == JOYERR_NOERROR )
{
return joyInfo.wButtons;
return joyInfo.wButtons;
#if 0
int buttons = 0;
@@ -132,8 +132,8 @@ int wxJoystick::GetButtonState() const
}
/**
JLI 2002-08-20:
Returns -1 to signify error.
JLI 2002-08-20:
Returns -1 to signify error.
*/
int wxJoystick::GetPOVPosition() const
{
@@ -154,8 +154,8 @@ int wxJoystick::GetPOVPosition() const
}
/**
johan@linkdata.se 2002-08-20:
Returns -1 to signify error.
johan@linkdata.se 2002-08-20:
Returns -1 to signify error.
*/
int wxJoystick::GetPOVCTSPosition() const
{
@@ -251,30 +251,30 @@ void wxJoystick::SetMovementThreshold(int threshold)
////////////////////////////////////////////////////////////////////////////
/**
johan@linkdata.se 2002-08-20:
Now returns the number of connected, functioning
joysticks, as intended.
johan@linkdata.se 2002-08-20:
Now returns the number of connected, functioning
joysticks, as intended.
*/
int wxJoystick::GetNumberJoysticks()
{
JOYINFO joyInfo;
int i, maxsticks, actualsticks;
maxsticks = joyGetNumDevs();
actualsticks = 0;
for( i=0; i<maxsticks; i++ )
{
if( joyGetPos( i, & joyInfo ) == JOYERR_NOERROR )
{
actualsticks ++;
}
}
int i, maxsticks, actualsticks;
maxsticks = joyGetNumDevs();
actualsticks = 0;
for( i=0; i<maxsticks; i++ )
{
if( joyGetPos( i, & joyInfo ) == JOYERR_NOERROR )
{
actualsticks ++;
}
}
return actualsticks;
}
/**
johan@linkdata.se 2002-08-20:
The old code returned true if there were any
joystick capable drivers loaded (=always).
johan@linkdata.se 2002-08-20:
The old code returned true if there were any
joystick capable drivers loaded (=always).
*/
bool wxJoystick::IsOk() const
{
@@ -513,11 +513,11 @@ bool wxJoystick::HasRudder() const
#if defined(__WIN32__)
JOYCAPS joyCaps;
if (joyGetDevCaps(m_joystick, & joyCaps, sizeof(JOYCAPS)) != JOYERR_NOERROR)
return FALSE;
return false;
else
return ((joyCaps.wCaps & JOYCAPS_HASR) == JOYCAPS_HASR);
#else
return FALSE;
return false;
#endif
}
@@ -526,11 +526,11 @@ bool wxJoystick::HasZ() const
#if defined(__WIN32__)
JOYCAPS joyCaps;
if (joyGetDevCaps(m_joystick, & joyCaps, sizeof(JOYCAPS)) != JOYERR_NOERROR)
return FALSE;
return false;
else
return ((joyCaps.wCaps & JOYCAPS_HASZ) == JOYCAPS_HASZ);
#else
return FALSE;
return false;
#endif
}
@@ -539,11 +539,11 @@ bool wxJoystick::HasU() const
#if defined(__WIN32__)
JOYCAPS joyCaps;
if (joyGetDevCaps(m_joystick, & joyCaps, sizeof(JOYCAPS)) != JOYERR_NOERROR)
return FALSE;
return false;
else
return ((joyCaps.wCaps & JOYCAPS_HASU) == JOYCAPS_HASU);
#else
return FALSE;
return false;
#endif
}
@@ -552,11 +552,11 @@ bool wxJoystick::HasV() const
#if defined(__WIN32__)
JOYCAPS joyCaps;
if (joyGetDevCaps(m_joystick, & joyCaps, sizeof(JOYCAPS)) != JOYERR_NOERROR)
return FALSE;
return false;
else
return ((joyCaps.wCaps & JOYCAPS_HASV) == JOYCAPS_HASV);
#else
return FALSE;
return false;
#endif
}
@@ -565,11 +565,11 @@ bool wxJoystick::HasPOV() const
#if defined(__WIN32__)
JOYCAPS joyCaps;
if (joyGetDevCaps(m_joystick, & joyCaps, sizeof(JOYCAPS)) != JOYERR_NOERROR)
return FALSE;
return false;
else
return ((joyCaps.wCaps & JOYCAPS_HASPOV) == JOYCAPS_HASPOV);
#else
return FALSE;
return false;
#endif
}
@@ -578,11 +578,11 @@ bool wxJoystick::HasPOV4Dir() const
#if defined(__WIN32__)
JOYCAPS joyCaps;
if (joyGetDevCaps(m_joystick, & joyCaps, sizeof(JOYCAPS)) != JOYERR_NOERROR)
return FALSE;
return false;
else
return ((joyCaps.wCaps & JOYCAPS_POV4DIR) == JOYCAPS_POV4DIR);
#else
return FALSE;
return false;
#endif
}
@@ -591,11 +591,11 @@ bool wxJoystick::HasPOVCTS() const
#if defined(__WIN32__)
JOYCAPS joyCaps;
if (joyGetDevCaps(m_joystick, & joyCaps, sizeof(JOYCAPS)) != JOYERR_NOERROR)
return FALSE;
return false;
else
return ((joyCaps.wCaps & JOYCAPS_POVCTS) == JOYCAPS_POVCTS);
#else
return FALSE;
return false;
#endif
}