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:
authorTon Roosendaal <ton@blender.org>2008-12-23 22:47:33 +0300
committerTon Roosendaal <ton@blender.org>2008-12-23 22:47:33 +0300
commitb38f6e7d184c6226de34bde375aa1ce5332c7665 (patch)
treeffe165247ef5b9c2621e226a62bdc7478ec37219 /source/blender/blenkernel/intern/property.c
parent93d9e7749df0a9fd89360ca9347f2fce1ac5dc29 (diff)
2.5
Object: converted the old horrible editobject.c, now as file: editors/object/object_edit.c Still lots of WIP, I've operatorified "Make Parent". Check here the new API at work: http://pasteall.org/3650/c IMPORTANT NOTE FOR BRECHT: game property defines were clashing with RNA, i've renamed game defines for now.
Diffstat (limited to 'source/blender/blenkernel/intern/property.c')
-rw-r--r--source/blender/blenkernel/intern/property.c54
1 files changed, 27 insertions, 27 deletions
diff --git a/source/blender/blenkernel/intern/property.c b/source/blender/blenkernel/intern/property.c
index 509cd8cf750..261b58454bd 100644
--- a/source/blender/blenkernel/intern/property.c
+++ b/source/blender/blenkernel/intern/property.c
@@ -103,19 +103,19 @@ void init_property(bProperty *prop)
prop->data= 0;
switch(prop->type) {
- case PROP_BOOL:
+ case GPROP_BOOL:
prop->poin= &prop->data;
break;
- case PROP_INT:
+ case GPROP_INT:
prop->poin= &prop->data;
break;
- case PROP_FLOAT:
+ case GPROP_FLOAT:
prop->poin= &prop->data;
break;
- case PROP_STRING:
+ case GPROP_STRING:
prop->poin= MEM_callocN(MAX_PROPSTRING, "property string");
break;
- case PROP_TIME:
+ case GPROP_TIME:
prop->poin= &prop->data;
break;
}
@@ -168,7 +168,7 @@ int compare_property(bProperty *prop, char *str)
float fvalue, ftest;
switch(prop->type) {
- case PROP_BOOL:
+ case GPROP_BOOL:
if(BLI_strcasecmp(str, "true")==0) {
if(prop->data==1) return 0;
else return 1;
@@ -177,14 +177,14 @@ int compare_property(bProperty *prop, char *str)
if(prop->data==0) return 0;
else return 1;
}
- /* no break, do prop_int too! */
+ /* no break, do GPROP_int too! */
- case PROP_INT:
+ case GPROP_INT:
return prop->data - atoi(str);
- case PROP_FLOAT:
- case PROP_TIME:
- // WARNING: untested for PROP_TIME
+ case GPROP_FLOAT:
+ case GPROP_TIME:
+ // WARNING: untested for GPROP_TIME
// function isn't used currently
fvalue= *((float *)&prop->data);
ftest= (float)atof(str);
@@ -192,7 +192,7 @@ int compare_property(bProperty *prop, char *str)
else if( fvalue < ftest) return -1;
return 0;
- case PROP_STRING:
+ case GPROP_STRING:
return strcmp(prop->poin, str);
}
@@ -204,19 +204,19 @@ void set_property(bProperty *prop, char *str)
// extern int Gdfra; /* sector.c */
switch(prop->type) {
- case PROP_BOOL:
+ case GPROP_BOOL:
if(BLI_strcasecmp(str, "true")==0) prop->data= 1;
else if(BLI_strcasecmp(str, "false")==0) prop->data= 0;
else prop->data= (atoi(str)!=0);
break;
- case PROP_INT:
+ case GPROP_INT:
prop->data= atoi(str);
break;
- case PROP_FLOAT:
- case PROP_TIME:
+ case GPROP_FLOAT:
+ case GPROP_TIME:
*((float *)&prop->data)= (float)atof(str);
break;
- case PROP_STRING:
+ case GPROP_STRING:
strcpy(prop->poin, str);
break;
}
@@ -228,15 +228,15 @@ void add_property(bProperty *prop, char *str)
// extern int Gdfra; /* sector.c */
switch(prop->type) {
- case PROP_BOOL:
- case PROP_INT:
+ case GPROP_BOOL:
+ case GPROP_INT:
prop->data+= atoi(str);
break;
- case PROP_FLOAT:
- case PROP_TIME:
+ case GPROP_FLOAT:
+ case GPROP_TIME:
*((float *)&prop->data)+= (float)atof(str);
break;
- case PROP_STRING:
+ case GPROP_STRING:
/* strcpy(prop->poin, str); */
break;
}
@@ -250,15 +250,15 @@ void set_property_valstr(bProperty *prop, char *str)
if(str == NULL) return;
switch(prop->type) {
- case PROP_BOOL:
- case PROP_INT:
+ case GPROP_BOOL:
+ case GPROP_INT:
sprintf(str, "%d", prop->data);
break;
- case PROP_FLOAT:
- case PROP_TIME:
+ case GPROP_FLOAT:
+ case GPROP_TIME:
sprintf(str, "%f", *((float *)&prop->data));
break;
- case PROP_STRING:
+ case GPROP_STRING:
BLI_strncpy(str, prop->poin, MAX_PROPSTRING);
break;
}