[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [50785] trunk/blender/source/blender/ editors/space_logic/logic_window.c: Logic Editor code cleanup > 2500 lines removed - old 2.49 UI code
Dalai Felinto
dfelinto at gmail.com
Fri Sep 21 07:19:07 CEST 2012
Revision: 50785
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=50785
Author: dfelinto
Date: 2012-09-21 05:19:06 +0000 (Fri, 21 Sep 2012)
Log Message:
-----------
Logic Editor code cleanup > 2500 lines removed - old 2.49 UI code
since last two commits the UI has all the features we had in 2.49, time to remove the old code :)
Modified Paths:
--------------
trunk/blender/source/blender/editors/space_logic/logic_window.c
Modified: trunk/blender/source/blender/editors/space_logic/logic_window.c
===================================================================
--- trunk/blender/source/blender/editors/space_logic/logic_window.c 2012-09-21 04:12:55 UTC (rev 50784)
+++ trunk/blender/source/blender/editors/space_logic/logic_window.c 2012-09-21 05:19:06 UTC (rev 50785)
@@ -186,178 +186,6 @@
MEM_freeN(names);
}
-static void make_unique_prop_names_cb(bContext *C, void *strv, void *UNUSED(redraw_view3d_flagv))
-{
- char *str= strv;
-// int redraw_view3d_flag= GET_INT_FROM_POINTER(redraw_view3d_flagv);
-
- make_unique_prop_names(C, str);
-}
-
-
-static void old_sca_move_sensor(bContext *C, void *datav, void *move_up)
-{
- /* deprecated, no longer using it (moved to sca.c) */
- Scene *scene= CTX_data_scene(C);
- bSensor *sens_to_delete= datav;
- int val;
- Base *base;
- bSensor *sens, *tmp;
-
- // val= pupmenu("Move up%x1|Move down %x2");
- val = move_up ? 1:2;
-
- if (val>0) {
- /* now find out which object has this ... */
- base= FIRSTBASE;
- while (base) {
-
- sens= base->object->sensors.first;
- while (sens) {
- if (sens == sens_to_delete) break;
- sens= sens->next;
- }
-
- if (sens) {
- if ( val==1 && sens->prev) {
- for (tmp=sens->prev; tmp; tmp=tmp->prev) {
- if (tmp->flag & SENS_VISIBLE)
- break;
- }
- if (tmp) {
- BLI_remlink(&base->object->sensors, sens);
- BLI_insertlinkbefore(&base->object->sensors, tmp, sens);
- }
- }
- else if ( val==2 && sens->next) {
- for (tmp=sens->next; tmp; tmp=tmp->next) {
- if (tmp->flag & SENS_VISIBLE)
- break;
- }
- if (tmp) {
- BLI_remlink(&base->object->sensors, sens);
- BLI_insertlink(&base->object->sensors, tmp, sens);
- }
- }
- ED_undo_push(C, "Move sensor");
- break;
- }
-
- base= base->next;
- }
- }
-}
-
-static void old_sca_move_controller(bContext *C, void *datav, void *move_up)
-{
- /* deprecated, no longer using it (moved to sca.c) */
- Scene *scene= CTX_data_scene(C);
- bController *controller_to_del= datav;
- int val;
- Base *base;
- bController *cont, *tmp;
-
- //val= pupmenu("Move up%x1|Move down %x2");
- val = move_up ? 1:2;
-
- if (val>0) {
- /* now find out which object has this ... */
- base= FIRSTBASE;
- while (base) {
-
- cont= base->object->controllers.first;
- while (cont) {
- if (cont == controller_to_del) break;
- cont= cont->next;
- }
-
- if (cont) {
- if ( val==1 && cont->prev) {
- /* locate the controller that has the same state mask but is earlier in the list */
- tmp = cont->prev;
- while (tmp) {
- if (tmp->state_mask & cont->state_mask)
- break;
- tmp = tmp->prev;
- }
- if (tmp) {
- BLI_remlink(&base->object->controllers, cont);
- BLI_insertlinkbefore(&base->object->controllers, tmp, cont);
- }
- }
- else if ( val==2 && cont->next) {
- tmp = cont->next;
- while (tmp) {
- if (tmp->state_mask & cont->state_mask)
- break;
- tmp = tmp->next;
- }
- BLI_remlink(&base->object->controllers, cont);
- BLI_insertlink(&base->object->controllers, tmp, cont);
- }
- ED_undo_push(C, "Move controller");
- break;
- }
-
- base= base->next;
- }
- }
-}
-
-static void old_sca_move_actuator(bContext *C, void *datav, void *move_up)
-{
- /* deprecated, no longer using it (moved to sca.c) */
- Scene *scene= CTX_data_scene(C);
- bActuator *actuator_to_move= datav;
- int val;
- Base *base;
- bActuator *act, *tmp;
-
- //val= pupmenu("Move up%x1|Move down %x2");
- val = move_up ? 1:2;
-
- if (val>0) {
- /* now find out which object has this ... */
- base= FIRSTBASE;
- while (base) {
-
- act= base->object->actuators.first;
- while (act) {
- if (act == actuator_to_move) break;
- act= act->next;
- }
-
- if (act) {
- if ( val==1 && act->prev) {
- /* locate the first visible actuators before this one */
- for (tmp = act->prev; tmp; tmp=tmp->prev) {
- if (tmp->flag & ACT_VISIBLE)
- break;
- }
- if (tmp) {
- BLI_remlink(&base->object->actuators, act);
- BLI_insertlinkbefore(&base->object->actuators, tmp, act);
- }
- }
- else if ( val==2 && act->next) {
- for (tmp=act->next; tmp; tmp=tmp->next) {
- if (tmp->flag & ACT_VISIBLE)
- break;
- }
- if (tmp) {
- BLI_remlink(&base->object->actuators, act);
- BLI_insertlink(&base->object->actuators, tmp, act);
- }
- }
- ED_undo_push(C, "Move actuator");
- break;
- }
-
- base= base->next;
- }
- }
-}
-
static void do_logic_buts(bContext *C, void *UNUSED(arg), int event)
{
Main *bmain= CTX_data_main(C);
@@ -630,14 +458,6 @@
return "unknown";
}
-static const char *sensor_pup(void)
-{
- /* the number needs to match defines in DNA_sensor_types.h */
- return "Sensors %t|Always %x0|Delay %x13|Keyboard %x3|Mouse %x5|"
- "Touch %x1|Collision %x6|Near %x2|Radar %x7|"
- "Property %x4|Random %x8|Ray %x9|Message %x10|Joystick %x11|Actuator %x12|Armature %x14";
-}
-
static const char *controller_name(int type)
{
switch (type) {
@@ -661,11 +481,6 @@
return "unknown";
}
-static const char *controller_pup(void)
-{
- return "Controllers %t|AND %x0|OR %x1|XOR %x6|NAND %x4|NOR %x5|XNOR %x7|Expression %x2|Python %x3";
-}
-
static const char *actuator_name(int type)
{
switch (type) {
@@ -717,36 +532,6 @@
return "unknown";
}
-
-
-
-static const char *actuator_pup(Object *owner)
-{
- switch (owner->type) {
- case OB_ARMATURE:
- return ("Actuators %t|Action %x15|Armature %x23|Motion %x0|Constraint %x9|Ipo %x1"
- "|Camera %x3|Sound %x5|Property %x6|Edit Object %x10"
- "|Scene %x11|Random %x13|Message %x14|Game %x17"
- "|Visibility %x18|2D Filter %x19|Parent %x20|State %x22");
- break;
-
- case OB_MESH:
- return ("Actuators %t|Shape Action %x21|Motion %x0|Constraint %x9|Ipo %x1"
- "|Camera %x3|Sound %x5|Property %x6|Edit Object %x10"
- "|Scene %x11|Random %x13|Message %x14|Game %x17"
- "|Visibility %x18|2D Filter %x19|Parent %x20|State %x22");
- break;
-
- default:
- return ("Actuators %t|Motion %x0|Constraint %x9|Ipo %x1"
- "|Camera %x3|Sound %x5|Property %x6|Edit Object %x10"
- "|Scene %x11|Random %x13|Message %x14|Game %x17"
- "|Visibility %x18|2D Filter %x19|Parent %x20|State %x22");
- }
-}
-
-
-
static void set_sca_ob(Object *ob)
{
bController *cont;
@@ -934,151 +719,6 @@
return idar;
}
-
-static int get_col_sensor(int type)
-{
- /* XXX themecolors not here */
-
- switch (type) {
- case SENS_ALWAYS: return TH_PANEL;
- case SENS_DELAY: return TH_PANEL;
- case SENS_TOUCH: return TH_PANEL;
- case SENS_COLLISION: return TH_PANEL;
- case SENS_NEAR: return TH_PANEL;
- case SENS_KEYBOARD: return TH_PANEL;
- case SENS_PROPERTY: return TH_PANEL;
- case SENS_ARMATURE: return TH_PANEL;
- case SENS_ACTUATOR: return TH_PANEL;
- case SENS_MOUSE: return TH_PANEL;
- case SENS_RADAR: return TH_PANEL;
- case SENS_RANDOM: return TH_PANEL;
- case SENS_RAY: return TH_PANEL;
- case SENS_MESSAGE: return TH_PANEL;
- case SENS_JOYSTICK: return TH_PANEL;
- default: return TH_PANEL;
- }
-}
-static void set_col_sensor(int type, int medium)
-{
- int col= get_col_sensor(type);
- UI_ThemeColorShade(col, medium?30:0);
-}
-
-
-static void verify_logicbutton_func(bContext *UNUSED(C), void *data1, void *data2)
-{
- bSensor *sens= (bSensor*)data1;
-
- if (sens->level && sens->tap) {
- if (data2 == &(sens->level))
- sens->tap= 0;
- else
- sens->level= 0;
- }
-}
-
-static void test_scriptpoin_but(struct bContext *C, const char *name, ID **idpp)
-{
- *idpp= BLI_findstring(&CTX_data_main(C)->text, name, offsetof(ID, name) + 2);
-}
-
-static void test_actionpoin_but(struct bContext *C, const char *name, ID **idpp)
-{
- *idpp= BLI_findstring(&CTX_data_main(C)->action, name, offsetof(ID, name) + 2);
- if (*idpp)
- id_us_plus(*idpp);
-}
-
-
-static void test_obpoin_but(struct bContext *C, const char *name, ID **idpp)
-{
- *idpp= BLI_findstring(&CTX_data_main(C)->object, name, offsetof(ID, name) + 2);
- if (*idpp)
- id_lib_extern(*idpp); /* checks lib data, sets correct flag for saving then */
-}
-
-static void test_meshpoin_but(struct bContext *C, const char *name, ID **idpp)
-{
- *idpp= BLI_findstring(&CTX_data_main(C)->mesh, name, offsetof(ID, name) + 2);
- if (*idpp)
- id_us_plus(*idpp);
-}
-
-static void test_matpoin_but(struct bContext *C, const char *name, ID **idpp)
-{
- *idpp= BLI_findstring(&CTX_data_main(C)->mat, name, offsetof(ID, name) + 2);
- if (*idpp)
- id_us_plus(*idpp);
-}
-
-static void test_scenepoin_but(struct bContext *C, const char *name, ID **idpp)
-{
- *idpp= BLI_findstring(&CTX_data_main(C)->scene, name, offsetof(ID, name) + 2);
- if (*idpp)
- id_us_plus(*idpp);
-}
-
-static void test_keyboard_event(struct bContext *UNUSED(C), void *arg_ks, void *UNUSED(arg))
-{
- bKeyboardSensor *ks= (bKeyboardSensor*)arg_ks;
-
- if (!ISKEYBOARD(ks->key))
- ks->key= 0;
- if (!ISKEYBOARD(ks->qual))
- ks->qual= 0;
- if (!ISKEYBOARD(ks->qual2))
- ks->qual2= 0;
-}
-
-/**
- * Draws a toggle for pulse mode, a frequency field and a toggle to invert
- * the value of this sensor. Operates on the shared data block of sensors.
- */
-static void draw_default_sensor_header(bSensor *sens,
- uiBlock *block,
- short x,
- short y,
- short w)
-{
- uiBut *but;
-
- /* Pulsing and frequency */
- uiBlockBeginAlign(block);
- uiDefIconButBitS(block, TOG, SENS_PULSE_REPEAT, 1, ICON_DOTSUP,
- (short)(x + 10 + 0.0 * (w - 20)), (short)(y - 21), (short)(0.1 * (w - 20)), 19,
- &sens->pulse, 0.0, 0.0, 0, 0,
- "Activate TRUE level triggering (pulse mode)");
-
- uiDefIconButBitS(block, TOG, SENS_NEG_PULSE_MODE, 1, ICON_DOTSDOWN,
- (short)(x + 10 + 0.1 * (w-20)), (short)(y - 21), (short)(0.1 * (w-20)), 19,
- &sens->pulse, 0.0, 0.0, 0, 0,
- "Activate FALSE level triggering (pulse mode)");
- uiDefButS(block, NUM, 1, "f:",
- (short)(x + 10 + 0.2 * (w-20)), (short)(y - 21), (short)(0.275 * (w-20)), 19,
- &sens->freq, 0.0, 10000.0, 0, 0,
- "Delay between repeated pulses (in logic tics, 0 = no delay)");
- uiBlockEndAlign(block);
-
- /* value or shift? */
- uiBlockBeginAlign(block);
- but = uiDefButS(block, TOG, 1, "Level",
- (short)(x + 10 + 0.5 * (w-20)), (short)(y - 21), (short)(0.20 * (w-20)), 19,
- &sens->level, 0.0, 0.0, 0, 0,
- "Level detector, trigger controllers of new states (only applicable upon logic state transition)");
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list