[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [45479] trunk/blender/source/gameengine/ GameLogic: bugfix [#30760] edit text property bug
Dalai Felinto
dfelinto at gmail.com
Mon Apr 9 03:42:45 CEST 2012
Revision: 45479
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=45479
Author: dfelinto
Date: 2012-04-09 01:42:44 +0000 (Mon, 09 Apr 2012)
Log Message:
-----------
bugfix [#30760] edit text property bug
backspace was messing up with utf8 text.
hijacking Blender utf8 functions
tested in CMake but I think scons should work too. No idea about pure 'make'
Happy Easter ;)
Modified Paths:
--------------
trunk/blender/source/gameengine/GameLogic/CMakeLists.txt
trunk/blender/source/gameengine/GameLogic/SCA_KeyboardSensor.cpp
trunk/blender/source/gameengine/GameLogic/SConscript
Modified: trunk/blender/source/gameengine/GameLogic/CMakeLists.txt
===================================================================
--- trunk/blender/source/gameengine/GameLogic/CMakeLists.txt 2012-04-09 01:24:56 UTC (rev 45478)
+++ trunk/blender/source/gameengine/GameLogic/CMakeLists.txt 2012-04-09 01:42:44 UTC (rev 45479)
@@ -28,6 +28,7 @@
../Expressions
../Rasterizer
../SceneGraph
+ ../../blender/blenlib
../../../intern/container
../../../intern/moto/include
../../../intern/string
Modified: trunk/blender/source/gameengine/GameLogic/SCA_KeyboardSensor.cpp
===================================================================
--- trunk/blender/source/gameengine/GameLogic/SCA_KeyboardSensor.cpp 2012-04-09 01:24:56 UTC (rev 45478)
+++ trunk/blender/source/gameengine/GameLogic/SCA_KeyboardSensor.cpp 2012-04-09 01:42:44 UTC (rev 45479)
@@ -39,6 +39,10 @@
#include "StringValue.h"
#include "SCA_IInputDevice.h"
+extern "C" {
+ #include "BLI_string_cursor_utf8.h"
+}
+
/* ------------------------------------------------------------------------- */
/* Native functions */
/* ------------------------------------------------------------------------- */
@@ -338,7 +342,11 @@
STR_String newprop = tprop->GetText();
int oldlength = newprop.Length();
if (oldlength >= 1 ) {
- newprop.SetLength(oldlength - 1);
+ int newlength=oldlength;
+
+ BLI_str_cursor_step_prev_utf8(newprop, NULL, &newlength);
+ newprop.SetLength(newlength);
+
CStringValue * newstringprop = new CStringValue(newprop, m_targetprop);
GetParent()->SetProperty(m_targetprop, newstringprop);
newstringprop->Release();
Modified: trunk/blender/source/gameengine/GameLogic/SConscript
===================================================================
--- trunk/blender/source/gameengine/GameLogic/SConscript 2012-04-09 01:24:56 UTC (rev 45478)
+++ trunk/blender/source/gameengine/GameLogic/SConscript 2012-04-09 01:42:44 UTC (rev 45479)
@@ -6,6 +6,7 @@
incs = '. #/intern/string #intern/container'
incs += ' #/source/gameengine/Expressions #/intern/moto/include'
incs += ' #/source/gameengine/Rasterizer #/source/gameengine/SceneGraph'
+incs += ' #/blender/blenlib'
defs = []
More information about the Bf-blender-cvs
mailing list