Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDalai Felinto <dfelinto@gmail.com>2011-12-20 07:11:56 +0400
committerDalai Felinto <dfelinto@gmail.com>2011-12-20 07:11:56 +0400
commit32b23b9f746b9bec4023da1d2ef6085fbbde9ae7 (patch)
tree0f83b23571af2f595d6e747079b1fa66848566bc /source/gameengine/GamePlayer
parent553cf289a7aab9a2a53331d623fa2cfa475b7728 (diff)
Cucumber, first batch of merge - UI changes and custom exit key
--------------------------------------------------------------- This was a test drive to see how painful the merge will be. Next batches are: - use desktop option for fullscreen - multisampling option - bullet collision mask - python - storage (vbo, dl, ...) - lighting [lighting still needs review] [python could use review, although it should be straightforward] [storage should be tested more I think] Merged /branches/soc-2011-cucumber:r 36991,37059,37157,37416,37497-37499,37501,37522,39036,40593 36991: ==UI== * Made some options available in Blender Game that were only available in Blender Render (camera resolution, animation fps) * Created a panel for the embedded player * Renamed the FPS option for the standalone player to Refresh Rate * Moved framing options to display * Made a button to launch the blender player from within blender (only tested on windows for now) 37059: ==UI== * Added the option to change the exit key for the BGE. The UI currently just sets a number, and this feature most likely does not work for blenderplayer yet. More work on this to come. * Removed the physics settings from the scene panel for the BGE. * Added an Add menu in the logic brick header. 37157: Making the bake options available in Blender Game 37416: Making the exit key UI element accept key presses instead of numbers. It still does not work for the Blenderplayer, and it does not limit the input to key presses (other events don't work for exiting) 37497: Some more work on getting the exit key to work in the Blenderplayer. Input is now restricted to keyboard events only for the exit key UI. 37498: Some clean up from the last commit. The exit key setting affects the Blenderplayer now. 37499: Cleaning up some duplicate code. Now the reverseTranslateTable for converting blender key codes to ketsji key codes is only defined in BL_BlenderDataConverter. 37501: Centralizing the exit key methods to the keyboard devices. This should make it easier to get exit key control to the python API. [37517: committed previously] 37522: Moved control of the exit key away from the keyboard devices, and moved it to ketsjiengine. Added setExitKey and getExitKey to the python API 39036: A couple of the doversions were in the wrong spot. This should fix some issues with the exit key not being set. [not committed entirely, see below]] 40552: space_logic.py (* fixed an error in space_logic.py *) 40593: launch blenderplayer from ui not working in OSX fix - by Daniel Stokes and me ######################################################## code left behind (to be included in next commit): ######################################################## { /* Initialize default values for collision masks */ Object *ob; for(ob=main->object.first; ob; ob=ob->id.next) ob->col_group = ob->col_mask = 1; }
Diffstat (limited to 'source/gameengine/GamePlayer')
-rw-r--r--source/gameengine/GamePlayer/common/GPC_KeyboardDevice.h1
-rw-r--r--source/gameengine/GamePlayer/ghost/GPG_Application.cpp13
-rw-r--r--source/gameengine/GamePlayer/ghost/GPG_Application.h1
3 files changed, 9 insertions, 6 deletions
diff --git a/source/gameengine/GamePlayer/common/GPC_KeyboardDevice.h b/source/gameengine/GamePlayer/common/GPC_KeyboardDevice.h
index 5b267c92908..3d88dc467b0 100644
--- a/source/gameengine/GamePlayer/common/GPC_KeyboardDevice.h
+++ b/source/gameengine/GamePlayer/common/GPC_KeyboardDevice.h
@@ -57,6 +57,7 @@ protected:
* System dependent keyboard codes are stored as ints.
*/
std::map<int, KX_EnumInputs> m_reverseKeyTranslateTable;
+ short m_exitkey;
public:
bool m_hookesc;
diff --git a/source/gameengine/GamePlayer/ghost/GPG_Application.cpp b/source/gameengine/GamePlayer/ghost/GPG_Application.cpp
index 7490e187824..f9403c9725a 100644
--- a/source/gameengine/GamePlayer/ghost/GPG_Application.cpp
+++ b/source/gameengine/GamePlayer/ghost/GPG_Application.cpp
@@ -40,6 +40,7 @@
#include "GPU_extensions.h"
#include "GPG_Application.h"
+#include "BL_BlenderDataConversion.h"
#include <iostream>
#include <MT_assert.h>
@@ -626,6 +627,8 @@ bool GPG_Application::initEngine(GHOST_IWindow* window, const int stereoMode)
m_ketsjiengine->SetRasterizer(m_rasterizer);
m_ketsjiengine->SetTimingDisplay(frameRate, false, false);
+
+ KX_KetsjiEngine::SetExitKey(ConvertKeyCode(gm->exitkey));
#ifdef WITH_PYTHON
CValue::SetDeprecationWarnings(nodepwarnings);
#else
@@ -908,12 +911,10 @@ bool GPG_Application::handleKey(GHOST_IEvent* event, bool isDown)
{
GHOST_TEventDataPtr eventData = ((GHOST_IEvent*)event)->getData();
GHOST_TEventKeyData* keyData = static_cast<GHOST_TEventKeyData*>(eventData);
- //no need for this test
- //if (fSystem->getFullScreen()) {
- if (keyData->key == GHOST_kKeyEsc && !m_keyboard->m_hookesc && !m_isEmbedded) {
- m_exitRequested = KX_EXIT_REQUEST_OUTSIDE;
- }
- //}
+
+ if (m_keyboard->ToNative(keyData->key) == KX_KetsjiEngine::GetExitKey() && !m_keyboard->m_hookesc && !m_isEmbedded) {
+ m_exitRequested = KX_EXIT_REQUEST_OUTSIDE;
+ }
m_keyboard->ConvertEvent(keyData->key, isDown);
handled = true;
}
diff --git a/source/gameengine/GamePlayer/ghost/GPG_Application.h b/source/gameengine/GamePlayer/ghost/GPG_Application.h
index a8a976f9dd2..37625dc8998 100644
--- a/source/gameengine/GamePlayer/ghost/GPG_Application.h
+++ b/source/gameengine/GamePlayer/ghost/GPG_Application.h
@@ -103,6 +103,7 @@ protected:
* Shuts the game engine down.
*/
void exitEngine(void);
+ short m_exitkey;
/* The game data */
STR_String m_startSceneName;