Blender V2.61 - r43446

DNA_controller_types.h

Go to the documentation of this file.
00001 /*
00002  * ***** BEGIN GPL LICENSE BLOCK *****
00003  *
00004  * This program is free software; you can redistribute it and/or
00005  * modify it under the terms of the GNU General Public License
00006  * as published by the Free Software Foundation; either version 2
00007  * of the License, or (at your option) any later version.
00008  *
00009  * This program is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012  * GNU General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU General Public License
00015  * along with this program; if not, write to the Free Software Foundation,
00016  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00017  *
00018  * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
00019  * All rights reserved.
00020  *
00021  * The Original Code is: all of this file.
00022  *
00023  * Contributor(s): none yet.
00024  *
00025  * ***** END GPL LICENSE BLOCK *****
00026  */
00027 
00032 #ifndef DNA_CONTROLLER_TYPES_H
00033 #define DNA_CONTROLLER_TYPES_H
00034 
00035 struct bActuator;
00036 struct Text;
00037 struct bSensor;
00038 
00039 /* ****************** CONTROLLERS ********************* */
00040 
00041 typedef struct bExpressionCont {
00042     char str[128];
00043 } bExpressionCont;
00044 
00045 typedef struct bPythonCont {
00046     struct Text *text;
00047     char module[64];
00048     int mode;
00049     int flag; /* only used for debug now */
00050 } bPythonCont;
00051 
00052 typedef struct bController {
00053     struct bController *next, *prev, *mynew;
00054     short type, flag, inputs, totlinks;
00055     short otype, totslinks, pad2, pad3;
00056     
00057     char name[64];
00058     void *data;
00059     
00060     struct bActuator **links;
00061 
00062     struct bSensor **slinks;
00063     short val, valo;
00064     unsigned int state_mask;
00065     
00066 } bController;
00067 
00068 /* controller->type */
00069 #define CONT_LOGIC_AND  0
00070 #define CONT_LOGIC_OR   1
00071 #define CONT_EXPRESSION 2
00072 #define CONT_PYTHON     3
00073 #define CONT_LOGIC_NAND 4
00074 #define CONT_LOGIC_NOR  5
00075 #define CONT_LOGIC_XOR  6
00076 #define CONT_LOGIC_XNOR 7
00077 
00078 /* controller->flag */
00079 #define CONT_SHOW       1
00080 #define CONT_DEL        2
00081 #define CONT_NEW        4
00082 #define CONT_MASK       8
00083 #define CONT_PRIO       16
00084 
00085 /* pyctrl->flag */
00086 #define CONT_PY_DEBUG   1
00087 
00088 /* pyctrl->mode */
00089 #define CONT_PY_SCRIPT  0
00090 #define CONT_PY_MODULE  1
00091 
00092 #endif
00093