Subversion Repository Public Repository

Divide-Framework

This repository has no backups
This repository's network speed is throttled to 100KB/sec

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
#include "Headers/InputInterface.h"
#include "Core/Headers/ParamHandler.h"

namespace Divide {
namespace Input {

typedef std::map<stringImpl, OIS::KeyCode> KeyByNameMap;
static KeyByNameMap initKeyByNameMap();
static KeyByNameMap g_keysByNameMap = initKeyByNameMap();

ErrorCode InputInterface::init(Kernel& kernel, const vec2<U16>& inputAreaDimensions) {
    if (_bIsInitialized) {
        return ErrorCode::NO_ERR;
    }

    Console::printfn(Locale::get(_ID("INPUT_CREATE_START")));

    OIS::ParamList pl;

    std::stringstream ss;
    ss << (size_t)(Application::instance().sysInfo()._windowHandle);
    // Create OIS input manager
    pl.insert(std::make_pair("WINDOW", ss.str()));
    pl.insert(std::make_pair("GLXWINDOW", ss.str()));
    pl.insert(std::make_pair("w32_mouse", "DISCL_FOREGROUND"));
    pl.insert(std::make_pair("w32_mouse", "DISCL_NONEXCLUSIVE"));
    pl.insert(std::make_pair("w32_keyboard", "DISCL_FOREGROUND"));
    pl.insert(std::make_pair("w32_keyboard", "DISCL_NONEXCLUSIVE"));
    pl.insert(std::make_pair("x11_mouse_grab", "false"));
    pl.insert(std::make_pair("x11_mouse_hide", "false"));
    pl.insert(std::make_pair("x11_keyboard_grab", "false"));
    pl.insert(std::make_pair("XAutoRepeatOn", "true"));

    _pInputInterface = OIS::InputManager::createInputSystem(pl);
    DIVIDE_ASSERT(_pInputInterface != nullptr,
                  "InputInterface error: Could not create OIS Input Interface");

    Console::printfn(Locale::get(_ID("INPUT_CREATE_OK")),
                     _pInputInterface->inputSystemName().c_str());

    // Create the event handler.
    _pEventHdlr = MemoryManager_NEW EventHandler(this, kernel);
    DIVIDE_ASSERT(_pEventHdlr != nullptr, "InputInterface error: EventHandler allocation failed!");

    if (_pInputInterface->getNumberOfDevices(OIS::OISKeyboard) > 0) {
        // Create a simple keyboard
        _pKeyboard = static_cast<OIS::Keyboard*>( _pInputInterface->createInputObject(OIS::OISKeyboard, true));
        _pKeyboard->setEventCallback(_pEventHdlr);
    } else {
        Console::printfn(Locale::get(_ID("ERROR_INPUT_CREATE_KB")), "No keyboards detected");
    }


    if (_pInputInterface->getNumberOfDevices(OIS::OISMouse) > 0) {
        _pMouse = static_cast<OIS::Mouse*>(_pInputInterface->createInputObject(OIS::OISMouse, true));
        _pMouse->setEventCallback(_pEventHdlr);

        const OIS::MouseState& ms = _pMouse->getMouseState();  // width and height are mutable
        ms.width = inputAreaDimensions.width;
        ms.height = inputAreaDimensions.height;
    } else {
        Console::printfn(Locale::get(_ID("ERROR_INPUT_CREATE_MOUSE")), "No mice detected");
    }

    // Limit max joysticks to MAX_ALLOWED_JOYSTICKS
    I32 numJoysticks = std::min(_pInputInterface->getNumberOfDevices(OIS::OISJoyStick), to_int(Joystick::COUNT));

    if (numJoysticks > 0) {
        U32 entryNum = to_const_uint(Joystick::JOYSTICK_1);

        _pJoysticks.resize(numJoysticks);
        vectorImpl<OIS::JoyStick*>::iterator it;
        for (it =  std::begin(_pJoysticks);  it != std::end(_pJoysticks); ++it) {
            (*it) = static_cast<OIS::JoyStick*>(_pInputInterface->createInputObject(OIS::OISJoyStick, true));
            (*it)->setEventCallback(_pEventHdlr);

            _joystickIdToEntry[(*it)->getID()] = static_cast<Joystick>(entryNum++);
        }

        // Create the joystick manager.
        _pJoystickInterface = MemoryManager_NEW JoystickInterface(_pInputInterface, _pEventHdlr);

        for (I32 i = 0; i < numJoysticks; ++i) {
            I32 max = _pJoysticks[i]->MAX_AXIS - 4000;
            _pJoystickInterface->setJoystickData(static_cast<Joystick>(i), JoystickData(max / 10, max));
        }

        if (!_pJoystickInterface->wasFFDetected()) {
            Console::printfn(Locale::get(_ID("WARN_INPUT_NO_FORCE_FEEDBACK")));
        } else {
            // Create force feedback effect manager.
            assert(_pEffectMgr == nullptr);
            _pEffectMgr = MemoryManager_NEW EffectManager(_pJoystickInterface, _nEffectUpdateFreq);
            // Initialize the event handler.
            _pEventHdlr->initialize(_pJoystickInterface, _pEffectMgr);
        }
    } else {
        Console::printfn(Locale::get(_ID("ERROR_INPUT_CREATE_JOYSTICK")), "No joystick / gamepad devices detected!");
    }

    _bIsInitialized = true;

    return ErrorCode::NO_ERR;
}

U8 InputInterface::update(const U64 deltaTime) {
    const U8 nMaxEffectUpdateCnt = _nHartBeatFreq / _nEffectUpdateFreq;
    U8 nEffectUpdateCnt = 0;

    if (!_bIsInitialized) {
        return 0;
    }
    if (_bMustStop) {
        terminate();
        return 0;
    }

    // This fires off buffered events for keyboards
    if (_pKeyboard != nullptr) {
        _pKeyboard->capture();
    }
    if (_pMouse != nullptr) {
        _pMouse->capture();
    }
    if (_pJoysticks.size() > 0) {
        for (vectorImpl<OIS::JoyStick*>::iterator it = std::begin(_pJoysticks);
             it != std::end(_pJoysticks); ++it) {
            (*it)->capture();
        }

        // This fires off buffered events for each joystick we have
        if (_pEffectMgr != nullptr) {
            _pJoystickInterface->captureEvents();
            // Update currently selected effects if time has come to.
            if (!nEffectUpdateCnt) {
                _pEffectMgr->updateActiveEffects();
                nEffectUpdateCnt = nMaxEffectUpdateCnt;
            } else {
                nEffectUpdateCnt--;
            }
        }
    }

    return 1;
}

void InputInterface::terminate() {
    if (_pInputInterface) {
        _pInputInterface->destroyInputObject(_pKeyboard);
        _pKeyboard = nullptr;

        _pInputInterface->destroyInputObject(_pMouse);
        _pMouse = nullptr;

        if (_pJoysticks.size() > 0) {
            for (vectorImpl<OIS::JoyStick*>::iterator it =
                     std::begin(_pJoysticks);
                 it != std::end(_pJoysticks); ++it) {
                _pInputInterface->destroyInputObject(*it);
            }
            _pJoysticks.clear();
            MemoryManager::DELETE(_pJoystickInterface);
        }

        OIS::InputManager::destroyInputSystem(_pInputInterface);
        _pInputInterface = nullptr;
    }

    MemoryManager::DELETE(_pEventHdlr);

    MemoryManager::DELETE(_pEffectMgr);
}

InputState InputInterface::getKeyState(KeyCode keyCode) const {
    if (_pKeyboard != nullptr) {
        return _pKeyboard->isKeyDown(keyCode) ? InputState::PRESSED 
                                              : InputState::RELEASED;
    }

    return InputState::COUNT;
}

InputState InputInterface::getMouseButtonState(MouseButton button) const {
    if (_pMouse != nullptr) {
        return _pMouse->getMouseState().buttonDown(button) ? InputState::PRESSED
                                                           : InputState::RELEASED;
    }

    return InputState::COUNT;
}

InputState InputInterface::getJoystickeButtonState(Input::Joystick device, JoystickButton button) const {
    for (hashMapImpl<I32, Joystick>::value_type it : _joystickIdToEntry) {
        if (it.second == device) {
            for (OIS::JoyStick* deviceIt : _pJoysticks) {
                if (deviceIt->getID() == it.first) {
                    const OIS::JoyStickState& joyState = deviceIt->getJoyStickState();
                    return joyState.mButtons[button] ? InputState::PRESSED
                                                     : InputState::RELEASED;
                }
                DIVIDE_UNEXPECTED_CALL("Invalid joystick entry detected!");
            }
        }
    }
    return InputState::COUNT;
}

Joystick InputInterface::joystick(I32 deviceID) const {
    hashMapImpl<I32, Joystick>::const_iterator it = _joystickIdToEntry.find(deviceID);
    if (it != std::cend(_joystickIdToEntry)) {
        return it->second;
    }

    return Joystick::COUNT;
}


MouseButton  InputInterface::mouseButtonByName(const stringImpl& buttonName) {
    if (Util::CompareIgnoreCase("MB_" + buttonName, "MB_Left")) {
        return MouseButton::MB_Left;
    } else if (Util::CompareIgnoreCase("MB_" + buttonName, "MB_Right")) {
        return MouseButton::MB_Right;
    } else if (Util::CompareIgnoreCase("MB_" + buttonName, "MB_Middle")) {
        return MouseButton::MB_Middle;
    } else if (Util::CompareIgnoreCase("MB_" + buttonName, "MB_Button3")) {
        return MouseButton::MB_Button3;
    } else if (Util::CompareIgnoreCase("MB_" + buttonName, "MB_Button4")) {
        return MouseButton::MB_Button4;
    } else if (Util::CompareIgnoreCase("MB_" + buttonName, "MB_Button5")) {
        return MouseButton::MB_Button5;
    } else if (Util::CompareIgnoreCase("MB_" + buttonName, "MB_Button6")) {
        return MouseButton::MB_Button6;
    }//else if (Util::CompareIgnoreCase(buttonName, "MB_Button7")) {
     //}

    return MouseButton::MB_Button7;
}

JoystickElement  InputInterface::joystickElementByName(const stringImpl& elementName) {
    if (Util::CompareIgnoreCase(elementName, "POV")) {
        return JoystickElement(JoystickElementType::POV_MOVE);
    } else if (Util::CompareIgnoreCase(elementName, "AXIS")) {
        return JoystickElement(JoystickElementType::AXIS_MOVE);
    } else if (Util::CompareIgnoreCase(elementName, "SLIDER")) {
        return JoystickElement(JoystickElementType::SLIDER_MOVE);
    } else if (Util::CompareIgnoreCase(elementName, "VECTOR")) {
        return JoystickElement(JoystickElementType::VECTOR_MOVE);
    } 
    vectorImpl<stringImpl> buttonElements = Util::Split(elementName, '_');
    assert(buttonElements.size() == 2 && "Invalid joystick element name!");
    assert(Util::CompareIgnoreCase(buttonElements[0], "BUTTON"));

    I32 buttonId = Util::ConvertData<I32, std::string>(buttonElements[1].c_str());
    return JoystickElement(JoystickElementType::BUTTON_PRESS, to_ubyte(buttonId));
}

KeyCode InputInterface::keyCodeByName(const stringImpl& name) {
    stringImpl nameCpy("KC_" + name);
    std::map<stringImpl, OIS::KeyCode>::const_iterator it;
    it = g_keysByNameMap.find(nameCpy);
    if (it == std::cend(g_keysByNameMap)) {
        transform(nameCpy.begin(), nameCpy.end(), nameCpy.begin(), toupper);
        it = g_keysByNameMap.find(nameCpy);
    }
    assert(it != std::cend(g_keysByNameMap));

    return it->second;
}

KeyByNameMap initKeyByNameMap() {
    KeyByNameMap keysByNameMap;

    keysByNameMap["KC_UNASSIGNED"] = OIS::KC_UNASSIGNED;
    keysByNameMap["KC_ESCAPE"] = OIS::KC_ESCAPE;
    keysByNameMap["KC_1"] = OIS::KC_1;
    keysByNameMap["KC_2"] = OIS::KC_2;
    keysByNameMap["KC_3"] = OIS::KC_3;
    keysByNameMap["KC_4"] = OIS::KC_4;
    keysByNameMap["KC_5"] = OIS::KC_5;
    keysByNameMap["KC_6"] = OIS::KC_6;
    keysByNameMap["KC_7"] = OIS::KC_7;
    keysByNameMap["KC_8"] = OIS::KC_8;
    keysByNameMap["KC_9"] = OIS::KC_9;
    keysByNameMap["KC_0"] = OIS::KC_0;
    keysByNameMap["KC_MINUS"] = OIS::KC_MINUS;
    keysByNameMap["KC_EQUALS"] = OIS::KC_EQUALS;
    keysByNameMap["KC_BACK"] = OIS::KC_BACK;
    keysByNameMap["KC_TAB"] = OIS::KC_TAB;
    keysByNameMap["KC_Q"] = OIS::KC_Q;
    keysByNameMap["KC_W"] = OIS::KC_W;
    keysByNameMap["KC_E"] = OIS::KC_E;
    keysByNameMap["KC_R"] = OIS::KC_R;
    keysByNameMap["KC_T"] = OIS::KC_T;
    keysByNameMap["KC_Y"] = OIS::KC_Y;
    keysByNameMap["KC_U"] = OIS::KC_U;
    keysByNameMap["KC_I"] = OIS::KC_I;
    keysByNameMap["KC_O"] = OIS::KC_O;
    keysByNameMap["KC_P"] = OIS::KC_P;
    keysByNameMap["KC_LBRACKET"] = OIS::KC_LBRACKET;
    keysByNameMap["KC_RBRACKET"] = OIS::KC_RBRACKET;
    keysByNameMap["KC_RETURN"] = OIS::KC_RETURN;
    keysByNameMap["KC_LCONTROL"] = OIS::KC_LCONTROL;
    keysByNameMap["KC_A"] = OIS::KC_A;
    keysByNameMap["KC_S"] = OIS::KC_S;
    keysByNameMap["KC_D"] = OIS::KC_D;
    keysByNameMap["KC_F"] = OIS::KC_F;
    keysByNameMap["KC_G"] = OIS::KC_G;
    keysByNameMap["KC_H"] = OIS::KC_H;
    keysByNameMap["KC_J"] = OIS::KC_J;
    keysByNameMap["KC_K"] = OIS::KC_K;
    keysByNameMap["KC_L"] = OIS::KC_L;
    keysByNameMap["KC_SEMICOLON"] = OIS::KC_SEMICOLON;
    keysByNameMap["KC_APOSTROPHE"] = OIS::KC_APOSTROPHE;
    keysByNameMap["KC_GRAVE"] = OIS::KC_GRAVE;
    keysByNameMap["KC_LSHIFT"] = OIS::KC_LSHIFT;
    keysByNameMap["KC_BACKSLASH"] = OIS::KC_BACKSLASH;
    keysByNameMap["KC_Z"] = OIS::KC_Z;
    keysByNameMap["KC_X"] = OIS::KC_X;
    keysByNameMap["KC_C"] = OIS::KC_C;
    keysByNameMap["KC_V"] = OIS::KC_V;
    keysByNameMap["KC_B"] = OIS::KC_B;
    keysByNameMap["KC_N"] = OIS::KC_N;
    keysByNameMap["KC_M"] = OIS::KC_M;
    keysByNameMap["KC_COMMA"] = OIS::KC_COMMA;
    keysByNameMap["KC_PERIOD"] = OIS::KC_PERIOD;
    keysByNameMap["KC_SLASH"] = OIS::KC_SLASH;
    keysByNameMap["KC_RSHIFT"] = OIS::KC_RSHIFT;
    keysByNameMap["KC_MULTIPLY"] = OIS::KC_MULTIPLY;
    keysByNameMap["KC_LMENU"] = OIS::KC_LMENU;
    keysByNameMap["KC_SPACE"] = OIS::KC_SPACE;
    keysByNameMap["KC_CAPITAL"] = OIS::KC_CAPITAL;
    keysByNameMap["KC_F1"] = OIS::KC_F1;
    keysByNameMap["KC_F2"] = OIS::KC_F2;
    keysByNameMap["KC_F3"] = OIS::KC_F3;
    keysByNameMap["KC_F4"] = OIS::KC_F4;
    keysByNameMap["KC_F5"] = OIS::KC_F5;
    keysByNameMap["KC_F6"] = OIS::KC_F6;
    keysByNameMap["KC_F7"] = OIS::KC_F7;
    keysByNameMap["KC_F8"] = OIS::KC_F8;
    keysByNameMap["KC_F9"] = OIS::KC_F9;
    keysByNameMap["KC_F10"] = OIS::KC_F10;
    keysByNameMap["KC_NUMLOCK"] = OIS::KC_NUMLOCK;
    keysByNameMap["KC_SCROLL"] = OIS::KC_SCROLL;
    keysByNameMap["KC_NUMPAD7"] = OIS::KC_NUMPAD7;
    keysByNameMap["KC_NUMPAD8"] = OIS::KC_NUMPAD8;
    keysByNameMap["KC_NUMPAD9"] = OIS::KC_NUMPAD9;
    keysByNameMap["KC_SUBTRACT"] = OIS::KC_SUBTRACT;
    keysByNameMap["KC_NUMPAD4"] = OIS::KC_NUMPAD4;
    keysByNameMap["KC_NUMPAD5"] = OIS::KC_NUMPAD5;
    keysByNameMap["KC_NUMPAD6"] = OIS::KC_NUMPAD6;
    keysByNameMap["KC_ADD"] = OIS::KC_ADD;
    keysByNameMap["KC_NUMPAD1"] = OIS::KC_NUMPAD1;
    keysByNameMap["KC_NUMPAD2"] = OIS::KC_NUMPAD2;
    keysByNameMap["KC_NUMPAD3"] = OIS::KC_NUMPAD3;
    keysByNameMap["KC_NUMPAD0"] = OIS::KC_NUMPAD0;
    keysByNameMap["KC_DECIMAL"] = OIS::KC_DECIMAL;
    keysByNameMap["KC_OEM_102"] = OIS::KC_OEM_102;
    keysByNameMap["KC_F11"] = OIS::KC_F11;
    keysByNameMap["KC_F12"] = OIS::KC_F12;
    keysByNameMap["KC_F13"] = OIS::KC_F13;
    keysByNameMap["KC_F14"] = OIS::KC_F14;
    keysByNameMap["KC_F15"] = OIS::KC_F15;
    keysByNameMap["KC_KANA"] = OIS::KC_KANA;
    keysByNameMap["KC_ABNT_C1"] = OIS::KC_ABNT_C1;
    keysByNameMap["KC_CONVERT"] = OIS::KC_CONVERT;
    keysByNameMap["KC_NOCONVERT"] = OIS::KC_NOCONVERT;
    keysByNameMap["KC_YEN"] = OIS::KC_YEN;
    keysByNameMap["KC_ABNT_C2"] = OIS::KC_ABNT_C2;
    keysByNameMap["KC_NUMPADEQUALS"] = OIS::KC_NUMPADEQUALS;
    keysByNameMap["KC_PREVTRACK"] = OIS::KC_PREVTRACK;
    keysByNameMap["KC_AT"] = OIS::KC_AT;
    keysByNameMap["KC_COLON"] = OIS::KC_COLON;
    keysByNameMap["KC_UNDERLINE"] = OIS::KC_UNDERLINE;
    keysByNameMap["KC_KANJI"] = OIS::KC_KANJI;
    keysByNameMap["KC_STOP"] = OIS::KC_STOP;
    keysByNameMap["KC_AX"] = OIS::KC_AX;
    keysByNameMap["KC_UNLABELED"] = OIS::KC_UNLABELED;
    keysByNameMap["KC_NEXTTRACK"] = OIS::KC_NEXTTRACK;
    keysByNameMap["KC_NUMPADENTER"] = OIS::KC_NUMPADENTER;
    keysByNameMap["KC_RCONTROL"] = OIS::KC_RCONTROL;
    keysByNameMap["KC_MUTE"] = OIS::KC_MUTE;
    keysByNameMap["KC_CALCULATOR"] = OIS::KC_CALCULATOR;
    keysByNameMap["KC_PLAYPAUSE"] = OIS::KC_PLAYPAUSE;
    keysByNameMap["KC_MEDIASTOP"] = OIS::KC_MEDIASTOP;
    keysByNameMap["KC_VOLUMEDOWN"] = OIS::KC_VOLUMEDOWN;
    keysByNameMap["KC_VOLUMEUP"] = OIS::KC_VOLUMEUP;
    keysByNameMap["KC_WEBHOME"] = OIS::KC_WEBHOME;
    keysByNameMap["KC_NUMPADCOMMA"] = OIS::KC_NUMPADCOMMA;
    keysByNameMap["KC_DIVIDE"] = OIS::KC_DIVIDE;
    keysByNameMap["KC_SYSRQ"] = OIS::KC_SYSRQ;
    keysByNameMap["KC_RMENU"] = OIS::KC_RMENU;
    keysByNameMap["KC_PAUSE"] = OIS::KC_PAUSE;
    keysByNameMap["KC_HOME"] = OIS::KC_HOME;
    keysByNameMap["KC_UP"] = OIS::KC_UP;
    keysByNameMap["KC_PGUP"] = OIS::KC_PGUP;
    keysByNameMap["KC_LEFT"] = OIS::KC_LEFT;
    keysByNameMap["KC_RIGHT"] = OIS::KC_RIGHT;
    keysByNameMap["KC_END"] = OIS::KC_END;
    keysByNameMap["KC_DOWN"] = OIS::KC_DOWN;
    keysByNameMap["KC_PGDOWN"] = OIS::KC_PGDOWN;
    keysByNameMap["KC_INSERT"] = OIS::KC_INSERT;
    keysByNameMap["KC_DELETE"] = OIS::KC_DELETE;
    keysByNameMap["KC_LWIN"] = OIS::KC_LWIN;
    keysByNameMap["KC_RWIN"] = OIS::KC_RWIN;
    keysByNameMap["KC_APPS"] = OIS::KC_APPS;
    keysByNameMap["KC_POWER"] = OIS::KC_POWER;
    keysByNameMap["KC_SLEEP"] = OIS::KC_SLEEP;
    keysByNameMap["KC_WAKE"] = OIS::KC_WAKE;
    keysByNameMap["KC_WEBSEARCH"] = OIS::KC_WEBSEARCH;
    keysByNameMap["KC_WEBFAVORITES"] = OIS::KC_WEBFAVORITES;
    keysByNameMap["KC_WEBREFRESH"] = OIS::KC_WEBREFRESH;
    keysByNameMap["KC_WEBSTOP"] = OIS::KC_WEBSTOP;
    keysByNameMap["KC_WEBFORWARD"] = OIS::KC_WEBFORWARD;
    keysByNameMap["KC_WEBBACK"] = OIS::KC_WEBBACK;
    keysByNameMap["KC_MYCOMPUTER"] = OIS::KC_MYCOMPUTER;
    keysByNameMap["KC_MAIL"] = OIS::KC_MAIL;
    keysByNameMap["KC_MEDIASELECT"] = OIS::KC_MEDIASELECT;

    return keysByNameMap;
}

};  // namespace Input
};  // namespace Divide

Commits for Divide-Framework/trunk/Source Code/Platform/Input/InputInterface.cpp

Diff revisions: vs.
Revision Author Commited Message
727 Diff Diff IonutCava picture IonutCava Tue 14 Jun, 2016 16:01:38 +0000

[IonutCava]
- Remove node and cmd buffers from GFXDevice and add them as a new BufferData struct to RenderPass class.
— Each render pass holds its own buffers
- Improvements / fixes to the CSM code
- Added a global toggle to enable/disable custom memory allocators

719 Diff Diff IonutCava picture IonutCava Fri 03 Jun, 2016 16:20:08 +0000

[IonutCava]
- More SceneManager – ScenePool splitting of responsibilities
- DefaultScene will be the first scene loaded by the application. If nothing is specified in XML, it will default to "DefaultScene"

713 Diff Diff IonutCava picture IonutCava Wed 25 May, 2016 15:43:38 +0000

[IonutCava]
- Removed all unique_ptr’s from the code with classic new/delete pairs. They were seriously not needed.
- Added the concept of SceneComponent to scene specific classes: aiManager, lightPool, sceneGraph, physicsInterface etc
— This allowed the removal of the global GET_ACTIVE_SCENEGRAPH call;

706 Diff Diff IonutCava picture IonutCava Fri 13 May, 2016 16:29:40 +0000

[IonutCava]
- Renamed LightManager to LightPool and changed it from a Singleton to a scene specific pointer
- More scene load / unload updates (changing scenes now works properly!)
- Allowed GUI interface to hold per-scene elements and only render relevant ones
- Reduced dependencies between nodes, scenemanager, scene, loaders and kernel
- Removed Reflector base class as it was useless and integrate Water class with the Reflection system already in place
- Extended RenderingComponent’s reflection system to allow refraction as well

703 Diff Diff IonutCava picture IonutCava Wed 11 May, 2016 15:44:57 +0000

[IonutCava]
- Finish XML-based control bindings:
— Allow per bind input params (key id, mouse button index, joystick control data, etc)
— Allow mouse binding (with up to 7 buttons)
— Allow up to 4 joysticks (for now) with 120+ button, POV, Axis, Slider and Vector binding support for each
- Change all hashes in code from U32 to size_t for compatibility with STL/Boost

700 Diff Diff IonutCava picture IonutCava Tue 10 May, 2016 22:13:05 +0000

[IonutCava]
- More work on rebindable keys:
— Key events loaded from XML finished
— Mouse and Joystick control binding from XML still not finished

670 Diff Diff IonutCava picture IonutCava Wed 06 Apr, 2016 16:21:35 +0000

[IonutCava]
- getInstance() renamed to instance() for simplicity (should really go away altogether, but that’s a different issue)
- some particle emitter threading updates

669 Diff Diff IonutCava picture IonutCava Mon 04 Apr, 2016 16:15:35 +0000

[IonutCava]
- Move Task creation calls to TaskPool.h
- Allow tasks to use any pool, but default behaviour is to use the Kernel’s main task pool
- Change image transparency check to use the task pool instead of OpenMP
— Perfect place for future parallel_for implementation
- Warning fixes
- Some method renaming for improved readability

654 Diff Diff IonutCava picture IonutCava Tue 01 Mar, 2016 17:22:09 +0000

[Ionut]
- Moved window related code from rendering API code into proper classes:
— DisplayWindow handles SDL based window management
— WindowManager handles multiple DisplayWindow instances
— Code still needs proper extensive testing
- Small performance optimizations

577 IonutCava picture IonutCava Fri 20 Nov, 2015 15:59:10 +0000

[IonutCava]
- Replace all string indexed maps with unsigned long long indexed maps and add both compile time and runtime hashing functions to convert strings to the proper indices
— Balancing the calls between _ID and _ID_RT can reduce map lookup overhead, especially with ParamHandler and Locale::get