Commit b56ddb92 authored by hybrid's avatar hybrid

Merged revisions 2778:2832 from 1.6 branch. Add some Linux keycodes, make skin...

Merged revisions 2778:2832 from 1.6 branch. Add some Linux keycodes, make skin name arrays safer, disable dx8. Please note, the last merge was from wrong repository, now everything is up to date again.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@2835 dfc29bdd-3216-0410-991c-e03cc46cb475
parent 3d467cb4
...@@ -37,11 +37,14 @@ namespace gui ...@@ -37,11 +37,14 @@ namespace gui
EGST_BURNING_SKIN, EGST_BURNING_SKIN,
//! An unknown skin, not serializable at present //! An unknown skin, not serializable at present
EGST_UNKNOWN EGST_UNKNOWN,
//! this value is not used, it only specifies the number of skin types
EGST_COUNT
}; };
//! Names for gui element types //! Names for gui element types
const c8* const GUISkinTypeNames[] = const c8* const GUISkinTypeNames[EGST_COUNT+1] =
{ {
"windowsClassic", "windowsClassic",
"windowsMetallic", "windowsMetallic",
...@@ -102,7 +105,7 @@ namespace gui ...@@ -102,7 +105,7 @@ namespace gui
}; };
//! Names for default skin colors //! Names for default skin colors
const c8* const GUISkinColorNames[] = const c8* const GUISkinColorNames[EGDC_COUNT+1] =
{ {
"3DDarkShadow", "3DDarkShadow",
"3DShadow", "3DShadow",
...@@ -173,7 +176,7 @@ namespace gui ...@@ -173,7 +176,7 @@ namespace gui
//! Names for default skin sizes //! Names for default skin sizes
const c8* const GUISkinSizeNames[] = const c8* const GUISkinSizeNames[EGDS_COUNT+1] =
{ {
"ScrollBarSize", "ScrollBarSize",
"MenuHeight", "MenuHeight",
...@@ -220,7 +223,7 @@ namespace gui ...@@ -220,7 +223,7 @@ namespace gui
}; };
//! Names for default skin sizes //! Names for default skin sizes
const c8* const GUISkinTextNames[] = const c8* const GUISkinTextNames[EGDT_COUNT+1] =
{ {
"MessageBoxOkay", "MessageBoxOkay",
"MessageBoxCancel", "MessageBoxCancel",
...@@ -287,7 +290,7 @@ namespace gui ...@@ -287,7 +290,7 @@ namespace gui
EGDI_COUNT EGDI_COUNT
}; };
const c8* const GUISkinIconNames[] = const c8* const GUISkinIconNames[EGDI_COUNT+1] =
{ {
"windowMaximize", "windowMaximize",
"windowRestore", "windowRestore",
...@@ -333,7 +336,7 @@ namespace gui ...@@ -333,7 +336,7 @@ namespace gui
EGDF_COUNT EGDF_COUNT
}; };
const c8* const GUISkinFontNames[] = const c8* const GUISkinFontNames[EGDF_COUNT+1] =
{ {
"defaultFont", "defaultFont",
"buttonFont", "buttonFont",
......
...@@ -116,7 +116,7 @@ headers, e.g. Summer 2004. This is a Microsoft issue, not an Irrlicht one. ...@@ -116,7 +116,7 @@ headers, e.g. Summer 2004. This is a Microsoft issue, not an Irrlicht one.
#if defined(_IRR_WINDOWS_API_) && (!defined(__GNUC__) || defined(IRR_COMPILE_WITH_DX9_DEV_PACK)) #if defined(_IRR_WINDOWS_API_) && (!defined(__GNUC__) || defined(IRR_COMPILE_WITH_DX9_DEV_PACK))
//! Only define _IRR_COMPILE_WITH_DIRECT3D_8_ if you have an appropriate DXSDK, e.g. Summer 2004 //! Only define _IRR_COMPILE_WITH_DIRECT3D_8_ if you have an appropriate DXSDK, e.g. Summer 2004
#define _IRR_COMPILE_WITH_DIRECT3D_8_ //#define _IRR_COMPILE_WITH_DIRECT3D_8_
#define _IRR_COMPILE_WITH_DIRECT3D_9_ #define _IRR_COMPILE_WITH_DIRECT3D_9_
#endif #endif
......
...@@ -956,7 +956,7 @@ bool CIrrDeviceLinux::run() ...@@ -956,7 +956,7 @@ bool CIrrDeviceLinux::run()
else else
{ {
irrevent.KeyInput.Key = (EKEY_CODE)0; irrevent.KeyInput.Key = (EKEY_CODE)0;
os::Printer::log("Could not find win32 key for x11 key.", ELL_WARNING); os::Printer::log("Could not find win32 key for x11 key.", core::stringc((int)mp.X11Key).c_str(), ELL_WARNING);
} }
irrevent.EventType = irr::EET_KEY_INPUT_EVENT; irrevent.EventType = irr::EET_KEY_INPUT_EVENT;
irrevent.KeyInput.PressedDown = (event.type == KeyPress); irrevent.KeyInput.PressedDown = (event.type == KeyPress);
...@@ -1349,6 +1349,7 @@ void CIrrDeviceLinux::createKeyMap() ...@@ -1349,6 +1349,7 @@ void CIrrDeviceLinux::createKeyMap()
KeyMap.push_back(SKeyMap(XK_Page_Down, KEY_NEXT)); KeyMap.push_back(SKeyMap(XK_Page_Down, KEY_NEXT));
KeyMap.push_back(SKeyMap(XK_End, KEY_END)); KeyMap.push_back(SKeyMap(XK_End, KEY_END));
KeyMap.push_back(SKeyMap(XK_Begin, KEY_HOME)); KeyMap.push_back(SKeyMap(XK_Begin, KEY_HOME));
KeyMap.push_back(SKeyMap(XK_Num_Lock, KEY_NUMLOCK));
KeyMap.push_back(SKeyMap(XK_KP_Space, KEY_SPACE)); KeyMap.push_back(SKeyMap(XK_KP_Space, KEY_SPACE));
KeyMap.push_back(SKeyMap(XK_KP_Tab, KEY_TAB)); KeyMap.push_back(SKeyMap(XK_KP_Tab, KEY_TAB));
KeyMap.push_back(SKeyMap(XK_KP_Enter, KEY_RETURN)); KeyMap.push_back(SKeyMap(XK_KP_Enter, KEY_RETURN));
...@@ -1356,10 +1357,12 @@ void CIrrDeviceLinux::createKeyMap() ...@@ -1356,10 +1357,12 @@ void CIrrDeviceLinux::createKeyMap()
KeyMap.push_back(SKeyMap(XK_KP_F2, KEY_F2)); KeyMap.push_back(SKeyMap(XK_KP_F2, KEY_F2));
KeyMap.push_back(SKeyMap(XK_KP_F3, KEY_F3)); KeyMap.push_back(SKeyMap(XK_KP_F3, KEY_F3));
KeyMap.push_back(SKeyMap(XK_KP_F4, KEY_F4)); KeyMap.push_back(SKeyMap(XK_KP_F4, KEY_F4));
KeyMap.push_back(SKeyMap(XK_KP_Home, KEY_HOME));
KeyMap.push_back(SKeyMap(XK_KP_Left, KEY_LEFT)); KeyMap.push_back(SKeyMap(XK_KP_Left, KEY_LEFT));
KeyMap.push_back(SKeyMap(XK_KP_Up, KEY_UP)); KeyMap.push_back(SKeyMap(XK_KP_Up, KEY_UP));
KeyMap.push_back(SKeyMap(XK_KP_Right, KEY_RIGHT)); KeyMap.push_back(SKeyMap(XK_KP_Right, KEY_RIGHT));
KeyMap.push_back(SKeyMap(XK_KP_Down, KEY_DOWN)); KeyMap.push_back(SKeyMap(XK_KP_Down, KEY_DOWN));
KeyMap.push_back(SKeyMap(XK_Print, KEY_PRINT));
KeyMap.push_back(SKeyMap(XK_KP_Prior, KEY_PRIOR)); KeyMap.push_back(SKeyMap(XK_KP_Prior, KEY_PRIOR));
KeyMap.push_back(SKeyMap(XK_KP_Page_Up, KEY_PRIOR)); KeyMap.push_back(SKeyMap(XK_KP_Page_Up, KEY_PRIOR));
KeyMap.push_back(SKeyMap(XK_KP_Next, KEY_NEXT)); KeyMap.push_back(SKeyMap(XK_KP_Next, KEY_NEXT));
......
...@@ -250,7 +250,6 @@ static void getJoystickDeviceInfo (io_object_t hidDevice, CFMutableDictionaryRef ...@@ -250,7 +250,6 @@ static void getJoystickDeviceInfo (io_object_t hidDevice, CFMutableDictionaryRef
* try hid dictionary first, if fail then go to usb dictionary * try hid dictionary first, if fail then go to usb dictionary
*/ */
/* get joystickName name */ /* get joystickName name */
refCF = CFDictionaryGetValue (hidProperties, CFSTR(kIOHIDProductKey)); refCF = CFDictionaryGetValue (hidProperties, CFSTR(kIOHIDProductKey));
if (!refCF) if (!refCF)
...@@ -689,7 +688,6 @@ void CIrrDeviceMacOSX::createDriver() ...@@ -689,7 +688,6 @@ void CIrrDeviceMacOSX::createDriver()
os::Printer::log("Unable to create video driver of unknown type.", ELL_ERROR); os::Printer::log("Unable to create video driver of unknown type.", ELL_ERROR);
break; break;
} }
} }
void CIrrDeviceMacOSX::flush() void CIrrDeviceMacOSX::flush()
...@@ -816,8 +814,10 @@ bool CIrrDeviceMacOSX::run() ...@@ -816,8 +814,10 @@ bool CIrrDeviceMacOSX::run()
ievent.EventType = irr::EET_MOUSE_INPUT_EVENT; ievent.EventType = irr::EET_MOUSE_INPUT_EVENT;
ievent.MouseInput.Event = irr::EMIE_MOUSE_WHEEL; ievent.MouseInput.Event = irr::EMIE_MOUSE_WHEEL;
ievent.MouseInput.Wheel = [(NSEvent *)event deltaY]; ievent.MouseInput.Wheel = [(NSEvent *)event deltaY];
if (ievent.MouseInput.Wheel < 1.0f) ievent.MouseInput.Wheel *= 10.0f; if (ievent.MouseInput.Wheel < 1.0f)
else ievent.MouseInput.Wheel *= 5.0f; ievent.MouseInput.Wheel *= 10.0f;
else
ievent.MouseInput.Wheel *= 5.0f;
postMouseEvent(event,ievent); postMouseEvent(event,ievent);
break; break;
...@@ -868,7 +868,7 @@ void CIrrDeviceMacOSX::setWindowCaption(const wchar_t* text) ...@@ -868,7 +868,7 @@ void CIrrDeviceMacOSX::setWindowCaption(const wchar_t* text)
if (Window != NULL) if (Window != NULL)
{ {
size = wcstombs(title,text,1024); size = wcstombs(title,text,1024);
if (size == 1024) title[1023] = 0; title[1023] = 0;
[Window setTitle:[NSString stringWithCString:title length:size]]; [Window setTitle:[NSString stringWithCString:title length:size]];
} }
} }
...@@ -1181,9 +1181,7 @@ bool CIrrDeviceMacOSX::present(video::IImage* surface, void* windowId, core::rec ...@@ -1181,9 +1181,7 @@ bool CIrrDeviceMacOSX::present(video::IImage* surface, void* windowId, core::rec
#if defined (_IRR_COMPILE_WITH_JOYSTICK_EVENTS_) #if defined (_IRR_COMPILE_WITH_JOYSTICK_EVENTS_)
static void joystickRemovalCallback(void * target, static void joystickRemovalCallback(void * target,
IOReturn result, IOReturn result, void * refcon, void * sender)
void * refcon,
void * sender)
{ {
JoystickInfo *joy = (JoystickInfo *) refcon; JoystickInfo *joy = (JoystickInfo *) refcon;
joy->removed = 1; joy->removed = 1;
...@@ -1295,7 +1293,7 @@ bool CIrrDeviceMacOSX::activateJoysticks(core::array<SJoystickInfo> & joystickIn ...@@ -1295,7 +1293,7 @@ bool CIrrDeviceMacOSX::activateJoysticks(core::array<SJoystickInfo> & joystickIn
continue; continue;
} }
for (u32 i = 0; i < 6; i++) for (u32 i = 0; i < 6; ++i)
info.persistentData.JoystickEvent.Axis[i] = 0; info.persistentData.JoystickEvent.Axis[i] = 0;
ActiveJoysticks.push_back(info); ActiveJoysticks.push_back(info);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment