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>2012-09-21 08:09:09 +0400
committerDalai Felinto <dfelinto@gmail.com>2012-09-21 08:09:09 +0400
commit184a232ccc85fc3aa16d7e5f3adbe55e2b379562 (patch)
treebb7df5345e6c4b532b90d69da83b69adb1fb8bc1 /source/blender/blenkernel/intern/sca.c
parentb889e9c573cc5512cfd0a9a466928b1387235a76 (diff)
2.49 feature: Game Controller State name shows up when mouse over them (the name of a state is the name of the top controller of this state)
review and small tweaks by Campbell Barton
Diffstat (limited to 'source/blender/blenkernel/intern/sca.c')
-rw-r--r--source/blender/blenkernel/intern/sca.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/sca.c b/source/blender/blenkernel/intern/sca.c
index be2f1872efa..6c1fbbfa9a0 100644
--- a/source/blender/blenkernel/intern/sca.c
+++ b/source/blender/blenkernel/intern/sca.c
@@ -875,3 +875,20 @@ void unlink_logicbricks(void **poin, void ***ppoin, short *tot)
return;
}
}
+
+const char *sca_state_name_get(Object *ob, short bit)
+{
+ bController *cont;
+ unsigned int mask;
+
+ mask = (1<<bit);
+ cont = ob->controllers.first;
+ while (cont) {
+ if (cont->state_mask & mask) {
+ return cont->name;
+ }
+ cont = cont->next;
+ }
+ return NULL;
+}
+