diff options
author | Campbell Barton <ideasman42@gmail.com> | 2009-04-09 13:50:17 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2009-04-09 13:50:17 +0400 |
commit | eacf5b5d6d406492ba79b44f9319867230585e9b (patch) | |
tree | 15e5b8ce210f7e8d889edf3ca40b3ee2c3a05904 /source/gameengine/GameLogic/SCA_KeyboardSensor.cpp | |
parent | ba4ad93eada475e607831ce17883d04d1575bc32 (diff) |
BGE Text
- multi-line strings for bitmap text
- keyboard sensor now logs return and pad enter as "\n"
BGE std::vector use in Value.cpp and RAS_MaterialBucket.cpp
The size of a new list is known before making them, reduce re-allocs, though probably not a noticeable speedup.
Diffstat (limited to 'source/gameengine/GameLogic/SCA_KeyboardSensor.cpp')
-rw-r--r-- | source/gameengine/GameLogic/SCA_KeyboardSensor.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/source/gameengine/GameLogic/SCA_KeyboardSensor.cpp b/source/gameengine/GameLogic/SCA_KeyboardSensor.cpp index 3749bf2eda0..9a8b68d8db3 100644 --- a/source/gameengine/GameLogic/SCA_KeyboardSensor.cpp +++ b/source/gameengine/GameLogic/SCA_KeyboardSensor.cpp @@ -376,7 +376,8 @@ bool SCA_KeyboardSensor::IsPrintable(int keyIndex) || ((keyIndex >= SCA_IInputDevice::KX_AKEY) && (keyIndex <= SCA_IInputDevice::KX_ZKEY)) || (keyIndex == SCA_IInputDevice::KX_SPACEKEY) -/* || (keyIndex == KX_RETKEY) */ + || (keyIndex == SCA_IInputDevice::KX_RETKEY) + || (keyIndex == SCA_IInputDevice::KX_PADENTER) || (keyIndex == SCA_IInputDevice::KX_PADASTERKEY) || (keyIndex == SCA_IInputDevice::KX_TABKEY) || ((keyIndex >= SCA_IInputDevice::KX_COMMAKEY) @@ -386,7 +387,7 @@ bool SCA_KeyboardSensor::IsPrintable(int keyIndex) || ((keyIndex >= SCA_IInputDevice::KX_PAD2) && (keyIndex <= SCA_IInputDevice::KX_PADPLUSKEY)) || (keyIndex == SCA_IInputDevice::KX_DELKEY) - || (keyIndex == SCA_IInputDevice::KX_BACKSPACEKEY) + || (keyIndex == SCA_IInputDevice::KX_BACKSPACEKEY) ) { return true; @@ -423,8 +424,10 @@ char SCA_KeyboardSensor::ToCharacter(int keyIndex, bool shifted) if (keyIndex == SCA_IInputDevice::KX_SPACEKEY) { return ' '; } + if (keyIndex == SCA_IInputDevice::KX_RETKEY || keyIndex == SCA_IInputDevice::KX_PADENTER) { + return '\n'; + } -/* || (keyIndex == SCA_IInputDevice::KX_RETKEY) */ if (keyIndex == SCA_IInputDevice::KX_PADASTERKEY) { return '*'; |