diff --git a/.gitignore b/.gitignore
index 1ba98ce23..b437bf1b2 100644
--- a/.gitignore
+++ b/.gitignore
@@ -9,6 +9,7 @@ stk-editor/
.config/
supertuxkart-64
make*.bat
+__pycache__
data/editor
data/karts
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 2d02a92bd..6ac88ebd5 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,6 +1,6 @@
# root CMakeLists for the SuperTuxKart project
project(SuperTuxKart)
-set(PROJECT_VERSION "0.8.1")
+set(PROJECT_VERSION "0.9.1")
cmake_minimum_required(VERSION 2.8.4)
if(NOT (CMAKE_MAJOR_VERSION VERSION_LESS 3))
@@ -15,7 +15,6 @@ if (NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "STKRelease")
endif()
-option(USE_WIIUSE "Support for wiimote input devices" ON)
option(USE_FRIBIDI "Support for right-to-left languages" ON)
option(CHECK_ASSETS "Check if assets are installed in ../stk-assets" ON)
option(USE_SYSTEM_ANGELSCRIPT "Use system angelscript instead of built-in angelscript. If you enable this option, make sure to use a compatible version." OFF)
@@ -32,7 +31,9 @@ else()
endif()
if(MINGW OR CYGWIN)
- set(USE_WIIUSE OFF)
+ option(USE_WIIUSE "Support for wiimote input devices" OFF)
+else()
+ option(USE_WIIUSE "Support for wiimote input devices" ON)
endif()
if(UNIX AND NOT APPLE)
diff --git a/data/CREDITS b/data/CREDITS
index 64991a2a6..d36394892 100755
Binary files a/data/CREDITS and b/data/CREDITS differ
diff --git a/data/graphical_restrictions.xml b/data/graphical_restrictions.xml
index 16bb60729..e900c428b 100644
--- a/data/graphical_restrictions.xml
+++ b/data/graphical_restrictions.xml
@@ -4,6 +4,8 @@
+
+
diff --git a/data/gui/track_info.stkgui b/data/gui/track_info.stkgui
index 38e32fc0d..957bcf7f8 100644
--- a/data/gui/track_info.stkgui
+++ b/data/gui/track_info.stkgui
@@ -40,9 +40,12 @@
-
+
+
+
+
diff --git a/data/kart_characteristics.xml b/data/kart_characteristics.xml
new file mode 100644
index 000000000..e72f40f8f
--- /dev/null
+++ b/data/kart_characteristics.xml
@@ -0,0 +1,404 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/data/stk_config.xml b/data/stk_config.xml
index a36995311..d1b198a0f 100644
--- a/data/stk_config.xml
+++ b/data/stk_config.xml
@@ -85,24 +85,6 @@
-
-
-
-
-
-
@@ -150,22 +132,6 @@
============================ -->
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -411,23 +314,6 @@
(like 10000000) disables bullet skidding. -->
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
diff --git a/lib/irrlicht/CMakeLists.txt b/lib/irrlicht/CMakeLists.txt
index b13308798..3006513e4 100644
--- a/lib/irrlicht/CMakeLists.txt
+++ b/lib/irrlicht/CMakeLists.txt
@@ -510,5 +510,6 @@ endif()
add_library(stkirrlicht STATIC ${IRRLICHT_SOURCES})
target_link_libraries(stkirrlicht ${PNG_LIBRARY} ${JPEG_LIBRARY} ${ZLIB_LIBRARY})
-
-
+if(WIN32)
+ target_link_libraries(stkirrlicht imm32)
+endif()
diff --git a/lib/irrlicht/include/IEventReceiver.h b/lib/irrlicht/include/IEventReceiver.h
index 59b184fc8..c19248a83 100644
--- a/lib/irrlicht/include/IEventReceiver.h
+++ b/lib/irrlicht/include/IEventReceiver.h
@@ -49,6 +49,14 @@ namespace irr
user receiver then no text will be sent to the console. */
EET_LOG_TEXT_EVENT,
+#if defined(_IRR_COMPILE_WITH_WINDOWS_DEVICE_)
+ //! A input method event
+ /** Input method events are created by the input method message and passed to IrrlichtDevice::postEventFromUser.
+ Windows: Implemented.
+ Linux / Other: Not yet implemented. */
+ EET_IMPUT_METHOD_EVENT,
+#endif
+
//! A user event with user data.
/** This is not used by Irrlicht and can be used to send user
specific data though the system. The Irrlicht 'window handle'
@@ -142,6 +150,20 @@ namespace irr
EMBSM_FORCE_32_BIT = 0x7fffffff
};
+#if defined(_IRR_COMPILE_WITH_WINDOWS_DEVICE_)
+ //! Enumeration for all input method events
+ enum EINPUT_METHOD_EVENT
+ {
+ //! a character from input method.
+ EIME_CHAR_INPUT = 0,
+
+ //! change position of composition window
+ EIME_CHANGE_POS,
+
+ EIME_FORCE_32_BIT = 0x7fffffff
+ };
+#endif
+
namespace gui
{
@@ -411,6 +433,20 @@ struct SEvent
s32 UserData2;
};
+#if defined(_IRR_COMPILE_WITH_WINDOWS_DEVICE_)
+ struct SInputMethodEvent
+ {
+ //! Parent window handle for IMM functions (Windows only)
+ void* Handle;
+
+ //! Character from Input Method
+ wchar_t Char;
+
+ //! Type of input method event
+ EINPUT_METHOD_EVENT Event;
+ };
+#endif
+
EEVENT_TYPE EventType;
union
{
@@ -420,6 +456,9 @@ struct SEvent
struct SJoystickEvent JoystickEvent;
struct SLogEvent LogEvent;
struct SUserEvent UserEvent;
+#if defined(_IRR_COMPILE_WITH_WINDOWS_DEVICE_)
+ struct SInputMethodEvent InputMethodEvent;
+#endif
};
};
diff --git a/lib/irrlicht/include/IOSOperator.h b/lib/irrlicht/include/IOSOperator.h
index 22fb691ee..dac6342ab 100644
--- a/lib/irrlicht/include/IOSOperator.h
+++ b/lib/irrlicht/include/IOSOperator.h
@@ -26,11 +26,19 @@ public:
}
//! Copies text to the clipboard
+#if defined(_IRR_COMPILE_WITH_WINDOWS_DEVICE_)
+ virtual void copyToClipboard(const wchar_t* text) const = 0;
+#else
virtual void copyToClipboard(const c8* text) const = 0;
+#endif
//! Get text from the clipboard
/** \return Returns 0 if no string is in there. */
+#if defined(_IRR_COMPILE_WITH_WINDOWS_DEVICE_)
+ virtual const wchar_t* getTextFromClipboard() const = 0;
+#else
virtual const c8* getTextFromClipboard() const = 0;
+#endif
//! Get the processor speed in megahertz
/** \param MHz The integer variable to store the speed in.
diff --git a/lib/irrlicht/include/IrrCompileConfig.h b/lib/irrlicht/include/IrrCompileConfig.h
index 10a1bc279..380ed16a0 100644
--- a/lib/irrlicht/include/IrrCompileConfig.h
+++ b/lib/irrlicht/include/IrrCompileConfig.h
@@ -99,8 +99,10 @@
#if !defined(_IRR_WINDOWS_API_) && !defined(_IRR_OSX_PLATFORM_)
#ifndef _IRR_SOLARIS_PLATFORM_
+#if !defined(__linux__) && !defined(__FreeBSD__)
#define _IRR_LINUX_PLATFORM_
#endif
+#endif
#define _IRR_POSIX_API_
#define _IRR_COMPILE_WITH_X11_DEVICE_
#endif
diff --git a/lib/irrlicht/include/irrString.h b/lib/irrlicht/include/irrString.h
index 43557cd5c..c7d20595a 100644
--- a/lib/irrlicht/include/irrString.h
+++ b/lib/irrlicht/include/irrString.h
@@ -267,6 +267,36 @@ public:
*this = &tmpbuf[idx];
}
+
+ //! Constructs a string from an unsigned long long
+ explicit string(unsigned long long number)
+ : array(0), allocated(0), used(0)
+ {
+ // temporary buffer for 32 numbers
+
+ c8 tmpbuf[32]={0};
+ u32 idx = 31;
+
+ // special case '0'
+
+ if (!number)
+ {
+ tmpbuf[30] = '0';
+ *this = &tmpbuf[30];
+ return;
+ }
+
+ // add numbers
+
+ while(number && idx)
+ {
+ --idx;
+ tmpbuf[idx] = (c8)('0' + (number % 10));
+ number /= 10;
+ }
+
+ *this = &tmpbuf[idx];
+ }
//! Constructor for copying a string from a pointer with a given length
diff --git a/lib/irrlicht/source/Irrlicht/CAttributeImpl.h b/lib/irrlicht/source/Irrlicht/CAttributeImpl.h
index 2fbf50ebd..b7c9a455e 100644
--- a/lib/irrlicht/source/Irrlicht/CAttributeImpl.h
+++ b/lib/irrlicht/source/Irrlicht/CAttributeImpl.h
@@ -2028,7 +2028,7 @@ public:
{
u32 tmp;
sscanf(text, "0x%x", &tmp);
- Value = (void *) tmp;
+ Value = reinterpret_cast(tmp);
}
virtual E_ATTRIBUTE_TYPE getType() const
diff --git a/lib/irrlicht/source/Irrlicht/CGUIEditBox.cpp b/lib/irrlicht/source/Irrlicht/CGUIEditBox.cpp
index a937cc2bf..02e2130bb 100644
--- a/lib/irrlicht/source/Irrlicht/CGUIEditBox.cpp
+++ b/lib/irrlicht/source/Irrlicht/CGUIEditBox.cpp
@@ -286,7 +286,11 @@ bool CGUIEditBox::processKey(const SEvent& event)
const s32 realmbgn = MarkBegin < MarkEnd ? MarkBegin : MarkEnd;
const s32 realmend = MarkBegin < MarkEnd ? MarkEnd : MarkBegin;
+#ifdef _IRR_COMPILE_WITH_WINDOWS_DEVICE_
+ core::stringw s;
+#else
core::stringc s;
+#endif
s = Text.subString(realmbgn, realmend - realmbgn).c_str();
Operator->copyToClipboard(s.c_str());
}
@@ -299,7 +303,11 @@ bool CGUIEditBox::processKey(const SEvent& event)
const s32 realmend = MarkBegin < MarkEnd ? MarkEnd : MarkBegin;
// copy
+#ifdef _IRR_COMPILE_WITH_WINDOWS_DEVICE_
+ core::stringw sc;
+#else
core::stringc sc;
+#endif
sc = Text.subString(realmbgn, realmend - realmbgn).c_str();
Operator->copyToClipboard(sc.c_str());
@@ -329,7 +337,11 @@ bool CGUIEditBox::processKey(const SEvent& event)
const s32 realmend = MarkBegin < MarkEnd ? MarkEnd : MarkBegin;
// add new character
+#ifdef _IRR_COMPILE_WITH_WINDOWS_DEVICE_
+ const wchar_t* p = Operator->getTextFromClipboard();
+#else
const c8* p = Operator->getTextFromClipboard();
+#endif
if (p)
{
if (MarkBegin == MarkEnd)
diff --git a/lib/irrlicht/source/Irrlicht/CGUIEnvironment.cpp b/lib/irrlicht/source/Irrlicht/CGUIEnvironment.cpp
index bf3fa8666..19bd510f9 100644
--- a/lib/irrlicht/source/Irrlicht/CGUIEnvironment.cpp
+++ b/lib/irrlicht/source/Irrlicht/CGUIEnvironment.cpp
@@ -599,6 +599,18 @@ bool CGUIEnvironment::postEventFromUser(const SEvent& event)
}
break;
+#ifdef _IRR_COMPILE_WITH_WINDOWS_DEVICE_
+ case EET_IMPUT_METHOD_EVENT:
+ {
+ // todo : if CGUIEdit has not focus, close input method. Use WM_NOTIFY message.
+ if (Focus)
+ {
+ _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX;
+ return Focus->OnEvent(event);
+ }
+ }
+ break;
+#endif
default:
break;
} // end switch
diff --git a/lib/irrlicht/source/Irrlicht/CIrrDeviceLinux.cpp b/lib/irrlicht/source/Irrlicht/CIrrDeviceLinux.cpp
index a0bd1eae2..926b81a70 100644
--- a/lib/irrlicht/source/Irrlicht/CIrrDeviceLinux.cpp
+++ b/lib/irrlicht/source/Irrlicht/CIrrDeviceLinux.cpp
@@ -14,6 +14,7 @@ extern bool GLContextDebugBit;
#include
#include
#include
+#include
#include "IEventReceiver.h"
#include "ISceneManager.h"
#include "IGUIEnvironment.h"
@@ -38,7 +39,7 @@ extern bool GLContextDebugBit;
#ifdef __FreeBSD__
#include
-#else
+#elif defined(__linux__)
// linux/joystick.h includes linux/input.h, which #defines values for various KEY_FOO keys.
// These override the irr::KEY_FOO equivalents, which stops key handling from working.
@@ -83,6 +84,7 @@ CIrrDeviceLinux::CIrrDeviceLinux(const SIrrlichtCreationParameters& param)
: CIrrDeviceStub(param),
#ifdef _IRR_COMPILE_WITH_X11_
display(0), visual(0), screennr(0), window(0), StdHints(0), SoftwareImage(0),
+ XInputMethod(0), XInputContext(0),
#ifdef _IRR_COMPILE_WITH_OPENGL_
glxWin(0),
Context(0),
@@ -134,6 +136,10 @@ CIrrDeviceLinux::CIrrDeviceLinux(const SIrrlichtCreationParameters& param)
if (!VideoDriver)
return;
+#ifdef _IRR_COMPILE_WITH_X11_
+ createInputContext();
+#endif
+
createGUIAndScene();
}
@@ -168,6 +174,8 @@ CIrrDeviceLinux::~CIrrDeviceLinux()
VideoDriver = NULL;
}
+ destroyInputContext();
+
if (display)
{
#ifdef _IRR_COMPILE_WITH_OPENGL_
@@ -645,11 +653,11 @@ bool CIrrDeviceLinux::createWindow()
GLX_SAMPLE_BUFFERS_SGIS, 1,
GLX_SAMPLES_SGIS, CreationParams.AntiAlias, // 18,19
#endif
-//#ifdef GL_ARB_framebuffer_sRGB
-// GLX_FRAMEBUFFER_SRGB_CAPABLE_ARB, CreationParams.HandleSRGB,
-//#elif defined(GL_EXT_framebuffer_sRGB)
-// GLX_FRAMEBUFFER_SRGB_CAPABLE_EXT, CreationParams.HandleSRGB,
-//#endif
+#ifdef GLX_ARB_framebuffer_sRGB
+ GLX_FRAMEBUFFER_SRGB_CAPABLE_ARB, CreationParams.HandleSRGB,
+#elif defined(GLX_EXT_framebuffer_sRGB)
+ GLX_FRAMEBUFFER_SRGB_CAPABLE_EXT, CreationParams.HandleSRGB,
+#endif
GLX_STEREO, CreationParams.Stereobuffer?True:False,
None
};
@@ -796,11 +804,11 @@ bool CIrrDeviceLinux::createWindow()
// GLX_USE_GL, which is silently ignored by glXChooseVisual
CreationParams.Doublebuffer?GLX_DOUBLEBUFFER:GLX_USE_GL, // 14
CreationParams.Stereobuffer?GLX_STEREO:GLX_USE_GL, // 15
-//#ifdef GL_ARB_framebuffer_sRGB
-// CreationParams.HandleSRGB?GLX_FRAMEBUFFER_SRGB_CAPABLE_ARB:GLX_USE_GL,
-//#elif defined(GL_EXT_framebuffer_sRGB)
-// CreationParams.HandleSRGB?GLX_FRAMEBUFFER_SRGB_CAPABLE_EXT:GLX_USE_GL,
-//#endif
+#ifdef GLX_ARB_framebuffer_sRGB
+ CreationParams.HandleSRGB?GLX_FRAMEBUFFER_SRGB_CAPABLE_ARB:GLX_USE_GL,
+#elif defined(GLX_EXT_framebuffer_sRGB)
+ CreationParams.HandleSRGB?GLX_FRAMEBUFFER_SRGB_CAPABLE_EXT:GLX_USE_GL,
+#endif
None
};
@@ -1154,6 +1162,123 @@ void CIrrDeviceLinux::createDriver()
}
}
+#ifdef _IRR_COMPILE_WITH_X11_
+bool CIrrDeviceLinux::createInputContext()
+{
+ // One one side it would be nicer to let users do that - on the other hand
+ // not setting the environment locale will not work when using i18n X11 functions.
+ // So users would have to call it always or their input is broken badly.
+ // We can restore immediately - so won't mess with anything in users apps.
+ core::stringc oldLocale(setlocale(LC_CTYPE, NULL));
+ setlocale(LC_CTYPE, ""); // use environment locale
+
+ if ( !XSupportsLocale() )
+ {
+ os::Printer::log("Locale not supported. Falling back to non-i18n input.", ELL_WARNING);
+ setlocale(LC_CTYPE, oldLocale.c_str());
+ return false;
+ }
+
+ XInputMethod = XOpenIM(display, NULL, NULL, NULL);
+ if ( !XInputMethod )
+ {
+ setlocale(LC_CTYPE, oldLocale.c_str());
+ os::Printer::log("XOpenIM failed to create an input method. Falling back to non-i18n input.", ELL_WARNING);
+ return false;
+ }
+
+ XIMStyles *im_supported_styles;
+ XGetIMValues(XInputMethod, XNQueryInputStyle, &im_supported_styles, (char*)NULL);
+ XIMStyle bestStyle = 0;
+ // TODO: If we want to support languages like chinese or japanese as well we probably have to work with callbacks here.
+ XIMStyle supportedStyle = XIMPreeditNone | XIMStatusNone;
+ for (int i=0; i < im_supported_styles->count_styles; ++i)
+ {
+ XIMStyle style = im_supported_styles->supported_styles[i];
+ if ((style & supportedStyle) == style) /* if we can handle it */
+ {
+ bestStyle = style;
+ break;
+ }
+ }
+ XFree(im_supported_styles);
+
+ if ( !bestStyle )
+ {
+ XDestroyIC(XInputContext);
+ XInputContext = 0;
+
+ os::Printer::log("XInputMethod has no input style we can use. Falling back to non-i18n input.", ELL_WARNING);
+ setlocale(LC_CTYPE, oldLocale.c_str());
+ return false;
+ }
+
+ XInputContext = XCreateIC(XInputMethod,
+ XNInputStyle, bestStyle,
+ XNClientWindow, window,
+ (char*)NULL);
+ if (!XInputContext )
+ {
+ os::Printer::log("XInputContext failed to create an input context. Falling back to non-i18n input.", ELL_WARNING);
+ setlocale(LC_CTYPE, oldLocale.c_str());
+ return false;
+ }
+ XSetICFocus(XInputContext);
+ setlocale(LC_CTYPE, oldLocale.c_str());
+ return true;
+}
+
+void CIrrDeviceLinux::destroyInputContext()
+{
+ if ( XInputContext )
+ {
+ XUnsetICFocus(XInputContext);
+ XDestroyIC(XInputContext);
+ XInputContext = 0;
+ }
+ if ( XInputMethod )
+ {
+ XCloseIM(XInputMethod);
+ XInputMethod = 0;
+ }
+}
+
+EKEY_CODE CIrrDeviceLinux::getKeyCode(XEvent &event)
+{
+ EKEY_CODE keyCode = (EKEY_CODE)0;
+
+ SKeyMap mp;
+ mp.X11Key = XkbKeycodeToKeysym(display, event.xkey.keycode, 0, 0);
+ // mp.X11Key = XKeycodeToKeysym(XDisplay, event.xkey.keycode, 0); // deprecated, if we still find platforms which need that we have to use some define
+ const s32 idx = KeyMap.binary_search(mp);
+ if (idx != -1)
+ {
+ keyCode = (EKEY_CODE)KeyMap[idx].Win32Key;
+ }
+ if (keyCode == 0)
+ {
+ // Any value is better than none, that allows at least using the keys.
+ // Worst case is that some keys will be identical, still better than _all_
+ // unknown keys being identical.
+ if ( !mp.X11Key )
+ {
+ keyCode = (EKEY_CODE)event.xkey.keycode;
+ os::Printer::log("No such X11Key, using event keycode", core::stringc(event.xkey.keycode).c_str(), ELL_INFORMATION);
+ }
+ else if (idx == -1)
+ {
+ keyCode = (EKEY_CODE)mp.X11Key;
+ os::Printer::log("EKEY_CODE not found, using orig. X11 keycode", core::stringc(mp.X11Key).c_str(), ELL_INFORMATION);
+ }
+ else
+ {
+ keyCode = (EKEY_CODE)mp.X11Key;
+ os::Printer::log("EKEY_CODE is 0, using orig. X11 keycode", core::stringc(mp.X11Key).c_str(), ELL_INFORMATION);
+ }
+ }
+ return keyCode;
+}
+#endif
//! runs the device. Returns false if device wants to be deleted
bool CIrrDeviceLinux::run()
@@ -1330,52 +1455,60 @@ bool CIrrDeviceLinux::run()
(next_event.xkey.keycode == event.xkey.keycode) &&
(next_event.xkey.time - event.xkey.time) < 2) // usually same time, but on some systems a difference of 1 is possible
{
- /* Ignore the key release event */
+ // Ignore the key release event
break;
}
}
- // fall-through in case the release should be handled
+
+ irrevent.EventType = irr::EET_KEY_INPUT_EVENT;
+ irrevent.KeyInput.PressedDown = false;
+ irrevent.KeyInput.Char = 0; // on release that's undefined
+ irrevent.KeyInput.Control = (event.xkey.state & ControlMask) != 0;
+ irrevent.KeyInput.Shift = (event.xkey.state & ShiftMask) != 0;
+ irrevent.KeyInput.Key = getKeyCode(event);
+
+ postEventFromUser(irrevent);
+ break;
+
case KeyPress:
{
SKeyMap mp;
- char buf[8]={0};
- XLookupString(&event.xkey, buf, sizeof(buf), &mp.X11Key, NULL);
-
- irrevent.EventType = irr::EET_KEY_INPUT_EVENT;
- irrevent.KeyInput.PressedDown = (event.type == KeyPress);
-// mbtowc(&irrevent.KeyInput.Char, buf, sizeof(buf));
- irrevent.KeyInput.Char = ((wchar_t*)(buf))[0];
- irrevent.KeyInput.Control = (event.xkey.state & ControlMask) != 0;
- irrevent.KeyInput.Shift = (event.xkey.state & ShiftMask) != 0;
-
- event.xkey.state &= ~(ControlMask|ShiftMask); // ignore shift-ctrl states for figuring out the key
- XLookupString(&event.xkey, buf, sizeof(buf), &mp.X11Key, NULL);
- const s32 idx = KeyMap.binary_search(mp);
- if (idx != -1)
+ if ( XInputContext )
{
- irrevent.KeyInput.Key = (EKEY_CODE)KeyMap[idx].Win32Key;
- }
- else
- {
- irrevent.KeyInput.Key = (EKEY_CODE)0;
- }
- if (irrevent.KeyInput.Key == 0)
- {
- // 1:1 mapping to windows-keys would require testing for keyboard type (us, ger, ...)
- // So unless we do that we will have some unknown keys here.
- if (idx == -1)
+ wchar_t buf[8]={0};
+ Status status;
+ int strLen = XwcLookupString(XInputContext, &event.xkey, buf, sizeof(buf), &mp.X11Key, &status);
+ if ( status == XBufferOverflow )
{
- os::Printer::log("Could not find EKEY_CODE, using orig. X11 keycode instead", core::stringc(event.xkey.keycode).c_str(), ELL_INFORMATION);
+ os::Printer::log("XwcLookupString needs a larger buffer", ELL_INFORMATION);
+ }
+ if ( strLen > 0 && (status == XLookupChars || status == XLookupBoth) )
+ {
+ if ( strLen > 1 )
+ os::Printer::log("Additional returned characters dropped", ELL_INFORMATION);
+ irrevent.KeyInput.Char = buf[0];
}
else
{
- os::Printer::log("EKEY_CODE is 0, using orig. X11 keycode instead", core::stringc(event.xkey.keycode).c_str(), ELL_INFORMATION);
+ irrevent.KeyInput.Char = 0;
}
- // Any value is better than none, that allows at least using the keys.
- // Worst case is that some keys will be identical, still better than _all_
- // unknown keys being identical.
- irrevent.KeyInput.Key = (EKEY_CODE)event.xkey.keycode;
}
+ else // Old version without InputContext. Does not support i18n, but good to have as fallback.
+ {
+ union
+ {
+ char buf[8];
+ wchar_t wbuf[2];
+ } tmp = {0};
+ XLookupString(&event.xkey, tmp.buf, sizeof(tmp.buf), &mp.X11Key, NULL);
+ irrevent.KeyInput.Char = tmp.wbuf[0];
+ }
+
+ irrevent.EventType = irr::EET_KEY_INPUT_EVENT;
+ irrevent.KeyInput.PressedDown = true;
+ irrevent.KeyInput.Control = (event.xkey.state & ControlMask) != 0;
+ irrevent.KeyInput.Shift = (event.xkey.state & ShiftMask) != 0;
+ irrevent.KeyInput.Key = getKeyCode(event);
postEventFromUser(irrevent);
}
@@ -2052,7 +2185,7 @@ bool CIrrDeviceLinux::activateJoysticks(core::array & joystickInf
#ifdef __FreeBSD__
info.axes=2;
info.buttons=2;
-#else
+#elif defined(__linux__)
ioctl( info.fd, JSIOCGAXES, &(info.axes) );
ioctl( info.fd, JSIOCGBUTTONS, &(info.buttons) );
fcntl( info.fd, F_SETFL, O_NONBLOCK );
@@ -2074,7 +2207,7 @@ bool CIrrDeviceLinux::activateJoysticks(core::array & joystickInf
returnInfo.Axes = info.axes;
returnInfo.Buttons = info.buttons;
-#ifndef __FreeBSD__
+#if !defined(__FreeBSD__) && !defined(__OpenBSD__)
char name[80];
ioctl( info.fd, JSIOCGNAME(80), name);
returnInfo.Name = name;
@@ -2119,7 +2252,7 @@ void CIrrDeviceLinux::pollJoysticks()
info.persistentData.JoystickEvent.Axis[0] = js.x; /* X axis */
info.persistentData.JoystickEvent.Axis[1] = js.y; /* Y axis */
}
-#else
+#elif defined(__linux__)
struct js_event event;
while (sizeof(event) == read(info.fd, &event, sizeof(event)))
{
diff --git a/lib/irrlicht/source/Irrlicht/CIrrDeviceLinux.h b/lib/irrlicht/source/Irrlicht/CIrrDeviceLinux.h
index c808b8ebd..a50c7fa74 100644
--- a/lib/irrlicht/source/Irrlicht/CIrrDeviceLinux.h
+++ b/lib/irrlicht/source/Irrlicht/CIrrDeviceLinux.h
@@ -153,6 +153,12 @@ namespace irr
bool restoreResolution();
bool changeResolution();
+#ifdef _IRR_COMPILE_WITH_X11_
+ bool createInputContext();
+ void destroyInputContext();
+ EKEY_CODE getKeyCode(XEvent &event);
+#endif
+
//! Implementation of the linux cursor control
class CCursorControl : public gui::ICursorControl
{
@@ -390,6 +396,8 @@ namespace irr
XSetWindowAttributes attributes;
XSizeHints* StdHints;
XImage* SoftwareImage;
+ XIM XInputMethod;
+ XIC XInputContext;
mutable core::stringc Clipboard;
#ifdef _IRR_LINUX_X11_VIDMODE_
XF86VidModeModeInfo oldVideoMode;
diff --git a/lib/irrlicht/source/Irrlicht/CIrrDeviceSDL.cpp b/lib/irrlicht/source/Irrlicht/CIrrDeviceSDL.cpp
index a4c2b5cb5..57540bf7e 100644
--- a/lib/irrlicht/source/Irrlicht/CIrrDeviceSDL.cpp
+++ b/lib/irrlicht/source/Irrlicht/CIrrDeviceSDL.cpp
@@ -478,7 +478,7 @@ bool CIrrDeviceSDL::run()
joyevent.JoystickEvent.ButtonStates |= (SDL_JoystickGetButton(joystick, j)<(SEvent::SJoystickEvent::NUMBER_OF_AXES));
joyevent.JoystickEvent.Axis[SEvent::SJoystickEvent::AXIS_X]=0;
joyevent.JoystickEvent.Axis[SEvent::SJoystickEvent::AXIS_Y]=0;
joyevent.JoystickEvent.Axis[SEvent::SJoystickEvent::AXIS_Z]=0;
diff --git a/lib/irrlicht/source/Irrlicht/CIrrDeviceWin32.cpp b/lib/irrlicht/source/Irrlicht/CIrrDeviceWin32.cpp
index 432e1e640..13759996f 100644
--- a/lib/irrlicht/source/Irrlicht/CIrrDeviceWin32.cpp
+++ b/lib/irrlicht/source/Irrlicht/CIrrDeviceWin32.cpp
@@ -34,6 +34,9 @@
#endif
#endif
+#include
+#pragma comment(lib, "imm32.lib")
+
namespace irr
{
namespace video
@@ -692,6 +695,28 @@ irr::CIrrDeviceWin32* getDeviceFromHWnd(HWND hWnd)
}
+namespace irr
+{
+ void updateICPos(void* hWnd, s32 x, s32 y, s32 height)
+ {
+ COMPOSITIONFORM cf;
+ HWND hwnd = (HWND)hWnd;
+ HIMC hIMC = ImmGetContext(hwnd);
+
+ if(hIMC)
+ {
+ cf.dwStyle = CFS_POINT;
+ cf.ptCurrentPos.x = x;
+ cf.ptCurrentPos.y = y - height;
+
+ ImmSetCompositionWindow(hIMC, &cf);
+
+ ImmReleaseContext(hwnd, hIMC);
+ }
+ }
+} // end of namespace irr
+
+
LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
#ifndef WM_MOUSEWHEEL
@@ -802,6 +827,16 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
}
}
}
+
+ if (m->irrMessage == irr::EMIE_LMOUSE_PRESSED_DOWN || m->irrMessage == irr::EMIE_LMOUSE_LEFT_UP)
+ {
+ event.EventType = irr::EET_IMPUT_METHOD_EVENT;
+ event.InputMethodEvent.Event = irr::EIME_CHANGE_POS;
+ event.InputMethodEvent.Handle = hWnd;
+
+ if (dev)
+ dev->postEventFromUser(event);
+ }
return 0;
}
@@ -818,6 +853,30 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
case WM_ERASEBKGND:
return 0;
+ case WM_IME_CHAR:
+ {
+ event.EventType = irr::EET_IMPUT_METHOD_EVENT;
+ event.InputMethodEvent.Event = irr::EIME_CHAR_INPUT;
+ event.InputMethodEvent.Handle = hWnd;
+
+ event.KeyInput.Char = 0;
+ event.KeyInput.Key = irr::KEY_OEM_CLEAR;
+ event.KeyInput.Shift = 0;
+ event.KeyInput.Control = 0;
+
+ char bits[2] = { (char)((wParam & 0xff00) >> 8), (char)(wParam & 0xff) };
+ if (bits[0] == 0)
+ event.InputMethodEvent.Char = (wchar_t)wParam;
+ else
+ MultiByteToWideChar(CP_OEMCP, MB_PRECOMPOSED, bits, 2, &event.InputMethodEvent.Char, 1);
+
+ dev = getDeviceFromHWnd(hWnd);
+ if (dev)
+ dev->postEventFromUser(event);
+
+ return 0;
+ }
+
case WM_SYSKEYDOWN:
case WM_SYSKEYUP:
case WM_KEYDOWN:
@@ -879,6 +938,13 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
event.KeyInput.Control = 0;
dev = getDeviceFromHWnd(hWnd);
+ if (dev)
+ dev->postEventFromUser(event);
+
+ event.EventType = irr::EET_IMPUT_METHOD_EVENT;
+ event.InputMethodEvent.Event = irr::EIME_CHANGE_POS;
+ event.InputMethodEvent.Handle = hWnd;
+
if (dev)
dev->postEventFromUser(event);
@@ -932,6 +998,12 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
dev->switchToFullScreen();
}
}
+ event.EventType = irr::EET_IMPUT_METHOD_EVENT;
+ event.InputMethodEvent.Event = irr::EIME_CHANGE_POS;
+ event.InputMethodEvent.Handle = hWnd;
+
+ if (dev)
+ dev->postEventFromUser(event);
break;
case WM_USER:
@@ -1115,6 +1187,9 @@ CIrrDeviceWin32::CIrrDeviceWin32(const SIrrlichtCreationParameters& params)
// inform driver about the window size etc.
resizeIfNecessary();
+
+ // for reset the position of composition window
+ updateICPos(HWnd, 0, 0, 0);
}
@@ -1870,6 +1945,8 @@ void CIrrDeviceWin32::handleSystemMessages()
// No message translation because we don't use WM_CHAR and it would conflict with our
// deadkey handling.
+ TranslateMessage(&msg);
+
if (ExternalWindow && msg.hwnd == HWnd)
WndProc(HWnd, msg.message, msg.wParam, msg.lParam);
else
diff --git a/lib/irrlicht/source/Irrlicht/COSOperator.cpp b/lib/irrlicht/source/Irrlicht/COSOperator.cpp
index 5ade8a5b4..e2166156f 100644
--- a/lib/irrlicht/source/Irrlicht/COSOperator.cpp
+++ b/lib/irrlicht/source/Irrlicht/COSOperator.cpp
@@ -12,6 +12,7 @@
#include
#include
#if !defined(_IRR_SOLARIS_PLATFORM_) && !defined(__CYGWIN__)
+#include
#include
#include
#endif
@@ -52,6 +53,37 @@ const core::stringc& COSOperator::getOperatingSystemVersion() const
//! copies text to the clipboard
+#if defined(_IRR_COMPILE_WITH_WINDOWS_DEVICE_)
+void COSOperator::copyToClipboard(const wchar_t* text) const
+{
+ if (wcslen(text)==0)
+ return;
+
+// Windows version
+#if defined(_IRR_XBOX_PLATFORM_)
+#elif defined(_IRR_WINDOWS_API_)
+ if (!OpenClipboard(NULL) || text == 0)
+ return;
+
+ EmptyClipboard();
+
+ HGLOBAL clipbuffer;
+ wchar_t * buffer;
+
+ clipbuffer = GlobalAlloc(GMEM_DDESHARE, wcslen(text)*sizeof(wchar_t) + sizeof(wchar_t));
+ buffer = (wchar_t*)GlobalLock(clipbuffer);
+
+ wcscpy(buffer, text);
+
+ GlobalUnlock(clipbuffer);
+ SetClipboardData(CF_UNICODETEXT, clipbuffer); //Windwos converts between CF_UNICODETEXT and CF_TEXT automatically.
+ CloseClipboard();
+
+#else
+
+#endif
+}
+#else
void COSOperator::copyToClipboard(const c8* text) const
{
if (strlen(text)==0)
@@ -89,10 +121,34 @@ void COSOperator::copyToClipboard(const c8* text) const
#endif
}
+#endif
//! gets text from the clipboard
//! \return Returns 0 if no string is in there.
+#if defined(_IRR_COMPILE_WITH_WINDOWS_DEVICE_)
+const wchar_t* COSOperator::getTextFromClipboard() const
+{
+#if defined(_IRR_XBOX_PLATFORM_)
+ return 0;
+#elif defined(_IRR_WINDOWS_API_)
+ if (!OpenClipboard(NULL))
+ return 0;
+
+ wchar_t * buffer = 0;
+
+ HANDLE hData = GetClipboardData( CF_UNICODETEXT ); //Windwos converts between CF_UNICODETEXT and CF_TEXT automatically.
+ buffer = (wchar_t*)GlobalLock( hData );
+ GlobalUnlock( hData );
+ CloseClipboard();
+ return buffer;
+
+#else
+
+ return 0;
+#endif
+}
+#else
const c8* COSOperator::getTextFromClipboard() const
{
#if defined(_IRR_XBOX_PLATFORM_)
@@ -122,6 +178,7 @@ const c8* COSOperator::getTextFromClipboard() const
return 0;
#endif
}
+#endif
bool COSOperator::getProcessorSpeedMHz(u32* MHz) const
diff --git a/lib/irrlicht/source/Irrlicht/COSOperator.h b/lib/irrlicht/source/Irrlicht/COSOperator.h
index 819805fb2..44f7680c2 100644
--- a/lib/irrlicht/source/Irrlicht/COSOperator.h
+++ b/lib/irrlicht/source/Irrlicht/COSOperator.h
@@ -27,11 +27,19 @@ public:
virtual const core::stringc& getOperatingSystemVersion() const;
//! copies text to the clipboard
+#if defined(_IRR_COMPILE_WITH_WINDOWS_DEVICE_)
+ virtual void copyToClipboard(const wchar_t* text) const;
+#else
virtual void copyToClipboard(const c8* text) const;
+#endif
//! gets text from the clipboard
//! \return Returns 0 if no string is in there.
+#if defined(_IRR_COMPILE_WITH_WINDOWS_DEVICE_)
+ virtual const wchar_t* getTextFromClipboard() const;
+#else
virtual const c8* getTextFromClipboard() const;
+#endif
//! gets the processor speed in megahertz
//! \param Mhz:
diff --git a/lib/irrlicht/source/Irrlicht/COpenGLDriver.cpp b/lib/irrlicht/source/Irrlicht/COpenGLDriver.cpp
index f2f527ec1..f555477a6 100644
--- a/lib/irrlicht/source/Irrlicht/COpenGLDriver.cpp
+++ b/lib/irrlicht/source/Irrlicht/COpenGLDriver.cpp
@@ -805,13 +805,15 @@ bool COpenGLDriver::genericDriverInit()
Params.HandleSRGB &= ((FeatureAvailable[IRR_ARB_framebuffer_sRGB] || FeatureAvailable[IRR_EXT_framebuffer_sRGB]) &&
FeatureAvailable[IRR_EXT_texture_sRGB]);
-#if defined(GL_ARB_framebuffer_sRGB)
- if (Params.HandleSRGB)
- glEnable(GL_FRAMEBUFFER_SRGB);
-#elif defined(GL_EXT_framebuffer_sRGB)
- if (Params.HandleSRGB)
- glEnable(GL_FRAMEBUFFER_SRGB_EXT);
-#endif
+
+ glDisable(GL_FRAMEBUFFER_SRGB);
+//#if defined(GL_ARB_framebuffer_sRGB)
+// if (Params.HandleSRGB)
+// glEnable(GL_FRAMEBUFFER_SRGB);
+//#elif defined(GL_EXT_framebuffer_sRGB)
+// if (Params.HandleSRGB)
+// glEnable(GL_FRAMEBUFFER_SRGB_EXT);
+//#endif
// This is a fast replacement for NORMALIZE_NORMALS
// if ((Version>101) || FeatureAvailable[IRR_EXT_rescale_normal])
diff --git a/lib/irrlicht/source/Irrlicht/COpenGLTexture.cpp b/lib/irrlicht/source/Irrlicht/COpenGLTexture.cpp
index ef20da830..a25cb4ca1 100644
--- a/lib/irrlicht/source/Irrlicht/COpenGLTexture.cpp
+++ b/lib/irrlicht/source/Irrlicht/COpenGLTexture.cpp
@@ -274,15 +274,15 @@ GLint COpenGLTexture::getOpenGLFormatAndParametersFromColorFormat(ECOLOR_FORMAT
internalformat = GL_RGBA8;
}
}
-#if defined(GL_ARB_framebuffer_sRGB) || defined(GL_EXT_framebuffer_sRGB)
- if (Driver->Params.HandleSRGB)
- {
- if (internalformat==GL_RGBA)
- internalformat=GL_SRGB_ALPHA_EXT;
- else if (internalformat==GL_RGB)
- internalformat=GL_SRGB_EXT;
- }
-#endif
+//#if defined(GL_ARB_framebuffer_sRGB) || defined(GL_EXT_framebuffer_sRGB)
+// if (Driver->Params.HandleSRGB)
+// {
+// if (internalformat==GL_RGBA)
+// internalformat=GL_SRGB_ALPHA_EXT;
+// else if (internalformat==GL_RGB)
+// internalformat=GL_SRGB_EXT;
+// }
+//#endif
return internalformat;
}
diff --git a/lib/irrlicht/source/Irrlicht/os.cpp b/lib/irrlicht/source/Irrlicht/os.cpp
index a801667fb..b847ffd5b 100644
--- a/lib/irrlicht/source/Irrlicht/os.cpp
+++ b/lib/irrlicht/source/Irrlicht/os.cpp
@@ -22,10 +22,14 @@
#include
#define bswap_16(X) OSReadSwapInt16(&X,0)
#define bswap_32(X) OSReadSwapInt32(&X,0)
-#elif defined(__FreeBSD__) || defined(__OpenBSD__)
+#elif defined(__FreeBSD__)
#include
#define bswap_16(X) bswap16(X)
#define bswap_32(X) bswap32(X)
+#elif defined(__OpenBSD__)
+ #include
+ #define bswap_16(X) swap16(X)
+ #define bswap_32(X) swap32(X)
#elif !defined(_IRR_SOLARIS_PLATFORM_) && !defined(__PPC__) && !defined(_IRR_WINDOWS_API_)
#include
#else
diff --git a/lib/wiiuse/os_win.c b/lib/wiiuse/os_win.c
index 156ae4d7d..108284dfe 100644
--- a/lib/wiiuse/os_win.c
+++ b/lib/wiiuse/os_win.c
@@ -42,18 +42,6 @@
#include
#include
-#ifdef __MINGW32__
-/* this prototype is missing from the mingw headers so we must add it
- or suffer linker errors. */
-# ifdef __cplusplus
-extern "C" {
-# endif
- HIDAPI BOOL NTAPI HidD_SetOutputReport(HANDLE, PVOID, ULONG);
-# ifdef __cplusplus
-}
-# endif
-#endif
-
int wiiuse_os_find(struct wiimote_t** wm, int max_wiimotes, int timeout) {
GUID device_id;
HANDLE dev;
diff --git a/sources.cmake b/sources.cmake
index e7f553234..d4f28ae4d 100644
--- a/sources.cmake
+++ b/sources.cmake
@@ -1,5 +1,5 @@
-# Modify this file to change the last-modified date when you add/remove a file.
-# This will then trigger a new cmake run automatically.
+# Modify this file to change the last-modified date when you add/remove a file.
+# This will then trigger a new cmake run automatically.
file(GLOB_RECURSE STK_HEADERS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "src/*.hpp")
file(GLOB_RECURSE STK_SOURCES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "src/*.cpp")
file(GLOB_RECURSE STK_SHADERS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "data/shaders/*")
diff --git a/src/config/player_manager.cpp b/src/config/player_manager.cpp
index 1495ff4e6..171050be3 100644
--- a/src/config/player_manager.cpp
+++ b/src/config/player_manager.cpp
@@ -269,7 +269,7 @@ void PlayerManager::save()
if(m_current_player)
{
players_file << L" getName()) << L"\"/>\n";
+ << StringUtils::xmlEncode(m_current_player->getName(true/*ignoreRTL*/)) << L"\"/>\n";
}
// Save all non-guest players
@@ -327,7 +327,7 @@ void PlayerManager::enforceCurrentPlayer()
if (!player->isGuestAccount())
{
Log::info("PlayerManager", "Enforcing current player '%ls'.",
- player->getName().c_str() );
+ player->getName(true/*ignoreRTL*/).c_str());
m_current_player = player;
return;
}
@@ -341,7 +341,7 @@ void PlayerManager::enforceCurrentPlayer()
if (!player->isGuestAccount())
{
Log::info("PlayerManager", "Enforcing current player '%s'.",
- player->getName().c_str());
+ player->getName(true/*ignoreRTL*/).c_str());
m_current_player = player;
return;
}
@@ -454,7 +454,7 @@ PlayerProfile *PlayerManager::getPlayer(const irr::core::stringw &name)
{
for (PlayerProfile* player : m_all_players)
{
- if(player->getName()==name)
+ if(player->getName(true/*ignoreRTL*/)==name)
return player;
}
return NULL;
diff --git a/src/config/player_profile.hpp b/src/config/player_profile.hpp
index 8cef55762..780b04b33 100644
--- a/src/config/player_profile.hpp
+++ b/src/config/player_profile.hpp
@@ -24,6 +24,7 @@
#include "utils/leak_check.hpp"
#include "utils/no_copy.hpp"
#include "utils/types.hpp"
+#include "utils/translation.hpp"
#include
using namespace irr;
@@ -154,10 +155,17 @@ public:
// ------------------------------------------------------------------------
/** Returns the name of this player. */
- core::stringw getName() const
+ const core::stringw getName(bool ignore_rtl = false) const
{
assert(m_magic_number == 0xABCD1234);
- return m_local_name.c_str();
+ if (ignore_rtl)
+ return m_local_name;
+ else
+ {
+ const core::stringw fribidized_name =
+ translations->fribidize(m_local_name);
+ return fribidized_name;
+ }
} // getName
// ------------------------------------------------------------------------
@@ -171,9 +179,16 @@ public:
} // isGuestAccount
// ------------------------------------------------------------------------
/** Returns the last used online name. */
- const core::stringw& getLastOnlineName() const
+ const core::stringw getLastOnlineName(bool ignore_rtl = false) const
{
- return m_last_online_name;
+ if (ignore_rtl)
+ return m_last_online_name;
+ else
+ {
+ const core::stringw fribidized_name =
+ translations->fribidize(m_last_online_name);
+ return fribidized_name;
+ }
} // getLastOnlineName
// ------------------------------------------------------------------------
/** Sets the last used online name. */
diff --git a/src/config/stk_config.cpp b/src/config/stk_config.cpp
index 58650278e..6ca5ce857 100644
--- a/src/config/stk_config.cpp
+++ b/src/config/stk_config.cpp
@@ -27,7 +27,6 @@
#include "io/xml_node.hpp"
#include "items/item.hpp"
#include "karts/kart_properties.hpp"
-#include "karts/player_difficulty.hpp"
#include "utils/log.hpp"
STKConfig* stk_config=0;
@@ -119,19 +118,8 @@ void STKConfig::load(const std::string &filename)
}
CHECK_NEG(m_max_karts, "" );
@@ -163,18 +151,13 @@ void STKConfig::load(const std::string &filename)
*/
void STKConfig::init_defaults()
{
- m_anvil_weight = m_parachute_friction =
- m_parachute_time = m_parachute_lbound_fraction =
- m_parachute_time_other = m_anvil_speed_factor =
- m_bomb_time = m_bomb_time_increase =
- m_anvil_time = m_music_credit_time =
+ m_bomb_time = m_bomb_time_increase =
+ m_explosion_impulse_objects = m_music_credit_time =
m_delay_finish_time = m_skid_fadeout_time =
m_near_ground = m_item_switch_time =
- m_smooth_angle_limit = m_parachute_ubound_fraction =
- m_penalty_time = m_explosion_impulse_objects =
- m_parachute_max_speed = UNDEFINED;
+ m_smooth_angle_limit = m_penalty_time =
+ UNDEFINED;
m_bubblegum_counter = -100;
- m_bubblegum_shield_time = -100;
m_shield_restrict_weapos = false;
m_max_karts = -100;
m_max_skidmarks = -100;
@@ -310,23 +293,6 @@ void STKConfig::getAllData(const XMLNode * root)
credits_node->get("music", &m_music_credit_time);
- if(const XMLNode *anvil_node= root->getNode("anvil"))
- {
- anvil_node->get("weight", &m_anvil_weight );
- anvil_node->get("speed-factor", &m_anvil_speed_factor);
- anvil_node->get("time", &m_anvil_time );
- }
-
- if(const XMLNode *parachute_node= root->getNode("parachute"))
- {
- parachute_node->get("friction", &m_parachute_friction );
- parachute_node->get("time", &m_parachute_time );
- parachute_node->get("time-other", &m_parachute_time_other );
- parachute_node->get("lbound-fraction", &m_parachute_lbound_fraction);
- parachute_node->get("ubound-fraction", &m_parachute_ubound_fraction);
- parachute_node->get("max-speed", &m_parachute_max_speed );
- }
-
if(const XMLNode *bomb_node= root->getNode("bomb"))
{
bomb_node->get("time", &m_bomb_time);
@@ -359,7 +325,6 @@ void STKConfig::getAllData(const XMLNode * root)
if(const XMLNode *bubblegum_node= root->getNode("bubblegum"))
{
bubblegum_node->get("disappear-counter", &m_bubblegum_counter );
- bubblegum_node->get("shield-time", &m_bubblegum_shield_time );
bubblegum_node->get("restrict-weapons", &m_shield_restrict_weapos);
}
@@ -415,14 +380,6 @@ void STKConfig::getAllData(const XMLNode * root)
m_kart_properties[type->getName()]->copyFrom(m_default_kart_properties);
m_kart_properties[type->getName()]->getAllData(type);
}
-
- child_node = node->getNode("difficulties");
- for (unsigned int i = 0; i < child_node->getNumNodes(); ++i)
- {
- const XMLNode* type = child_node->getNode(i);
- m_player_difficulties[i] = new PlayerDifficulty();
- m_player_difficulties[i]->getAllData(type);
- }
} // getAllData
// ----------------------------------------------------------------------------
diff --git a/src/config/stk_config.hpp b/src/config/stk_config.hpp
index 62da73c98..89245a0f8 100644
--- a/src/config/stk_config.hpp
+++ b/src/config/stk_config.hpp
@@ -34,7 +34,6 @@
#include